-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use correct attribute type instead of package_type #17943
base: develop2
Are you sure you want to change the base?
Use correct attribute type instead of package_type #17943
Conversation
Hi @NokiDev Thanks for your contribution. Lets start with the test that reproduces the issue first, as I have commented in #17942 (comment) |
fef0648
to
7777a0e
Compare
7460a4b
to
0a1c1ea
Compare
@@ -81,13 +81,16 @@ def _requires(self, info, components): | |||
assert required_pkg == required_comp | |||
comp = None | |||
default_target = f"{dep.ref.name}::{dep.ref.name}" # replace_requires | |||
link = pkg_type is not PackageType.SHARED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the test that I added, this movement is not necessary.
If this is necessary for a different use case, it would be great to have yet another test that covers this scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right this is triggered by another use case, see new test added. That triggers the first condition dep_comp == None, and then crash when evaluating the link.
For that case evaluating the link only on the package_type seems the simpler way to fix this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now with the test and the explanation is more clear, many thanks!
I have just fixed an indent error in the test, and CI is running.
Changelog: (Bugfix): _Component() has no package_type property #17942