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

Put back graph clean-modified subcommand #1542

Merged
merged 2 commits into from Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 28 additions & 2 deletions reference/commands/misc/graph.rst
Expand Up @@ -5,17 +5,18 @@ conan graph

.. code-block:: bash

$ conan graph [-h] {update-lock,build-order,lock} ...
$ conan graph [-h] {update-lock,build-order,clean-modified,lock} ...

Generates and manipulates lock files.

.. code-block:: text

positional arguments:
{update-lock,build-order,lock}
{update-lock,build-order,clean-modified,lock}
sub-command help
update-lock merge two lockfiles
build-order Returns build-order
clean-modified Clean modified
lock create a lockfile

optional arguments:
Expand Down Expand Up @@ -62,6 +63,31 @@ in the folder pkgb_temp) in the main lockfile:
$ conan graph update-lock release/conan.lock pkgb_temp/release/conan.lock


.. _conan_graph_clean_modified:

conan graph clean-modified
--------------------------

.. code-block:: bash

$ conan graph clean-modified [-h] lockfile

Cleans all "modified" flags from the given lockfile.

.. code-block:: text

positional arguments:
lockfile lockfile folder

optional arguments:
-h, --help show this help message and exit

When a package of a dependency graph is going to be re-built, using a given lockfile,
it is desired to finish the build knowing which packages of the graph have been
actually rebuilt as a result of the last command. This command will clean all the
previously existing "modified" flags before such build, so after the build
the "modified" are only those that have been built now.

.. _conan_graph_build_order:

conan graph build-order
Expand Down
16 changes: 16 additions & 0 deletions versioning/lockfiles.rst
Expand Up @@ -102,6 +102,15 @@ There are 2 main entry points for lockfile information in conan commands:
generate a lockfile, but the problem with :command:`conan info -if=.` is that it does not allow to
specify a profile or settings.

- :command:`conan graph clean-modified`

When a :command:`conan create` command that uses a lockfile builds a new binary, its reference
will change. This change, typically in the form of a recipe revision and/or package revision
is updated in the lockfile and the node is marked as "modified". This :command:`clean-modified`
removes these "modified" flags from a lockfile. This operation is typically needed before starting
the build of a package in a locked graph, to know exactly which nodes have been modified by this
operation.

- :command:`conan graph update-lock`

Update the current lockfile with the information of the second lockfile. Only the nodes marked
Expand Down Expand Up @@ -240,6 +249,13 @@ We can now proceed iteratively with the following procedure:

$ conan graph build-order ./release --json=bo.json --build=missing

7. clean "modified" nodes from the lockfile

.. code:: bash

$ conan graph clean-modified release/


Note that this is a suboptimal approach, in order to explain the functionality, which
is more easy to follow if it is sequential. In reality, the CI can take the first
sublist output of :command:`conan graph build-order` and fire all its packages in parallel,
Expand Down