Commit Graph

153 Commits

Author SHA1 Message Date
juj
16ee884464 Fix issues with npm install of google-closure-compiler installing all dev packages as well. (#793) 2021-04-26 14:38:00 -07:00
Sam Clegg
4282d5d44b Avoid setting EM_CACHE unless we really need to (#797)
This avoid polluting the global environment which makes
side-by-side installational of different emscripten version
harder.

See https://github.com/emscripten-core/emscripten/pull/13954
2021-04-26 06:29:01 -07:00
juj
bda6a0c5a5 Remove the use of a custom temp directory. That is a bad practice, we should reuse system temp directory instead, that is what it is there for. (#791) 2021-04-23 10:53:02 +03:00
Alon Zakai
fdda8524ce Simplify the notation for installing by hash to just emsdk install HASH (#767)
Previously this had to be

emsdk install sdk-releases-upstream-HASH

The only thing preventing using just the hash was that there was no
default for the backend, so defaulting to upstream fixes this. And then
we can do

emsdk install HASH
2021-03-22 14:07:34 -07:00
Jia Yuan Lo
b85548d0dd List "Release" as the default build option (#770)
This was set back in commit cea44f475a

Fixes #760
2021-03-22 11:36:54 -07:00
juj
9c65611d96 Ccache (#711)
* Add support for ccache.

* Simplify ccache activation.

* Fix macOS ccache build

* Make ccache executable

* Add Ninja build support. Change ccache name to git.

* Fix merge conflict
2021-03-15 09:15:26 +02:00
juj
772d397a55 Fix search of VCTargetsPath for VS2019 build. (#698) 2021-03-11 14:09:48 +02:00
Sam Clegg
9a70fe3688 Rename sdk-upstream-master SDK to sdk-upstream-main (#754)
Now that all the components (binaryen, emscripten and llvm) use `main`
as the branch name is makes sense to give the SDK this name.

Keep backwards compat with the old name but issue a warning when its
used.
2021-03-10 21:54:29 -08:00
Sam Clegg
d342821195 Skip npm step if node_modules already exists (#640)
See https://github.com/WebAssembly/waterfall/pull/670
2021-03-09 16:56:27 -08:00
Sam Clegg
73183b5c30 Fix race between install tot and active tot (#749)
Since #732 we lookup tot release dynamically, but we don't
necessarily want to do this for the `activate` command otherwise
`install` followed by `activate` a can fail if a new build was
produced inbetween.
2021-03-08 14:26:03 -08:00
Sam Clegg
f0ee795014 Remove special version check for vs-tool. NFC. (#740)
As of #505 all tools write a check a version file so we don't need to
special case vs-tool anymore.
2021-03-08 08:02:38 -08:00
Sam Clegg
6e2873c834 Feedback from #741. NFC. (#742) 2021-03-05 13:32:33 -08:00
Sam Clegg
9d639b383a Fix for construct_env and list with tot build installed (#741) 2021-03-05 12:51:04 -08:00
Sam Clegg
8915c20b06 Always print debug info to stderr (#739) 2021-03-05 09:44:19 -08:00
Sam Clegg
9d00a82b6a Remove update-tags phase (#738)
Its not really very useful to cache the tot release in a local text
file.  Instead just fetch the revsion each time `install tot` is run.

This avoids folks accidentally installing "old" tot releases.

Also, make the output a little less chatty when looking up tot version.
2021-03-05 09:19:42 -08:00
Sam Clegg
53eacf405d Allow the install of any emscripten-releases build (#732)
This is done by detecting the 40 character git sha in the SDK version
and creating a new set of tools based on this SHA.  This works for any
command that uses expand_sdk_name (i.e. install activate and update) but
it wont show up in the output of `list`.

For example:

./emsdk install sdk-releases-upstream-b0cfdb236483b6828ee2e3f263fd94f011ed1863-64bit

Or just:

./emsdk install releases-upstream-b0cfdb236483b6828ee2e3f263fd94f011ed1863
2021-03-01 17:32:03 -08:00
Sam Clegg
0a841562df Avoid post-install when nothing is installed (#736)
This avoids re-running the post-install scripts when commands such as
`./emsdk install latest` a re-run.  This re-running of npm ci can be
significant slowdown especially during testing and developerment.

Becuase of the refactoring this change change also means we exit ealier
when a given tool fails to install.  In general we want to error out as
early as possible on the first failure so as not to bury it.
2021-03-01 09:32:07 -08:00
Sam Clegg
f788ca9208 Remove unneeded try/catch (#733) 2021-02-26 11:12:04 -08:00
Sam Clegg
c1883c7407 Cleanup sys.argv handling. NFC. (#734) 2021-02-26 08:52:07 -08:00
Sam Clegg
fcf1bbe974 Limit expansion of %releases-tag% for fastcomp (#731)
Without this, all releases are made available as fastcomp
versions.

Also, sort the releases to that the most recent come last.
This fixes the `emsdk list` display which only displays
the two most recent versions.
2021-02-26 08:49:08 -08:00
Sam Clegg
a79eadf893 Fix crash attempting to install fastcmp SDK by hash (#730)
Using the full SDK name was causing a crash here because the
version is not of the form 1.2.3.  e.g:

sdk-releases-upstream-3b8cff670e9233a6623563add831647e8689a86b-64bit
2021-02-26 08:48:00 -08:00
Sam Clegg
f9af08a28f Remove unused run_emcc function. NFC. (#713)
Also, make handling of activated_path consistent.  We don't support
multiple activated paths so we can simplify the handling in some
places.
2021-02-25 16:35:38 -08:00
Sam Clegg
102e02252b Move error reporting when git is not found during update-tags (#728)
update-tags is called from two places `update-tags` itself and also
as as part of `update`.   Silently ignoring the absence of git should
only happen in the later case.   If the user explicitly ask for
update-tags we should hard fail as normal.
2021-02-25 16:34:56 -08:00
Jia Yuan Lo
63b6cd2a4e Allow system npm in "emsdk install emscripten" (#723)
"emsdk install emscripten-master-64bit" is currently dependent on
whether emscripten node is installed or not.

This change allow using system-provided node / npm command to proceed
the installation. Also clarify the error message.
2021-02-23 11:18:28 -08:00
Sam Clegg
8b32b7def8 Cleanup handling of old prebuild SDK tags (#697)
- Remove empty llvm-tags-32bit.txt
- Remove code that executes if llvm-tags-64bit.txt is missing (it
  can't be since its checked in these days).
- Cleanup load_file_index_list

I verfied manually that llvm_precompiled_tags* list are identical
before and after this change.
2021-02-08 15:01:14 -08:00
Zhang Fan
4def4da4d4 fix sln parsing form vs2019 (#679) 2021-01-05 04:27:16 -08:00
Sam Clegg
aa5fedfe29 Increate download chunk size of 256k (#657)
With 8k the download status if updated way faster than is
necessary.
2020-11-25 13:41:59 -08:00
juj
8f2f5e3435 Fix regression where reinstalling tools from git sources would not git pull and rebuild them. (#647) 2020-11-08 14:52:43 +02:00
Amin Yahyaabadi
40780130aa fix: emsdk swallows/overwrites parts of PATH (#642)
This PR has three changes: 

1) Fixing --permanent flag:
The previous algorithm looped over the values of PATH 4 times to check conditions while these conditions are the opposite of each other. Also, the result did not include all the parts in the whole_path. 

	I have combined these loops and fixed the algorithm, so no path is lost. Now using --permanent the PATH and Env variables are correctly updated.

2) Fixing --system flag:
Now, the system flag does not cause the PATH values to be overwritten/clobbered. The PATH/Env variables are correctly updated.

3) Fixing flagless flag:
When no flag is provided the value of process/shell is correctly updated and preserved.

This adds the tests for all the situations.

Fixes #634
Fixes #645
2020-10-30 20:57:15 -07:00
Chris Savoie
4fe6e492c0 Fix environment variables to be consistently set when using --system or --permanent (#515)
Also switch PostMessage to SendMessageWithTimeout and only send one if
environment variables actually changed.

Also, enable and fix --permanent unit tests.
2020-10-09 12:58:59 -07:00
Dannii Willis
107dc62dd7 Skip installing optional npm deps, but manually install Closure Compiler native package (#636)
Follow on to #625, #630, #632, #633
Fixes emscripten-core/emscripten#12406
2020-10-08 18:28:43 -07:00
Amin Yahyaabadi
53c184e8d3 Avoid pywin32 dependency on Windows (#635)
Instead use winreg/_winreg for the registry and ctypes for the
SendMessage call
2020-10-07 08:01:03 -07:00
Alon Zakai
31f5f842ff Revert "Skip installing optional npm deps, but manually install Closure Compiler native package (#630)" (#633)
This reverts commit 47b7f850f2.

Fixes #632
2020-10-06 07:42:46 -07:00
Dannii Willis
47b7f850f2 Skip installing optional npm deps, but manually install Closure Compiler native package (#630)
Follow on to https://github.com/emscripten-core/emsdk/pull/625
Fixes https://github.com/emscripten-core/emscripten/issues/12406
2020-10-05 18:12:56 -07:00
M.T. McParlane
e899a6fd5a Fix issue where MSYS2 and MinGW mistaken for Linux (#628)
When running `emsdk.py` with python provided by MSYS2/MinGW the environment gets falsely identified as Linux.

See discussion for details:
https://github.com/emscripten-core/emscripten/issues/12376#issuecomment-702245993

Fixes #385
2020-10-01 12:32:16 -07:00
Amin Yahyaabadi
807e55cbec Set user environment variables permanently by using --permanent + deprecate --global (#621) 2020-09-29 22:15:22 -07:00
Sam Clegg
f8e0b49c24 Clear PYTHONHOME when using bundled python (#600)
Fixes: #598
2020-09-17 15:38:54 -07:00
Sam Clegg
e08b17c8bf Remove copy_pregenerated_cache (#609)
Newer SDKs don't require this and removing it doesn't break
any older SDKs (it just slows down their first use).
2020-09-10 16:32:23 -07:00
j-jorge
81dd2232e1 Parse the releases info only once in emsdk.py. (#607)
Co-authored-by: Julien Jorge <julien.jorge@stuff-o-matic.com>
2020-09-10 06:29:19 -07:00
Reo
f6c9e453f8 Fix emsdk activate breaking configuration file (#602)
Fixes: #587

> If nodejs is not installed by `emsdk`, the output ".emscripten" file by `emsdk activate` will look like this.
> 
> ```python
> NODE_JS = ''/usr/bin/nodejs''
> # too many quotes
> ```
> 
> `emcc` fails to execute by this syntax error.
> 
> I think fixing [this line](https://github.com/emscripten-core/emsdk/blob/1.40.1/emsdk.py#L1450) could be a solution.
> 
> ```python
> activated_config['NODE_JS'] = "'%s'" % node_fallback
> # the value will be quoted later again
> ```
2020-08-31 08:27:03 -07:00
Alon Zakai
6adb624e04 Error on trying to get latest-fastcomp (#590)
I think this is less surprising than continuing to support latest-fastcomp
with the last fastcomp release. That's technically correct - the last release
is 1.40.1, and always will be - but when a user asks for "latest" I think they
want something up to date. Instead, give a clear error that indicates how
they can get an actually up to date build, by using upstream.
2020-08-11 15:10:43 -07:00
Sam Clegg
839c108479 2.0.0! (#586) 2020-08-10 17:12:56 -07:00
Sam Clegg
1e5c650388 Log warnings to stderr (#585)
Its particularly important during `construct_env` where stdout
is directly interpreted by the shell.

See: #385
2020-08-07 11:26:32 -07:00
Alon Zakai
16d4ec5489 Disallow fastcomp in tot and 2.0.0+ (#584) 2020-08-07 09:06:46 -07:00
Sam Clegg
60e3a51c7b Split out expand_sdk_name function. NFC. (#580) 2020-08-05 10:03:41 -07:00
Sam Clegg
6dac5ae712 Fail update-tags if not tot revision is found (#574) 2020-07-27 15:32:06 -07:00
Sam Clegg
4d4ae34365 Improve activation message (#562)
* Improve activation message

The activation message is now IMHO more informative and
actionable:

```
$ emsdk activate latest
Setting the following tools as active:
   node-12.18.1-64bit
   releases-upstream-e7e39da9c81faecd9ecf44065cee864d76e4e34d-64bit

Next steps:
- To conveniently access emsdk tools from the command line,
  consider adding the following directories to your PATH:
    $HOME/wasm/emsdk
    $HOME/wasm/emsdk/node/12.18.1_64bit/bin
    $HOME/wasm/emsdk/upstream/emscripten
- This can be done for the current shell by running:
    source "$HOME/wasm/emsdk/emsdk_env.sh"
- Configure emsdk in your bash profile by running:
    echo 'source "$HOME/wasm/emsdk/emsdk_env.sh"' >> $HOME/.bash_profile
```

* .
2020-07-21 18:04:31 -07:00
Sam Clegg
0e5f2d8e11 Rename osx -> macos (#563) 2020-07-21 12:26:30 -07:00
Sam Clegg
d8984b2a9d Rename build_llvm_monorepo to just build_llvm. NFC. (#560)
And build_llvm_fastcomp to just build_fastcomp (matches its name
in the json file.
2020-07-20 17:33:54 -07:00
Sam Clegg
b504f0ba3a Cleanup legacy 'copy_pregenerated_cache' handling. NFC. (#558) 2020-07-20 14:47:25 -07:00