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

Expose conanfile.output to ConanFileInterface #13031

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Feb 2, 2023

Changelog: Omit
Docs: Omit

For conan-io/examples2#61, the copy method in tools.files expects a ConanFile as its first argument, but there's not much stopping us form also using a ConanFileInterface, so that for example copy can be called on files from self.depenencies. The only issue was a missing exposed property, so this adds that to the interface.

This might not be a good solution as it expands the public surface of this file, and there's a possible workaround in passing None as the argument which suppresses all output, so I'm happy to close if desired :)

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Hi @RubenRBS

The idea is that the output of the dependency shouldn't be used from the consumers (self.dependencies) side. All it does is to encapsulate the package prefix (like pkg/version: ) to the output, but this isn't what should be shown in output, but the one of the consumer side calling it. The intention of that prefix is that messages outputed from the recipe have that prefix, but messages from the consumers have the prefix of the consumer. In this case, the one doing the copy() is the one to be passed, not the dependency.

@AbrilRBS
Copy link
Member Author

AbrilRBS commented Feb 2, 2023

Oh, that's completely reasonable, thanks for your input, much appreciated :)

@AbrilRBS AbrilRBS closed this Feb 2, 2023
@AbrilRBS AbrilRBS deleted the rr/expose-output-conanfileinterface branch February 2, 2023 08:35
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.

2 participants