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

add unknown package-ID in build-order #6251

Merged

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Dec 18, 2019

Changelog: Bugfix: Include "Package ID Unknown" nodes in conan graph build-order, as they need to be processed in that order.
Docs: Omit

Close #6232

Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

I feel like it is easier to see the JSON itself

conans/test/functional/graph_lock/graph_lock_test.py Outdated Show resolved Hide resolved
@memsharded
Copy link
Member Author

Fixed the test following to your suggestion.

Please feedback that it makes sense to include ID-Unknown packages in the build-order output.

Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

I wouldn't add the :Package_ID_unknown to the reference in the JSON output, because:

>>> from conans.model.ref import ConanFileReference
>>> r = ConanFileReference.loads("liba/0.1#7086607aa6efbad8e2527748e3ee8237:Package_ID_unknown")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jgsogo/dev/conan/conan/conans/model/ref.py", line 198, in loads
    ref = ConanFileReference(name, version, user, channel, revision, validate=validate)
  File "/Users/jgsogo/dev/conan/conan/conans/model/ref.py", line 172, in __new__
    obj._validate()
  File "/Users/jgsogo/dev/conan/conan/conans/model/ref.py", line 185, in _validate
    ConanName.validate_revision(self.revision)
  File "/Users/jgsogo/dev/conan/conan/conans/model/ref.py", line 147, in validate_revision
    "%s" % ConanName._max_chars)
conans.errors.InvalidNameException: The revision field, must contain only letters and numbers with a length between 1 and 51

Leaving it without the <package_id> part (liba/0.1#7086607aa6efbad8e2527748e3ee8237) means also unknown and it is parseable by the ConanFileReference.

@memsharded
Copy link
Member Author

I have done the changes, but actually, the output references are PackageReference not ConanFileReference. It is parseable by PackageReference. Actually it will fail if it has an empty ID

Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

🤦‍♂ Yes, PackageReference is able to parse them... and without it, it fails.

@memsharded memsharded merged commit 0f180b9 into conan-io:develop Jan 27, 2020
@memsharded memsharded deleted the feature/unknown_in_build_order branch January 30, 2020 09:03
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.

[bug] Wrong conan graph build-order in package_revision_mode
5 participants