Commit Graph

78 Commits

Author SHA1 Message Date
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
Sam Clegg
9d1b5b6d7d Cleanup and unify code for removing files. (#557) 2020-07-20 14:25:09 -07:00
Sam Clegg
3e9f04d467 Remove support for non-embedded mode (#510)
embedded mode as been the default since #472 and I included
`--no-embedded` as an option during the interim time, but to simply
the code and avoid have two modes of operation I think its safe
to now remove the non-embedded mode.
2020-07-20 13:39:21 -07:00
Brion Vibber
9f63f10ab6 Fix fatal exception in "emsdk list" on unsupported platforms (#549)
On platforms with no supported binary SDKs to download, find_sdk
can return None which caused a check in the "list" command to fail.
Checking for the return value before making method calls fixes this,
and allows Linux/ARM64 to run "emsdk list" and then build an SDK
from source.

Fixes https://github.com/emscripten-core/emsdk/issues/548
2020-07-11 20:44:40 -07:00
Walt
c494899c17 Change EMSDK_SET_ENV to output correct filename for powershell. (#546)
Rename write_set_env_bat to write_set_env_script.
2020-07-11 07:38:17 -07:00
Sam Clegg
d37abed2de Avoid writing to file in emsdk_env.csh / emsdk_env.sh (#544)
This is an alternative fix for
https://github.com/emscripten-core/emscripten/issues/9090 which recently
came up again after #539.

Tested with bash, tcsh and fish.
2020-07-10 17:49:16 -07:00
Sam Clegg
4f2daec074 Fix running emsdk_env.sh outside of emsdk directory (#541)
Fixes: #540
2020-07-07 09:03:43 -07:00
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
태재영
92d512faa8 docs: change message when running emsdk_env.sh (#537) 2020-07-01 21:37:54 -07:00
Sam Clegg
38a270fa5c Minor python cleanups. NFC. (#496) 2020-06-23 18:00:22 -07:00
Sam Clegg
8dd51b45e9 Remove unused permanent in construct_env (#525)
This was only ever set to true if the user knew to pass an
undocumented extra argument called "perm".
2020-06-23 17:59:46 -07:00
Orestis Floros
6b0d151917 Properly sort versions in "emsdk list" (#508)
Split version to integers but avoid exceptions in case there is a
non-numerical character in some version.

Comparison:
    Before   |   After
    1.39.9       1.39.16
    1.39.8       1.39.15
    1.39.7       1.39.14
    1.39.6       1.39.13
    1.39.5       1.39.12
    1.39.4       1.39.11
    1.39.3       1.39.10
    1.39.2       1.39.9
    1.39.16      1.39.8
    1.39.15      1.39.7
    1.39.14      1.39.6
    1.39.13      1.39.5
    1.39.12      1.39.4
    1.39.11      1.39.3
    1.39.10      1.39.2
    1.39.1       1.39.1
    1.39.0       1.39.0
    1.38.48      1.38.48
    1.38.47      1.38.47
    1.38.46      1.38.46
    1.38.45      1.38.45
    1.38.44      1.38.44
    1.38.43      1.38.43
    1.38.42      1.38.42
    1.38.41      1.38.41
    1.38.40      1.38.40
    1.38.39      1.38.39
    1.38.38      1.38.38
    1.38.37      1.38.37
    1.38.36      1.38.36
    1.38.35      1.38.35
    1.38.34      1.38.34
    1.38.33      1.38.33
2020-06-01 15:15:41 -07:00
Sam Clegg
858b176f68 Use embedded configuration by default (#472)
This is part of a wider plan to remove the use of the user's HOME
directory completely:
  https://github.com/emscripten-core/emscripten/issues/9543
2020-05-29 09:49:51 -07:00
Orestis Floros
855c51d36d Improve behaviour regarding "help" (#509)
Also accept -h for help. 

This is the usual behaviour of most utils that accept --help.

Also, now an empty call to ./emsdk does not print the full help, as
discussed in #509.
2020-05-28 13:25:23 -07:00
Alon Zakai
5613488e75 Properly report what is installed in "emsdk list" (#505)
This expands on #460 which added a file in each install dir
with the version, that lets us know not to re-download it. That
didn't integrate with is_installed, so it wasn't reported properly,
which this PR fixes.

With this we can remove a hack for python, as we can simply
not install anything if it's already installed (see line 1859).

Also add the "INSTALLED" indicators on the main listings in
"emsdk list".

Bug was reported in #477
2020-05-21 10:35:48 -07:00
Sam Clegg
14c0a9ec21 Update default emscripten cache directory (#501)
See: https://github.com/WebAssembly/waterfall/pull/644

For the sake of older versions of emscripten explicitly set
EM_CACHE environment variable to point to the in-tree cache
directory.
2020-05-13 16:28:49 -07:00
Sam Clegg
7e22ab8ae0 Refactor such that Tool.activated_config returns a map. NFC (#502)
Split out from #501
2020-05-13 15:43:00 -07:00
Alon Zakai
4265173445 Remove legacy builds (#500)
"Legacy" here meaning anything using only < 1.38.0, and anything
using 'nightly' mozilla builds (which have not been done for years).

This also lets us remove node 4.1.1 (but not 8.9.1).
2020-05-13 08:10:23 -07:00
Sam Clegg
f5e21de6d6 Fix for parsing existing config in --embedded mode after #495 (#498)
Ooops, I guess even the most innocent-seeming change can have
unintended consequences. Switching to embedded by default will at
least make this path more tested in the future.

Fixed #497
2020-05-08 10:45:57 -07:00
Sam Clegg
88ae40037b Make installation errors fatal (#437)
If `is_installed` doesn't return true after install than something
serious went wrong so make this into a warning.

Also, clean up couple of places to make the python code more
readable.
2020-05-07 12:51:19 -07:00
Sam Clegg
683ceadc32 Add CACHE setting to config file (for embedded users) (#495)
See https://github.com/emscripten-core/emscripten/pull/11091
2020-05-07 12:12:52 -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
juj
7016bd60ce Drop Visual Studio 2015 build support and older (#482)
* Drop Visual Studio 2015 build support and older

* Flake
2020-04-28 17:25:19 +03:00
Dan Field
009ab2c77f Avoid re-downloading files that are already downloaded (#460)
* Writes a .emsdk_version file to output directories using the name (which contains a version number and/or hash) once all installation steps have completed successfully.
* If that file exists, skip downloading/installation hooks.
2020-04-01 13:46:22 -07:00
Alon Zakai
8a35734a47 Fix precompiled library support + testing (#444)
Support multiple libraries for precompiled things, as we use a
different one for LTO, etc.
2020-03-05 10:45:46 -08:00
Diego Casorran
50df5a2983 Fix ZIP extraction on Windows. (#438)
Meant to resolve #412 (comment)
2020-02-12 14:01:50 -08:00