-
Notifications
You must be signed in to change notification settings - Fork 1k
[question] Editable packages: Custom cpp_info properties with path #18340
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
Comments
Hi @aagor Thanks for your question. The "properties" of
Those are composed, the idea is that they define different and not overlapping things, they shouldn't really overwrite, so precedence shouldn't matter much. They do almost the same, it is a minor semantic difference:
Mostly historical reasons, and introduction as |
Hi @memsharded,
No, but I need an absolute path (as otherwise the paths would be relative to the consumer paths, which obviously doesn't work) and getting that without # Does not work as it's relative to build_folder.
self.cpp.build.set_property("proto_dir", os.path.join("path", "to", "subdir_in_build_folder"))
# Does not work as it's relative to the base folder.
self.cpp.build.set_property("proto_dir", os.path.join(self.folders.build, "path", "to", "subdir_in_build_folder"))
# Works, but is there a better solution?
self.cpp.build.set_property("proto_dir", os.path.normpath(os.path.join(self.recipe_folder, self.folders.root or ".", self.folders.build, "path", "to", "subdir_in_build_folder"))) The last one works, but feels a little clunky. For the default information like |
Quick question: Have you tried propagating the information via a
Because the paths are made absolute for the consumers Note, not necessary for the value to be a dict, it can be a string, directly, that is just from a test to show path confs can be complex python objects |
No, I haven't tried that. But thanks for the hint. Maybe that becomes useful in the future. I think, for now, I will go with the third option from above. If you are interested in feedback, I think it could be useful to have a self.cpp.build.set_property_path("proto_dir", os.path.join("path", "to", "subdir_in_build_folder")) This would allow similar logic like for the builtins ( Thanks for your help! |
The thing is that this seems a bit contrary to the
It is true that I lack details about:
What is the |
What is your question?
Hi,
inside a package, I need a custom property that contains a path, which is needed by consumers of the package.
This is easy for the cache workflow:
However this is difficult to get right, when the package is in editable mode.
The local path is different and is contained inside the build folder.
I guess
self.cpp.build.set_property
insidelayout()
is supposed to be used for that, but that's difficult as I can't accessself.build_folder
there.Setting it inside
package_info()
does also not work, as I can't accessself.build_folder
there, too.self.cpp.source
andself.cpp.build
when it comes to properties? Which one has more precedence?layout()
, whereas it is insidepackage_info()
for cache packages? This leads to similar logic at two different places.Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: