Commit Graph

13 Commits

Author SHA1 Message Date
Sam Clegg
819e95cd99 Cleanup emsdk_env scripts (#539)
Remove the optional argument to contruct_env.  It simple if we
always construct the env in the same place.  Avoid using temp files,
and avoid changing directory.
2020-07-06 16:34:02 -07:00
Sam Clegg
a8263f30af Allow EMCC_BASH to force bash during construct_env (#493)
This allows `emsdk_env.sh` to work under bash for windows even in the
absence of the `MSYSTEM` environment variable (which seems to be 
the setup on circle CI.
2020-05-07 08:31:02 -07:00
Thomas Lively
1ea9c326a3 Remove extraneous arguments to construct_env (#328)
The code for construct_env expects the output file to be at `argv[2]`,
but it is actually invoked in emsdk_env.{sh,fish} with $@ there
instead. Usually this is not a problem because the emdsk_env.{sh,fish}
is `sourced` directly from the user's shell and $@ is empty, but this
can break in scripted environments.

The $@ was added two years ago in 3b6c6b86 for no discernible reason,
but it was entirely ignored in the code until last month when #307
added a meaningful argument to construct_env but incorrectly kept the
$@.
2019-08-27 09:42:36 -07:00
Zoltan Varga
e2110d8816 Avoid file creation/deletion races in emsdk_env.sh by using a temporary file(#307)
Fixes https://github.com/emscripten-core/emscripten/issues/9090.
2019-07-26 16:50:10 -07:00
Jacob Greenfield
590e7bb23d Fix path quoting bug introduced in #220 (#227)
It seems that some variables were mistakenly left unquoted, leading to paths containing spaces being treated incorrectly.

For example, the directory `/home/person/foo bar/test/` would cause `CURDIR=$(pwd)` to be expanded to `CURDIR=/home/person/foo bar/test/`. This means that the shell would attempt to run the command `bar/test/` with the environment variable `CURDIR` set to `/home/person/foo`. This is due to [word splitting](https://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html). (TL;DR the result of shell expansions should probably be quoted 99% of the time)
2019-03-06 08:35:35 -08:00
Nic Hartley
a77638d5c1 Remove bashism in favor of portable alternative (#220) 2019-02-21 17:02:22 +02:00
Jukka Jylänki
3b6c6b8652 Make emsdk work on Windows with MSYS shell and native Windows Python 2.7 2017-08-15 20:23:36 +03:00
Fumiya Chiba
3bf41eba42 Use $0 to get execution path
$_ is "The last argument of the previous command." (cf. man zshparam) on
zsh, so SRC will be "]".
2015-04-15 20:48:20 +09:00
Jukka Jylänki
4f52f0e181 Add a comment to emsdk_env.sh to remind that it's supposed to be sourced. 2014-12-30 18:55:49 +02:00
Aidan Hobson Sayers
2fc268b364 Improve cross-shell compatibility 2014-11-18 00:42:02 +00:00
Aidan Hobson Sayers
90da8d5dc3 $_ seems to be unreliable if used as first command of shell 2014-11-15 21:08:18 +00:00
Warren Seine
1b51a1e617 Allow running emsdk_env.sh from another directory.
Move into the emsdk directory before running ./emsdk. Make it possible to add `test -x $EMSCRIPTEN/emsdk_env.sh && source $EMSCRIPTEN/emsdk_env.sh` to my shell initialization script.
2014-09-02 12:01:35 +02:00
Jukka Jylänki
34d478034f Migrate OSX shell activation to work the same way as on Windows: source ./emsdk_env.sh instead of emsdk_add_path. 2014-07-03 18:50:00 +03:00