$CARGO_MANIFEST_DIR "leakage" (used at runtime) due to target-specs vendoring.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
I cant keep rust-gpu updated for my projects since this commit
Example & Steps To Reproduce
I have made a minimal example to demonstrate
nix run github:abel465/rust-gpu-nixos-example/b117267d254310df77e69debde9e510ed193ff56
The shader builds just fine for the above command. it uses this version of rust-gpu
> nix run github:abel465/rust-gpu-nixos-example/6c9e2ca63da09ab1d119a06a596cd41f84255876
cargo:rerun-if-env-changed=RUSTGPU_CODEGEN_ARGS
cargo:rerun-if-env-changed=RUSTGPU_RUSTFLAGS
error: target path "/build/cargo-vendor-dir/spirv-builder-0.9.0/target-specs/spirv-unknown-vulkan1.1.json" is not a valid file
Caused by:
No such file or directory (os error 2)
thread 'main' panicked at runner/src/main.rs:17:42:
called `Result::unwrap()` on an `Err` value: BuildFailed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The above command is the same except it uses the next commit of rust-gpu which seems to hard code CARGO_MANIFEST_DIR into the binary. This is problematic because the build environment is no longer available during runtime with nix
System Info
- Rust: 1.78.0-nightly (3b1717c05 2024-03-10)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the behavior introduced in commit 775b5d5 with the working version 40456ae, focusing on runner/src/main.rs and the target-specs path shown in the reproduction. Run the two nix commands from the issue; done means the vendored shader builds without relying on the unavailable build-environment path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100