Skip to content

lockfiles - #5412

Merged
lasote merged 10 commits into
conan-io:developfrom
memsharded:feature/lockfiles
Jul 8, 2019
Merged

lasote merged 10 commits into
conan-io:developfrom
memsharded:feature/lockfiles

Conversation

@memsharded

@memsharded memsharded commented Jun 27, 2019

Copy link
Copy Markdown
Member

Changelog: Feature: Implementation of lockfiles. Lockfiles store in a file all the configuration, exact versions (including revisions), necessary to achieve reproducible builds, even when using version-ranges or package revisions.
Docs: conan-io/docs#1350

--lockfile

  • The main addition to the UI is an argument --lockfile that applies to multiple commands (create, install, info, test) and acts both as input and output
  • Commands that modify a package, like rebuilding it, will modify the lockfile, and that node will be marked as "modified"
  • The default value for --lockfile is the current dir, and the default filename is conan.lock
  • The file must exist when specified --lockfile
  • Commands like conan install . will generate a conan.lock file by default, without needing to specify an output, but won't be used unless --lockfile is specified.
  • The conan.lock lockfile contains a copy of the effective profile

New command conan graph

  • conan graph lock generates a new conan.lock lockfile. This is necessary if we don't want to actually install binaries yet (CI), and the conan info will fail if we try to specify a profile or settings
  • conan graph build-order gets a lockfile and outputs a list of lists in order to be build: Each item has the node ID, not used yet, and the package reference of the node to build
  • conan graph update is able to update a lockfile with another lockfile, that has been modified (like building some of its packages again)
  • conan graph clean-modified removes the "modified" flag from all packages in a lockfile

@memsharded
memsharded marked this pull request as ready for review June 28, 2019 04:09

@lasote lasote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

Comment thread conans/client/command.py Outdated
Comment thread conans/client/command.py Outdated
parser.add_argument('-k', '-ks', '--keep-source', default=False, action='store_true',
help=_KEEP_SOURCE_HELP)
parser.add_argument("-l", "--lockfile", action=OnceArgument, nargs='?', const=".",
help="Path to lockfile. Lockfile will be updated with "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

Comment thread conans/client/command.py
merge_cmd.add_argument('new_lockfile', help='path to modified lockfile')

build_order_cmd = subparsers.add_parser('build-order', help='Returns build-order')
build_order_cmd.add_argument('lockfile', help='lockfile folder')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path to a folder containing a conan.lock file

@lasote lasote added this to the 1.17 milestone Jun 28, 2019
Comment thread conans/client/conan_api.py Outdated
@lasote

lasote commented Jun 28, 2019

Copy link
Copy Markdown
Contributor

Of course, we need goods docs also. I think the better would be to document the typical usage of the locks with examples. We can describe (later, probably when better tested) in another section the CI flows, recommendations, alternatives... etc.

@lasote

lasote commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

What about the suggestions for the command help? Don't you want to change them?

@memsharded

Copy link
Copy Markdown
Member Author

Actually, the --lockfile argument support also using custom files, so not only the folder, but also different filenames. It was already there, but not tested, I have added some test to have it covered.

@lasote

lasote commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

Oh! Then Path to a folder containing a conan.lock file or path to a lock file with any name or similar.

@lasote lasote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docs!

danimtb and others added 2 commits July 7, 2019 23:29
…an-io#5441)

* Fix verify_ssl field in SCM discarded when used with False value

* Added comment

* leave only None check

* Also discard empty strings to avoid breaking tests
@memsharded

Copy link
Copy Markdown
Member Author

@lasote
lasote merged commit de33bf7 into conan-io:develop Jul 8, 2019
@memsharded
memsharded deleted the feature/lockfiles branch July 8, 2019 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants