File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 cargoBuildFlags = [ "-p" "rustc_codegen_spirv" "--features=use-installed-tools" "--no-default-features" ] ;
6161 doCheck = false ;
6262 } ) ;
63-
64- # Wrapper script for running rust commands with the rust toolchain used by rust-gpu.
65- # For example `rust-gpu cargo --version` or `rust-gpu rustc --version`.
66- execWithRustGPUEnvironment = pkgs . writeShellScriptBin "rust-gpu" ''
63+ rustGpuCargo = pkgs . writeShellScriptBin "cargo" ''
6764 #!${ pkgs . lib . getExe pkgs . bash }
6865
6966 filtered_args=()
7471 esac
7572 done
7673
77- export PATH="${ pkgs . lib . makeBinPath [ rustGPUToolchainPkg pkgs . spirv-tools ] } :$PATH"
78- export RUSTC_CODEGEN_SPIRV_PATH="${ rustc_codegen_spirv } /lib/librustc_codegen_spirv.so"
79-
80- exec ${ "\ ${filtered_args[@]}" }
74+ exec ${ rustGPUToolchainPkg } /bin/cargo ${ "\ ${filtered_args[@]}" }
8175 '' ;
76+ rustGpuPathOverride = "${ rustGpuCargo } /bin:${ rustGPUToolchainPkg } /bin:${ pkgs . spirv-tools } /bin" ;
8277
8378 libcef = pkgs . libcef . overrideAttrs ( finalAttrs : previousAttrs : {
8479 version = "139.0.17" ;
137132
138133 # Linker
139134 pkgs . mold
140-
141- execWithRustGPUEnvironment
142135 ] ;
143136 # Development tools that don't need to be in LD_LIBRARY_PATH
144137 devTools = with pkgs ; [
150143 gnuplot
151144 samply
152145 cargo-flamegraph
146+
147+ # Useful for rust-gpu debugging
148+ pkgs . spirv-tools
153149 ] ;
154150 in
155151 {
161157 CEF_PATH = libcefPath ;
162158 XDG_DATA_DIRS = "${ pkgs . gsettings-desktop-schemas } /share/gsettings-schemas/${ pkgs . gsettings-desktop-schemas . name } :${ pkgs . gtk3 } /share/gsettings-schemas/${ pkgs . gtk3 . name } :$XDG_DATA_DIRS" ;
163159
160+ RUST_GPU_PATH_OVERRIDE = rustGpuPathOverride ;
161+ RUSTC_CODEGEN_SPIRV_PATH = "${ rustc_codegen_spirv } /lib/librustc_codegen_spirv.so" ;
162+
164163 shellHook = ''
165164 alias cargo='mold --run cargo'
166165 '' ;
You can’t perform that action at this time.
0 commit comments