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

new profile args in build-order files #3884

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
88 changes: 88 additions & 0 deletions bo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"order_by": "recipe",
"reduced": false,
"order": [
[
{
"ref": "zlib/1.3.1#f52e03ae3d251dec704634230cd806a2",
"depends": [],
"packages": [
[
{
"package_id": "8b7e35f91e516e42ed736c6dd52a9263da3a5dad",
"prev": null,
"context": "host",
"binary": "Missing",
"options": [],
"filenames": [],
"depends": [],
"overrides": {},
"build_args": null,
"info": {
"settings": {
"os": "Windows",
"arch": "x86_64",
"compiler": "msvc",
"compiler.runtime": "dynamic",
"compiler.runtime_type": "Debug",
"compiler.version": "194",
"build_type": "Debug"
},
"options": {
"shared": "False"
}
}
}
]
]
}
],
[
{
"ref": "libpng/1.5.30#efa4bfdf973993197dbaa85b8c320723",
"depends": [
"zlib/1.3.1#f52e03ae3d251dec704634230cd806a2"
],
"packages": [
[
{
"package_id": "34b444759868b4ce4f04f81d4ad4927bd78d7d3e",
"prev": null,
"context": "host",
"binary": "Missing",
"options": [],
"filenames": [],
"depends": [],
"overrides": {},
"build_args": null,
"info": {
"settings": {
"os": "Windows",
"arch": "x86_64",
"compiler": "msvc",
"compiler.runtime": "dynamic",
"compiler.runtime_type": "Debug",
"compiler.version": "194",
"build_type": "Debug"
},
"options": {
"api_prefix": "",
"shared": "False",
"sse": "True"
},
"requires": [
"zlib/1.3.Z"
]
}
}
]
]
}
]
],
"profiles": {
"self": {
"args": "-pr:h=\"default\" -s:h=\"build_type=Debug\""
}
}
}
14 changes: 12 additions & 2 deletions reference/commands/graph/build_order.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,25 @@ Let's consider installing `libpng` and wanting to see the build order for this r
]
}
]
]
],
"profiles": {
"self": {
"args": ""
}
}
}


Firstly, we can see the `zlib` package, as `libpng` depends on it. The output is sorted by
Firstly, we can see the ``zlib`` package, as ``libpng`` depends on it. The output is sorted by
recipes as we passed with the `--order-by` argument; however, we might prefer to see it
sorted by configurations instead. For that purpouse use the `--order-by` argument with
value `configuration`.

At the end of the json, after the ``order`` field, we see a ``profiles`` field, that contains the profile related command line arguments for the current "build-order". As in this case we didn't provide any arguments, it is empty. But if we used something like ``conan graph build-order ... -pr=default -s build_type=Debug> bo.json``, the ``args`` will contain those arguments (with json character escaping): ``"args": "-pr:h=\"default\" -s:h=\"build_type=Debug\""``
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved


Using ``--order-by=configuration`` we will get a different build-order format:

.. code-block:: text

$ conan graph build-order --requires=libpng/1.5.30 --format=json --order-by=configuration
Expand Down
18 changes: 17 additions & 1 deletion reference/commands/graph/build_order_merge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,20 @@ Note that only build-orders that haven't been reduced with ``--reduce`` can be m

The result of merging the different input files can be also reduced with the ``conan graph build-order-merge --reduce``
argument, and the behavior will be the same, leave only the elements that need to be built from source.



When 2 or more "build-order" files are merged, the resulting merge contains a ``profiles`` section like:

.. code-block:: json

"profiles": {
"build_order_win": {
"args": "-pr:h=\"profile1\" -s:h=\"os=Windows\" ..."
},
"build_order_nix": {
"args": "-pr:h=\"profile2\" -s:h=\"os=Linux\" ..."
}
}

Being the ``build_order_win`` and ``build_order_nix`` the "build-order" filenames that were used as inputs to the merge, and which will be referenced in the ``filenames`` field of every ``package`` in the build order. This way, it is easier to obtain the necessary command line arguments to build a specific package binary in the build-order when building multiple configurations.
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved