File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 66 # nativeBuildInputs
77 binaryen ,
88 lld ,
9+ llvmPackages ,
910 pkg-config ,
1011 protobuf ,
1112 rustfmt ,
3132 "map_view"
3233 ] ,
3334} :
34-
3535rustPlatform . buildRustPackage ( finalAttrs : {
3636 pname = "rerun" ;
3737 version = "0.24.0" ;
@@ -99,6 +99,24 @@ rustPlatform.buildRustPackage (finalAttrs: {
9999 nasm
100100 ] ;
101101
102+ # NOTE: Without setting these environment variables the web-viewer
103+ # preBuild step uses the nix wrapped CC which doesn't support
104+ # multiple targets including wasm32-unknown-unknown. These are taken
105+ # from the following issue discussion in the rust ring crate:
106+ # https://github.com/briansmith/ring/discussions/2581#discussioncomment-14096969
107+ env =
108+ let
109+ inherit ( llvmPackages ) clang-unwrapped ;
110+ major-version = builtins . head ( builtins . splitVersion clang-unwrapped . version ) ;
111+ # resource dir + builtins from the unwrapped clang
112+ resourceDir = "${ lib . getLib clang-unwrapped } /lib/clang/${ major-version } " ;
113+ includeDir = "${ lib . getLib llvmPackages . libclang } /lib/clang/${ major-version } /include" ;
114+ in
115+ {
116+ CC_wasm32_unknown_unknown = lib . getExe clang-unwrapped ;
117+ CFLAGS_wasm32_unknown_unknown = "-isystem ${ includeDir } -resource-dir ${ resourceDir } " ;
118+ } ;
119+
102120 buildInputs = [
103121 freetype
104122 glib
You can’t perform that action at this time.
0 commit comments