-
Notifications
You must be signed in to change notification settings - Fork 988
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
[bug] self.package_folder is None in package_info() if layout() is used #12310
Comments
Hi @elqueffo I have been checking, but it seems there might be something else in your recipe affecting. This is what I tried to reproduce:
So if you could please provide a fully reproducible example, that would help. Thanks! |
Hey @memsharded Here is a full conanfile:
I run these commands:
the output i get is as follows:
If i remove |
Sorry, I accidentally closed the issue instead of commenting on it. Re-opening. The missing detail was the |
Some deprecation warnings:
|
I have been able to reproduce. |
There are numerous recipes using package_folder on conan-center and elsewhere, and it is the recommended/documented way to set path: https://docs.conan.io/en/latest/reference/conanfile/methods.html#env-info I would therefor expect this to work also for editable pacakges in some way, with a "portable" way to set env vars based on the package location that works in both cases. |
I have also encountered this issue when using editable packages and the The workaround I've found is to call |
Many recipes in ConanCenter haven't been migrated to the new tools, and in any case it is ok if they are not prepared to work in
That is the thing, it is not that we don't want to define the
It makes sense to extend or provide some new mechanism that allows to transmit this information in a way that works in both cases, and this is the reason I was asking for further feedback about the real use cases (the case presented above for adding the "bin" folder to the PATH is already managed automatically), because that would allow to define the solutions better. The solution proposed by @santhonisz with |
I see, thanks for the explanation. In this case this was in fact an open source dependency that i wanted to add a layout to for iterating faster. I wasn't able to without breaking a number of other things along the way, this being one of them. For this specific recipe, i would have expected the bin path to point at the build output folder. In addition this usecase: |
It is. The So the question is: what needs to define a folder inside the |
Hi @elqueffo Any feedback regarding the last questions? PR #12318 is scheduled to close this ticket, as not a bug, but expected behavior, package_folder will be |
Hello again @memsharded , I am not sure i follow how i would achieve this still: Inside I understand some generators already handle setting PATH, but what about other custom variables like this? |
This is what I am trying to understand: what is "BOB" and what is "ALICE"? It would be good to learn about the real use cases, so we consider alternative ways to model this. Certainly |
Re-opening after #12318 was merged and closed it, and assigning for discusion to next 1.55:
|
Let's say i am packaging some library or tool that expects a specific environment variable to be set to point to a config file, that resides inside the package folder. having access through cpp_info wouldn't help here i think?` Let's say |
Where does it reside when the package is in editable mode, in the source&build tree? It is a generated file, or is it part of the source? |
In any case, I am starting to understand the use case, and this seems not a bug, but a request for a new feature that helps managing some use cases, but this feature might need some thinking about the right model, and how to represent the different situations between the editable layout (source & build trees) vs the package layout (only package tree) |
In this case it would be in the source tree, however it would probably be useful to also support the case where it is part of the build output. |
Ok, so this is the requirement:
We certainly need to think about this, doesn't seem an easy feature, as it requires some similar generalization and management like the one happening for |
For our particular use case, this is this current issue that is affecting us. At present we can't use packages in editable mode if they use the |
Another example is if I need to hack on QT (eg bugfixes, new features, etc), QT has this QT_PLUGIN_PATH which is key to executing QT programs. I have no idea where those files might exist in the build folder - they are possibly scattered across the build, and only collected up during packaging. I would expect to have to do a kind of loop when editing QT sources:
This is the loop I used to run prior to my entry into conan... something like
Where make-install would deploy to build_somelibrary/install The make-install step is handy because you may not want to replace the deployed libraries/headers after every make (ie work in progress, build not complete, only half of the libraries recompiled in build folder). Maybe you can ask the consumer programs to link to the dlls and headers wherever they are in the build folder, |
But @paulharris this is the key:
If you already need to run an extra |
Good point, I guess I can't say for certain without trying the feature in its full v2 glory, \So for my example, how would the consumer be able to find the QT_PLUGINS_PATH and its generated dlls, when the package is in editable mode? ie without the packaging step? |
Hi all, The minor issues like MSBuildDeps failing have been solved in #12529 The main remaining issue is a very complex one, which is the definition of env-vars, we have created a explicit ticket for it: #12499. We can follow that one, and I will close this one (as the title is a bit misleading, The bad news is that at the moment solving #12499 is not obvious, and it seems pretty challenging. That means that in the general case, it is not possible to put such packages in The workaround would be avoiding the editable for this case: as the Closing this, please follow #12499 (likely to be addressed later in 2.X). Many thanks! |
Seem, seems to have been fixed by #12598 - awesome! |
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
Create a conan file like so:
Set package in editable mode
install with CMakeDeps and CmakeToolchain generator:
conan install package/0.1@blah/blah -g CMakeDeps -g CMakeToolchain
Logs (Executed commands with output) (Include/Attach if Applicable)
The text was updated successfully, but these errors were encountered: