-
Notifications
You must be signed in to change notification settings - Fork 931
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
candle-kernels fails to build in Nix due to read-only sources #2453
Comments
Can you share your (crane) nix expression? |
This isn't necessarily the smallest possible reproducer, but it's a reasonably small diff of non-generated files from the Crane quick-start-simple template: https://github.com/gmacon/candle-build-failure-reproducer. To reproduce: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Nix, builds are isolated and have limited network access. The built artifacts are written into a read-only location known as the "store". It's common to build Rust applications using Crane which invokes
cargo build
with a cargo cache directory filled with symlinks into the store. This means that when the build script is run, the sources are read-only. The currentbuild.rs
in candle-kernels specifies thatsrc/lib.rs
, which is read-only in my application, be overwritten by bindgen_cuda. This behavior is discouraged by the Cargo book. They instead recommend a pattern where the generated code is written to the build script output directory ($OUT_DIR
) and theninclude!
d into the library. I think you should implement this pattern.I also opened Narsil/bindgen_cuda#10 requesting that bindgen_cuda change their documentation to avoid having future consumers fall into this same anti-pattern.
The text was updated successfully, but these errors were encountered: