You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 current build.rs in candle-kernels specifies that src/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 then include!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:
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: