-
Notifications
You must be signed in to change notification settings - Fork 82
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
Declare Runtime Dependencies #103
Comments
It potentially auto-detects whether openssl is available at build time. You may need a "crateOverrides" that adds openssl to the buildInputs. And /or add the corresponding feature if there is one. Usually, nix detects of there are references to build time dependencies in the output and adds them as runtime dependencies. https support seems to be the default :
|
I'm not quite sure how to do this (sorry if the question is stupid...) I added a
When only adding the dependency to When adding the dependency to
|
The error is probably further above, try This is not really the place for general nix advice. Maybe you can ask in IRC or user forums? If you find a solution, you might post back here or create a pull request for defaultCrateOverrides in nix pkgs |
Turns out the compile error wasn't a problem in But now that the crate builds using my overrides, I get the same runtime error as in the beginning... |
I haven't used
|
The error only occurs when a git clone or pull is performed. |
It still appears to work with my package:
|
That's strange. So it seems to be a problem with my store? I'm using Arch Linux and installed nix separately. Are you on NixOS? Earlier today you mentioned sandboxed builds. How can I configure a build to run sandboxed? |
Can you run a git checkout of bhipple/nixpkgs@cc03506, then For me the crate2nix version you have as a WIP does not work either. |
Your expression works fine. So it seems to be an issue with the expression generated by crate2nix? |
Thank you for all the analysis! I just glanced at it but I came by to say that I appreciate that, even though it might take a while until I catch up with it. |
BTW, buildRustPackage should be avoided because it does not work well with caching. It is a fixed output derivation that depends on the rust tool chain so even if the tool chain changes, nix will still think that it has the same hash and not rebuild it if it is in the cache. That creates super annoying extra work for nixpkgs maintainers such as https://gitlab.muc.ccc.de/txpower/nixpkgs/commit/062210bdff8cd2ea3508bc0d7f3341eee913a261 Obviously, that is not satisfying advice if the alternatives are not working for you. |
That's the reason why I wanted to use I'll use |
@vbrandl have you see (or were you involved in) nix-community/naersk#74 ? Also, nixpkgs has the great I'll try to get nix-community/naersk#74 in as quickly as possible. |
I haven't seen the PR but I saw the corresponding issue (nix-community/naersk#71).
Anyway my current setup does work just fine, I just want to give nix a try, so no hurries |
@vbrandl FYI nix-community/naersk#71 was closed. |
Yeah I followed the issue and PRs. I'm currently building my Docker image using naersk and will compare it to the image I got from building the Edit: |
BTW, I'd love musl support |
I have a project that depends on OpenSSL (indirectly through
git2
) (repo here). It builds fine but at runtime I get an error from libgit2 which indicates that indicates that OpenSSL is missing at runtime (libgit2/libgit2#4147 or ropensci/git2r#410).Is it possible to define nix packages that are required at runtime when running the binary? Or should this already happen and is a bug? I can try to create a smaller testcase to reproduce the issue.
Update:
Here is a minimal example to reproduce the issue: https://github.com/vbrandl/crate2nix-git2
Cargo.nix
was created using the current HEAD (a76b8d3)Compiling and running directly with
cargo run
works fine on my system.But building the nix package using
nix-build Cargo.nix --attr rootCrate.build
and running./result/bin/crate2nix-git2
gives me the following error:The text was updated successfully, but these errors were encountered: