File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 60
60
cargoBuildFlags = [ "-p" "rustc_codegen_spirv" "--features=use-installed-tools" "--no-default-features" ] ;
61
61
doCheck = false ;
62
62
} ) ;
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" ''
67
64
#!${ pkgs . lib . getExe pkgs . bash }
68
65
69
66
filtered_args=()
74
71
esac
75
72
done
76
73
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[@]}" }
81
75
'' ;
76
+ rustGpuPathOverride = "${ rustGpuCargo } /bin:${ rustGPUToolchainPkg } /bin:${ pkgs . spirv-tools } /bin" ;
82
77
83
78
libcef = pkgs . libcef . overrideAttrs ( finalAttrs : previousAttrs : {
84
79
version = "139.0.17" ;
137
132
138
133
# Linker
139
134
pkgs . mold
140
-
141
- execWithRustGPUEnvironment
142
135
] ;
143
136
# Development tools that don't need to be in LD_LIBRARY_PATH
144
137
devTools = with pkgs ; [
150
143
gnuplot
151
144
samply
152
145
cargo-flamegraph
146
+
147
+ # Useful for rust-gpu debugging
148
+ pkgs . spirv-tools
153
149
] ;
154
150
in
155
151
{
161
157
CEF_PATH = libcefPath ;
162
158
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" ;
163
159
160
+ RUST_GPU_PATH_OVERRIDE = rustGpuPathOverride ;
161
+ RUSTC_CODEGEN_SPIRV_PATH = "${ rustc_codegen_spirv } /lib/librustc_codegen_spirv.so" ;
162
+
164
163
shellHook = ''
165
164
alias cargo='mold --run cargo'
166
165
'' ;
You can’t perform that action at this time.
0 commit comments