-
Notifications
You must be signed in to change notification settings - Fork 330
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
NIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}
is not set when setting languages.c.enable = true
#258
Comments
Where is this used exactly?
|
The last time I played with the clang wrapper, it was required. But not sure, maybe that changed |
It's set by the cc wrapper to prevent including flags twice in forked processes. |
However with the introduction of nakedshell for devenv is pretty much broken as it was in devshell before, because there are no setup hooks that will setup NIX_LDFLAGS or NIX_CFLAGS_COMPILE in the first place correctly. |
This is fair criticism, but it ties IMO too much of the expected behaviour of devenv to the nix-shell one. We have two main options here:
|
For context I described some strategies how C/C++ could be integrated, if you prefer to not use hooks: numtide/devshell#104 and here numtide/devshell#103 For my part I cannot use devenv at the moment because the experimental nix fork used in devenv is breaking and it does not work with ~/.config/nixpkgs/config.nix being a symlink. |
How does it break? |
@domenkozar opened #260 |
Hey, sorry for potentially adding noise to the discussion, but I am unsure what I should take away from the thread. If I get the point of @Mic92 correctly:
@thenonameguy disagrees but I have trouble wrapping my head around the answer (especially because I am a C/C++ gcc/clang noob). According to the first part:
I can see how it is desirable to build the software as a nix build expression, but what if I am developing, for example, a rust package that relies on
I guess this is the part I am trying to wrap my head around as I have trouble finding any resources where to start. Concrete exampleThe following is potentially outside of the scope of the current issue, but I wanted to provide a real, reproducible example for better context. I would like to work on a rust package that includes georust/gdal which provides bindings for gdal. GDAL is known for not being easy to compile.
I know that it relies on
but when I try to compile it with
which suggests that the libraries from I hope this wasn't too confusing and all over the place... Here is the environment if it helps: https://github.com/kai-tub/devenv-proj |
You might be able to link libraries and header files using the current devenv implementation but than the linker won't add libraries to the RPATH of a binary because devenv does not bring any support for that for the reasons mentioned above. In the current state you are better off not using devenv for these types of projects and use |
Can you test #745 |
Describe the bug
NIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}
should be set to1
so the gcc/clang wrapper picked upNIX_CLFAGS_COMPILE
/NIX_LDFLAGS
. Without this, I noticed that the wrapper does not accept libraries provided in those environment paths.To Reproduce
Version
devenv: 0.5
The text was updated successfully, but these errors were encountered: