Merge pull request #301336 from philiptaron/tree-sitter-webUI

tree-sitter: embed path to `emcc` so that `build --wasm` works
This commit is contained in:
Mario Rodas 2024-04-05 21:31:11 -05:00 committed by GitHub
commit 51b4ffe7f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -9,6 +9,7 @@
, Security
, callPackage
, linkFarm
, substitute
, CoreServices
, enableShared ? !stdenv.hostPlatform.isStatic
, enableStatic ? stdenv.hostPlatform.isStatic
@ -117,6 +118,13 @@ rustPlatform.buildRustPackage {
[ which ]
++ lib.optionals webUISupport [ emscripten ];
patches = lib.optionals webUISupport [
(substitute {
src = ./fix-paths.patch;
substitutions = [ "--subst-var-by" "emcc" "${emscripten}/bin/emcc" ];
})
];
postPatch = lib.optionalString (!webUISupport) ''
# remove web interface
sed -e '/pub mod playground/d' \

View File

@ -0,0 +1,13 @@
diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs
index 9c1d8dfc..a5cfc74c 100644
--- a/cli/loader/src/lib.rs
+++ b/cli/loader/src/lib.rs
@@ -747,7 +747,7 @@ impl Loader {
Podman,
}
- let emcc_name = if cfg!(windows) { "emcc.bat" } else { "emcc" };
+ let emcc_name = if cfg!(windows) { "emcc.bat" } else { "@emcc@" };
// Order of preference: emscripten > docker > podman > error
let source = if !force_docker && Command::new(emcc_name).output().is_ok() {