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

documentation for --build unlock of lockfiles #1939

Merged
merged 5 commits into from
Dec 2, 2020
Merged
Changes from 1 commit
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
33 changes: 33 additions & 0 deletions versioning/lockfiles/evolving.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,39 @@ compute from it the configuration specific profiles.
These partial lockfiles will be smaller than the original app lockfiles, not containing information at all about
``app`` and ``libc``.

Unlocking packages with --build
+++++++++++++++++++++++++++++++

It is also possible to derive a partial lockfile for `libb/1.0`` without cloning the ``libb`` repository, directly with:
memsharded marked this conversation as resolved.
Show resolved Hide resolved

.. code:: bash

$ conan lock create --reference=libb/1.0 --lockfile=app_release.lock --lockfile-out=libb_release.lock
$ conan lock create --reference=libb/1.0 --lockfile=app_debug.lock --lockfile-out=libb_debug.lock

These new lockfiles could be used to install the ``libb/1.0`` package, without building it, but if we tried to
build it from sources, it will fail:

.. code:: bash

$ conan install libb/1.0@ --lockfile=libb_release.lock # Works
$ conan install libb/1.0@ --build=libb --lockfile=libb_release.lock # Fails, libb is locked

The second scenario fails, because when we captured *app_release.lock* lockfile, it was completely locking all the
information, including the package revision of ``libb/1.0``. If we try to build a new binary, the lock protection will
memsharded marked this conversation as resolved.
Show resolved Hide resolved
raise. If we want to "unlock" the binary package revision, we need to tell the lockfile when we are capturing such
lockfile, that we plan to build it, with the ``--build`` argument:
memsharded marked this conversation as resolved.
Show resolved Hide resolved

.. code:: bash

# Note the --build=libb argument
$ conan lock create --reference=libb/1.0 --build=libb --lockfile=app_release.lock --lockfile-out=libb_release.lock
# This will work, building a new binary
$ conan install libb/1.0@ --build=libb --lockfile=libb_release.lock --lockfile-out=libb_release2.lock

As usual, if you are building a new binary, it is desired to provide a --lockfile-out=libb_release2.lock`` to capture such
memsharded marked this conversation as resolved.
Show resolved Hide resolved
a new binary package revision in the new lockfile.


Integrating a partial lockfile
------------------------------
Expand Down