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

Use artifact name when copying a binary or a library in the dist task #29

Merged
merged 4 commits into from
May 18, 2023

Conversation

ntrinquier
Copy link
Contributor

No description provided.

@@ -73,12 +73,7 @@ def execute(self) -> None:
output_file.parent.mkdir(parents=True, exist_ok=True)
with wopen_archive(output_file, archive_type) as archive:
for resource in self.resources.get():
if resource.options.arcname is not None:
arcname = resource.options.arcname
elif isinstance(resource, BinaryArtifact):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is where the bug was: at this point, resource may no longer be a BinaryArtifact, it is necessarily a ConfiguredResource (as the type of the property attests), which has no overlap with BinaryArtifact

Nicolas Vizzari-Trinquier added 3 commits May 18, 2023 08:46
task_options = dependencies_map[next(iter(dependencies_set.partitions()[task]))]
options = IndividualDistOptions(**vars(task_options))

if options.arcname is None and isinstance(resource, (BinaryArtifact, LibraryArtifact)):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the solution is to move the logic where we construct the ConfiguredResources, to set the arcname in the options there

note that LibraryArtifacts now also get their arcname changed, which is hopefully not controversial

@ntrinquier ntrinquier merged commit 7f72e11 into develop May 18, 2023
8 checks passed
@ntrinquier ntrinquier deleted the nvt/fix-dist branch May 18, 2023 11:39
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.

None yet

1 participant