-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[pkgconf] pkgconf/1.7.4: Binary does not work in shared build #7540
Comments
Most, if not all, recipes are designed to run inside a conan run environment. conan install pkgconf/1.7.4@ -o pkgconf:shared=True -g virtualrunenvironment
source activate_run.sh
# do your thing
source deactivate_run.sh I guess adding a rpaths to the pkgconf executalbe would be possible. |
@madebr That makes sense. So considering that in #7539 the consumer of pkgconf is not able to run pkgconf (I am assuming for the same reason of not being in run environment), is this a bug in this recipe or the other one? pkgconf should be able to be consumed with shared option in an intermediate recipe correct? |
The problem is that conan does not run its build helpers in a run environment. It's possible to fix this by surrounding with a I think conan should add a option to the meson = Meson(self, run_environment=True) which should get passed down to every The only problem is that these build helpers will soon get deprecated. |
@madebr I am wondering. If a package is a build_requirement, shouldn't its run_evironment be added to the build environment of the consumer? Sure normally the bin directory should only be added to the path at runtime. But if something is a build_requirement then chances are that the binary would be needed at build time for the consumer. For running tests I agree we need to run them in the run environment. But it seems wrong to me that we enforce run environment when we only need the build requirements to be in the run environment (and not for example the bin directory of a regular requires). Hypothetically say we have |
To be honest, I'm not a frequent user of virtualenv/virtualbuildenv/virtualrunenv generators. I just know that when using Let's ask @uilianries / @jgsogo in what way/how we should support shared build requirements. |
Anyway, as a consumer I always force static in all build requirements and strongy discourage a brutal
|
@SpaceIm I agree that is better practice. But I would say that should be documented if it is a limitation. And then the shared option should probably be deleted when a recipe is used as a build requirement. If not then I argue that it should work. |
There is no such feature in conan api.
Any recipe with build requirements which have shared options (even transitively) should wrap build and package commands with |
@SpaceIm Wouldn't that add every PATH to build environment, even those from regular requires? Isn't that unwanted? (see #7540 (comment)) |
Hi! This is not an easy topic. Standalone executionFor sure, when we want to run an executable that is linked dynamically to other libraries, we need to add those other libraries to some path so the system is able to find them, this is why running these executables will require to activate some virtual environment (or use rpaths, which is not possible when we are redistributing already built binaries). As suggested above, the general rule is:
Running these commands all the required shared libraries will be found and it should work in Windows and Linux for any scenario (even if Using as build-requiresWhen it comes to a Now I'll have a look at the concrete |
On my side (Macos), the
Maybe I'm missing something from your logs. Am I reproducing your scenario? If it was about the |
@jgsogo The issue started with #7539 when I tried to build glib as shared with a single profile, and now I am trying to determine where lies the issue?
|
I would suggest always try with two-profiles first and then with one profile. Two-profiles will be the default (and only way) for Conan v2. Using single profile will be deprecated in the future and we cannot make any change to current behavior in Conan v1 because it might break other consumers (even if it looks like a bug, we cannot add/remove any environment variable). |
@jgsogo So to confirm we don't want to change the behavior of single profile and we don't want to add run environment to build step because that would add all requirement paths to build environment (and not just build requirements). i.e. we don't want to add lines like:
in |
Changing how the single profile works can be breaking, so it is very unlikely that any modification can be done there. About adding a In this thread, we can talk about existing behavior and recipes, in order to improve them if needed. TBH, I still don't know what is the issue here and what fails on your side. |
this will be fixed by #10494 (by default, it packages only the executable, which statically links to the library) |
When building
pkgconf
with-o *:shared=True
I end up with apkgconf
binary that when run gives the following error:This seems to be causing #7539.
Package and Environment Details (include every applicable attribute)
output.log
meson-log.txt
The text was updated successfully, but these errors were encountered: