Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev2] [Part 2] Configuration files: profiles #2959

Merged
merged 36 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
923b8c7
Adding global.conf to configuration files section
franramirez688 Feb 8, 2023
0647768
Update reference/config_files/global_conf.rst
franramirez688 Feb 8, 2023
b4d3524
Update reference/config_files/global_conf.rst
franramirez688 Feb 8, 2023
d38e2dc
Update reference/config_files/global_conf.rst
franramirez688 Feb 8, 2023
d6707e0
Update reference/config_files/global_conf.rst
franramirez688 Feb 8, 2023
ff2b825
Update reference/config_files/global_conf.rst
franramirez688 Feb 8, 2023
34e68d8
Update reference/config_files/global_conf.rst
franramirez688 Feb 8, 2023
918c2cb
applying suggestions
franramirez688 Feb 8, 2023
a5c39c4
Update reference/config_files/global_conf.rst
franramirez688 Feb 9, 2023
e345f54
Update reference/config_files/global_conf.rst
franramirez688 Feb 9, 2023
0d916a2
Update reference/config_files/global_conf.rst
franramirez688 Feb 9, 2023
fa2c0c3
Update reference/config_files/global_conf.rst
franramirez688 Feb 9, 2023
fc27422
explaining types of confs
franramirez688 Feb 9, 2023
3fa4cff
porting profiles
franramirez688 Feb 8, 2023
8d878b9
wip
franramirez688 Feb 8, 2023
c012ff2
wip
franramirez688 Feb 8, 2023
18629c7
wip
franramirez688 Feb 9, 2023
40d1277
wip
franramirez688 Feb 9, 2023
880132f
wip
franramirez688 Feb 9, 2023
06fa4ff
wip
franramirez688 Feb 9, 2023
aab79cf
wip
franramirez688 Feb 9, 2023
45390f0
Merge remote-tracking branch 'conan/release/2.0.0-beta' into porting_…
franramirez688 Feb 9, 2023
4c1856f
applied patterns
franramirez688 Feb 9, 2023
1deab49
wip
franramirez688 Feb 9, 2023
c8e69cf
First sections, then rendering
franramirez688 Feb 10, 2023
7352099
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
bdbad63
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
efcd0b6
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
8470bb7
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
c3e45a8
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
56c0951
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
65be409
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
2663a7d
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
d74bf94
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
5485e4c
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
4c20a77
Update reference/config_files/profiles.rst
franramirez688 Feb 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions reference/commands/install.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _reference_commands_install:

conan install
=============

Expand Down Expand Up @@ -181,6 +183,8 @@ command line:
In the general case, it is recommended to use a ``conanfile`` instead of defining things in the command line.


.. _reference_commands_install_composition:

Profiles, Settings, Options, Conf
---------------------------------

Expand Down
1 change: 1 addition & 0 deletions reference/config_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ These are the most important configuration files, used to customize conan.
:maxdepth: 2

config_files/global_conf
config_files/profiles
77 changes: 14 additions & 63 deletions reference/config_files/global_conf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Let's briefly explain the three types of existing configurations:
* ``core.*``: aimed to configure values of Conan core behavior (download retries, package ID modes, etc.).
Only definable in *global.conf* file.
* ``tools.*``: aimed to configure values of Conan tools (toolchains, build helpers, etc.) used in your recipes.
Definable in both *global.conf* and *profiles*.
Definable in both *global.conf* and :ref:`profiles <reference_config_files_profiles>`.
* ``user.*``: aimed to define personal user configurations. They can define whatever user wants.
Definable in both *global.conf* and *profiles*.
Definable in both *global.conf* and :ref:`profiles <reference_config_files_profiles>`.



Expand Down Expand Up @@ -116,25 +116,26 @@ To list all the possible configurations available, run :command:`conan config li
tools.system.package_manager:tool: Default package manager tool: 'apt-get', 'yum', 'dnf', 'brew', 'pacman', 'choco', 'zypper', 'pkg' or 'pkgutil'


User/Tools configurations
-------------------------

Tools and user configurations can be defined in both the *global.conf* file and
:ref:`Conan profiles <reference_config_files_profiles_conf>`. They look like:

Tools configurations
--------------------

Tools and user configurations allow them to be defined both in the *global.conf* file and in profile files. Profile values will
have priority over globally defined ones in *global.conf*, and can be defined as:

.. code-block:: text
:caption: *myprofile*

[settings]
...
:caption: *global.conf*

[conf]
tools.microsoft.msbuild:verbosity=Diagnostic
tools.microsoft.msbuild:max_cpu_count=2
tools.microsoft.msbuild:vs_version = 16
tools.build:jobs=10
# User conf variable
user.confvar:something=False

.. important::

Profiles values will have priority over globally defined ones in global.conf.


Configuration file template
Expand Down Expand Up @@ -178,7 +179,6 @@ All the values will be interpreted by Conan as the result of the python built-in
Configuration data operators
----------------------------


It's also possible to use some extra operators when you're composing tool configurations in your *global.conf* or
any of your profiles:

Expand All @@ -187,12 +187,8 @@ any of your profiles:
* ``=!`` == ``unset``: gets rid of any configuration value.

.. code-block:: text
:caption: *myprofile*

[settings]
...
:caption: *global.conf*

[conf]
# Define the value => ["-f1"]
user.myconf.build:flags=["-f1"]

Expand All @@ -206,51 +202,6 @@ any of your profiles:
user.myconf.build:flags=!


Configuration in your profiles
--------------------------------

Let's see a little bit more complex example trying different configurations coming from the *global.conf* and a simple profile:

.. code-block:: text
:caption: *global.conf*

# Defining several lists
user.myconf.build:ldflags=["--flag1 value1"]
user.myconf.build:cflags=["--flag1 value1"]


.. code-block:: text
:caption: *myprofile*

[settings]
...

[conf]
# Appending values into the existing list
user.myconf.build:ldflags+=["--flag2 value2"]

# Unsetting the existing value (it'd be like we define it as an empty value)
user.myconf.build:cflags=!

# Prepending values into the existing list
user.myconf.build:ldflags=+["--prefix prefix-value"]


Running, for instance, :command:`conan install . -pr myprofile`, the configuration output will be something like:

.. code-block:: bash

...
Configuration:
[settings]
[options]
[tool_requires]
[conf]
user.myconf.build:cflags=!
user.myconf.build:ldflags=['--prefix prefix-value', '--flag1 value1', '--flag2 value2']
...


Configuration patterns
----------------------

Expand Down
Loading