| ... | @@ -1323,24 +1323,11 @@ fn runCommand( | ... | @@ -1323,24 +1323,11 @@ fn runCommand( |
| 1323 | }, | 1323 | }, |
| 1324 | .wasmtime => |bin_name| { | 1324 | .wasmtime => |bin_name| { |
| 1325 | if (b.enable_wasmtime) { | 1325 | if (b.enable_wasmtime) { |
| 1326 | // https://github.com/bytecodealliance/wasmtime/issues/7384 | | |
| 1327 | // | | |
| 1328 | // In Wasmtime versions prior to 14, options passed after the module name | | |
| 1329 | // could be interpreted by Wasmtime if it recognized them. As with many CLI | | |
| 1330 | // tools, the `--` token is used to stop that behavior and indicate that the | | |
| 1331 | // remaining arguments are for the WASM program being executed. Historically, | | |
| 1332 | // we passed `--` after the module name here. | | |
| 1333 | // | | |
| 1334 | // After version 14, the `--` can no longer be passed after the module name, | | |
| 1335 | // but is also not necessary as Wasmtime will no longer try to interpret | | |
| 1336 | // options after the module name. So, we could just simply omit `--` for | | |
| 1337 | // newer Wasmtime versions. But to maintain compatibility for older versions | | |
| 1338 | // that still try to interpret options after the module name, we have moved | | |
| 1339 | // the `--` before the module name. This appears to work for both old and | | |
| 1340 | // new Wasmtime versions. | | |
| 1341 | try interp_argv.append(bin_name); | 1326 | try interp_argv.append(bin_name); |
| 1342 | try interp_argv.append("--dir=."); | 1327 | try interp_argv.append("--dir=."); |
| 1343 | try interp_argv.append("--"); | 1328 | // Wasmtime doeesn't inherit environment variables from the parent process |
| | 1329 | // by default. '-S inherit-env' was added in Wasmtime version 20. |
| | 1330 | try interp_argv.append("-Sinherit-env"); |
| 1344 | try interp_argv.append(argv[0]); | 1331 | try interp_argv.append(argv[0]); |
| 1345 | try interp_argv.appendSlice(argv[1..]); | 1332 | try interp_argv.appendSlice(argv[1..]); |
| 1346 | } else { | 1333 | } else { |