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

lockfiles #5412

Merged
merged 10 commits into from Jul 8, 2019
Merged

lockfiles #5412

merged 10 commits into from Jul 8, 2019

Conversation

@memsharded
Copy link
Member

@memsharded memsharded commented Jun 27, 2019

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 Jun 28, 2019
Copy link
Contributor

@lasote lasote left a comment

Almost there!

conans/client/command.py Outdated Show resolved Hide resolved
@@ -917,13 +926,16 @@ def export(self, *args):
"and version are not declared in the conanfile.py")
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
Contributor

@lasote lasote Jun 28, 2019

Idem

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
Contributor

@lasote lasote Jun 28, 2019

Path to a folder containing a conan.lock file

@lasote lasote added this to the 1.17 milestone Jun 28, 2019
conans/client/conan_api.py Outdated Show resolved Hide resolved
@lasote
Copy link
Contributor

@lasote lasote commented Jun 28, 2019

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
Copy link
Contributor

@lasote lasote commented Jul 4, 2019

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

@memsharded
Copy link
Member Author

@memsharded memsharded commented Jul 4, 2019

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
Copy link
Contributor

@lasote lasote commented Jul 4, 2019

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

Copy link
Contributor

@lasote lasote left a comment

Missing docs!

danimtb and others added 2 commits Jul 8, 2019
…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
Member Author

@memsharded memsharded commented Jul 8, 2019

@lasote lasote merged commit de33bf7 into conan-io:develop Jul 8, 2019
2 checks passed
@memsharded memsharded deleted the feature/lockfiles branch Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants