Commit Graph

683 Commits

Author SHA1 Message Date
Sam Clegg
5dd09e4893 Convert emsdk_manifest.json to unix line endings (#330) 2019-08-27 11:47:57 -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
Sam Clegg
596bdc5ea4 Fix file permissions when extracting zip files (#325)
This means that `./emsdk` works on UNIX system after emsdk self-updates
from a zip file.  Without this one would need to run `python ./emsdk`
which seems to be why the tests were doing it this way.
2019-08-26 23:06:56 -07:00
Alon Zakai
da4900b83f Always download archives, since we delete them after use anyhow. This prevents using archives left behind by mistake in the past. (#324)
Fixes #323
2019-08-21 13:42:09 -07:00
Alon Zakai
6a4c0f981d Properly clean up downloaded zips (#322)
We got this wrong because we were not using get_download_target, so we were trying to delete the wrong file.

Also add a test.

Fixes #320
2019-08-20 12:26:44 -07:00
Alon Zakai
64c5e81772 [windows] Replace python2-specific error handling with a check that works in python3 as well (#300)
Fixes #298
2019-08-19 14:51:35 -07:00
Alon Zakai
9f9d8c074c 1.38.42 (#321) 2019-08-19 14:36:20 -07:00
Alon Zakai
d92a831fc9 tidy up a comment (#315) 2019-08-19 14:00:24 -07:00
Alon Zakai
d94e9fbc89 1.38.41 (#317) 2019-08-07 10:39:51 -07:00
Alon Zakai
07536cd127 List all archive suffixes properly, so we clean up all downloaded archives (#316)
Implements what @juj suggested here: #274 (comment)

After this, the behavior should consistently be: archives are downloaded, unpacked, then deleted immediately. Another install of the same thing will re-download.
2019-08-06 13:00:20 -07:00
James Calo
e4c7185a1c Fix issue with windows install (#310)
Windows version of python 3 returns platform.machine() in upper case for AMD64 which wasn't being checked for so added .lower().

Doesn't affect Linux python3 which already worked.
2019-08-06 09:20:46 -07:00
Brion Vibber
2b568055af Basic ARM and Aarch64 support for emsdk (#277)
This adds an "arch" field to various structures, so ARM and Aarch64
Linux can download appropriate versions of node and in theory
other tools, without trying to download x86 builds.

Since there are no prebuilt packages for clang and binaryen on ARM
or Aarch64 this will require building them, which can take a long
time, but works once installed.

Node 4.1.1 and 8.9.1 entries for ARM (armv7l) and aarch64 are
added, and the various x86/x86_64-only things are marked as such
to be filtered out on ARM machines.

Other downloads work as long as they don't have an arch specified,
which indicates they're expected to be arch-independent.

Does not yet fully work on ARM64 Windows (but works in WSL as the
Linux support is fine).
2019-08-02 15:14:11 -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
Roman Petrov
aa2812b8ba Fix 'SendMessage' hanging on Windows (#301)
Use PostMessage instead.
2019-07-25 19:49:08 -07:00
Alon Zakai
599e17d9ea 1.38.40 (#304) 2019-07-24 13:34:19 -07:00
Alon Zakai
a51302ba20 1.38.39 (#302) 2019-07-16 13:17:56 -07:00
Eric Kilmer
4a0f6a264e Support ninja build tool (#261)
The user can choose which CMake generator to use by passing the --generator option, e.g. --generator=Ninja or --generator="Unix Makefiles" to emsdk.

Default on *nix systems is Unix Makefiles
2019-07-15 17:10:31 -07:00
Alon Zakai
4965260505 1.38.38 (#296) 2019-07-08 20:29:04 -07:00
Thomas Lively
35cd9268f0 Back up overwritten configuration files (#295) 2019-07-03 16:11:00 -07:00
Alon Zakai
c3f0e0fc0d Fix windows bug with move erroring if the target exists, so installing a second time fails (#294)
Fixes #286
2019-07-03 15:30:01 -07:00
Alon Zakai
d33f7a2900 Extra testing for library building (#291)
Verify the latest things we've started to ship pre-built (libc, struct_info, optimizer) are in fact not built on the user's machine.
2019-06-26 13:13:48 -07:00
Alon Zakai
58aad76461 fix old tests (#283)
The tests for older versions had some copy-paste stuff, that meant we didn't fully test activating them.
2019-06-26 12:45:51 -07:00
Alon Zakai
4a104699d5 1.38.37 (#290) 2019-06-26 10:55:51 -07:00
Alon Zakai
f1998bb124 Use the bundled optimizer[.exe], which the releases builds contain already (#289) 2019-06-25 18:02:50 -07:00
HaRold
056ce6f64d Exclude fastcomp and releases in .gitignore (#285)
Fixes https://github.com/emscripten-core/emsdk/issues/284
2019-06-25 13:33:14 -07:00
Alon Zakai
3e6d8b395f Use prebuilt cache contents (#282)
See WebAssembly/waterfall#542

The builds now contain lib/wasm-obj/ or lib/asmjs/ which have some cache contents. This places those in the cache so the user doesn't need to build them on first run, which for libc at least can be quite slow.

The mechanism here is to run emcc a first time in the emsdk. That clears the cache (since the emsdk just updated the .emscripten file). We can then safely place the files in the cache.

Note that FROZEN_CACHE is not used, since we do want to leave the user the option to build other things to the cache - we'll never ship all possible system and ports builds in the emsdk downloads, probably.

This contains a test, which passes on tot-upstream. The last tagged release doesn't have this yet.
2019-06-25 12:41:28 -07:00
Alon Zakai
dffb280b35 Use check_output in test.py (#280) 2019-06-17 17:11:36 -07:00
Alon Zakai
87285f5e8f 1.38.36 ; Check if all downloads exist for the latest version (#278)
This verifies all builders successfully uploaded builds for a new version that we tag here.

This prevents a problem like happend on 1.38.35, where the mac and windows bots "skipped" the hash that we tagged - they built the one before, and I guess were too slow, so they skipped to the next commit after it? Which is expected I guess, but surprises me a little. Anyhow, with this fix we should avoid such problems in the future.

Tags 1.38.36 to verify things work and get people a working version.

Also check some other basic things: check the version built reports the right one in emcc -v, and that multiple emsdk updates still work.
2019-06-15 12:00:54 -07:00
Alon Zakai
9c22ea9e78 Emscripten 1.38.35 (#276)
This brings in the libtinfo changes. As a result this may fix breakage for some linux users, at the cost of some linux users possibly losing colors in the console (since sometimes that doesn't work with libtinfo not linked in).
2019-06-14 17:54:26 -07:00
Piotr Paczkowski (trzeci.eu)
29b91e38e0 python_selector checks if found python command is valid (#275)
Addresses emscripten-core/emscripten#8792

I've found what's the reason of the strange behaviour of last changes (#273).

In order to reproduce this problem it's needed:

    To don't have python3 installed in system
    To have pyenv with installed at least one version from each family, like:

pyenv install 3.7.0
pyenv install 2.7.15

    To activate a version from python2

pyenv local 2.7.15

Then we have a strange situation that python3 is available as a command, but it's just a mock for pyenv:

➜ pyenv versions
  system
* 2.7.15 (set by /home/trzeci/Projects/emsdk/.python-version)
  3.7.0

➜ which python3
~/.pyenv/shims/python3

➜ python3 --version
pyenv: python3: command not found

The `python3' command exists in these Python versions:
  3.7.0

➜ ./emsdk --help        
pyenv: python3: command not found

The `python3' command exists in these Python versions:
  3.7.0

As you see in an example above I didn't even call emsdk script, just tried to execute python3 --version and I've got exactly the same error. The problem of pyenv is that even if python3 isn't active it's available in the system PATH.
Calling ./emsdk --help get's the same error, as python3 was used.

At the moment this entirely breaks logic in python_selector and in pyenv working command is indistinguishable from stub python command.

@kripken: A couple of ways to go from here:

    revert logic of python_selector and advertise mac users to use python3
    keep logic and advertise pyenv users to use python3
    This PR: extend logic of python_selector by checking if found python command is valid (for the instance by calling python --version), this will filter out false positive matches that coming from pyenv

After patch:

➜ pyenv versions        
  system
* 2.7.15 (set by /home/trzeci/Projects/emsdk/.python-version)
  3.7.0

➜ which python3 
~/.pyenv/shims/python3

➜ python3 --version
pyenv: python3: command not found

The `python3' command exists in these Python versions:
  3.7.0


➜ ./emsdk --help
 emsdk: Available commands:

   emsdk list [--old] [--uses]  - Lists all available SDKs and tools and their
                                  current installation status. With the --old
   ....

As you can see python3 --version command fails as it was, but that's expected behaviour. What's important is that ./emsdk --help gets executed as python_selector recognizes a stub.
2019-06-13 15:47:29 -07:00
Piotr Paczkowski (trzeci.eu)
a61a528e48 Default Python 3 for running emsdk (#273)
* Default Python 3 for running emsdk

On macOS it's pretty common to hit a problem
```
Error downloading URL 'https://github.com/kripken/emscripten/archive/1.38.25.tar.gz': <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>
```
When an installation is started. I.e. `./emsdk install sdk-1.38.25-64bit` - this is caused in majority of cases by some problem of openssl and python2 - (some other https downloads work just fine, not sure why GitHub is special)

So this Pull Request will default Python to Python 3, for running `emsdk`. It does so by making ./emsdk executable in python, bash, and sh. In bash and sh it will run a python executor script, which picks the best python it can find, preferring python3 on non-windows.
2019-06-12 15:55:29 -07:00
Alon Zakai
c0e1167aad fix ./emsdk update of a *non*-git install (#271)
The non-git case was not well documented and not tested, and it was broken since we switched the build infrastructure.

In the git case, an update is to do a git pull. In the non-git case, it downloads a zip and unpacks it. The old build infra apparently had builds created for this; instead, I made it download it directly from github. Perhaps we should consider creating builds for this as well eventually?

Also add a test for this, so we never break it again.
2019-06-10 16:38:54 -07:00
Alon Zakai
fc0ed1e17c Remove obsolete docs on README (#270)
A bunch of info there is out of date.

Instead, let the link to the install instructions on the main site (which was there already on line 11 higher up) speak for itself; we should have just one central location for these basic instructions.
2019-06-10 10:10:06 -07:00
Alon Zakai
169a3ac27c Error on downloading a 64-bit package on a non-64-bit OS (#265)
Also fix the can_be_installed which was always broken it seems - it returns True for success or a string for error, but didn't check if the output is True.

Includes a test, which hacks up emsdk to make it think it's on 32-bit, and verifies the error and message.
2019-06-06 09:04:05 -07:00
Alon Zakai
bab28f9a71 list emscripten-releases versions in ./emsdk list (#268)
The output now looks like

===
The *recommended* precompiled SDK download is 1.38.34 (048cf9424790cc525a7ea6da340820aae226f3b9).

To install/activate it, use one of:
         latest                  [default (fastcomp) backend]
         latest-upstream         [upstream LLVM wasm backend]

Those are equivalent to installing/activating the following:
         1.38.34
         1.38.34-upstream

All recent (non-legacy) installable versions are:
         1.38.34
         1.38.34-upstream
         1.38.33
         1.38.33-upstream
===

and after that is the detailed output with the older builds etc.
2019-06-05 19:27:34 -07:00
Alon Zakai
fef3dacae0 support sdk-tag-X.Y.Z-64bit (we supported it without -tag-, but that did work before) (#267) 2019-06-05 14:31:44 -07:00
Alon Zakai
5da4a1ae99 Move testing into a bash file on the side (#266) 2019-06-05 10:19:20 -07:00
Alon Zakai
077a8b2b97 emsdk list fixes (#257)
List the recommended downloads (latest, latest-upstream) first, and with version and hash. Then list precompiled things, then list build-from-source things.

Remove old upstream-clang build from source, which has been incorrect since llvm switched to a monorepo anyhow. If we want the emsdk to support source builds of llvm, we'll need to fix that - however, as we can use plain upstream llvm anyhow, that shouldn't be hard for developers to build themselves (and normal users will get a precompiled version anyhow).

Remove the option to build fastcomp from source with wasm backend support, as it is horribly old there.

Noticed these issues in emscripten-core/emscripten#8728
2019-06-05 06:25:03 -07:00
Alon Zakai
1d3522678c Refactor test code into python (#264)
Keep the basic workflow test (checking what a user would do to get started) in bash, but otherwise it's more convenient for most tests to be in python.
2019-06-04 16:01:25 -07:00
Alon Zakai
a382d620e5 Stop fetching emscripten and binaryen tags the old way (#262)
We now have versioning directly here in this repo for emscripten-releases. This PR makes us stop looking for tags the old way, which looked on github for tags.

Rename the files legacy-*.
2019-06-04 10:16:02 -07:00
Alon Zakai
188c3edb9b Tag 1.38.34 (#258)
This should fix some version warnings people are currently seeing - we removed the fastcomp version warnings between repos check after the last version, in emscripten-core/emscripten#8664, #259
2019-06-02 09:11:46 -07:00
Alon Zakai
454bf4a7bb update repo name (#255) 2019-05-30 16:58:36 -07:00
Alon Zakai
515f46fae8 Change default emsdk download location to emscripten-releases/deps (#254)
Instead of from mozilla S3.

This should make the core python, java, node downloads work, as we have mirrored them to the new location. I think that should be everything - if we missed something, we will get an error, and so know we need to fix something.

(The non-deps downloads still use a full url to emscripten-releases in the manifest, which is not changed here.)

Also change the download location for old llvm builds to emscripten-releases/old/
2019-05-30 14:22:07 -07:00
Alon Zakai
963d839afa Bundle java and python for emscripten-releases on windows, which matches the old behavior (#253) 2019-05-30 09:05:38 -07:00
Alon Zakai
0490c5f7aa Support getting specific releases from emscripten-releases, by their version (#251)
This makes

emsdk install 1.38.33

work (1.38.33 is from the new builders).

Also works with the old notation, sdk-1.38.33-64bit, and also supports -(upstream|fastcomp).
2019-05-29 14:14:42 -07:00
Alon Zakai
3595b073f3 Switch over to emscripten-releases for 'latest' (#250)
This makes emsdk [install|activate] latest get the latest fastcomp release from emscripten-releases, replacing our usage of the old mozilla build infrastructure.

This is only for "latest", so there should be no change to older releases.

This does remove non-release old stuff from the mozilla infrastructure, like "nightly" builds (that I don't think were even working?). After this PR, only old releases should be used from there.

Context: we've asked that people test the emscripten-releases builds for 1.38.33, and fixed a few issues people found. There are no open showstoppers, so this is us moving to the next step, serving latest builds from the new infrastructure.
2019-05-29 10:38:43 -07:00
Alon Zakai
76a5ae0b82 If an archive has not been downloaded, download it and assume its contents are new (#248)
This allows us to always unpack our builds into upstream/ or fastcomp/, instead of creating a new directory each time. Since without this, we'd get told to download a new file, and the emsdk would see that where it would be unpacked had contents, and assumed that even though it wasn't downloaded it must be the same. So we'd silently skip it.

It's useful to always unpack into the same dir since it's easier for people that create their own .emscripten file (the location of emscripten etc. is all fixed under the emsdk), and also it avoids directories accumulating, which each take hundreds of megabytes, so over time it can get burdensome.
2019-05-28 15:57:04 -07:00
Alon Zakai
7b8322f45e Remove waterfall integration (#246)
We can remove this now that we have emscripten-releases working and use it everywhere we used the emsdk's waterfall integration.

In particular this should fix the current lkgr.json errors people are seeing (by removing all the lkgr stuff), which I believe started when I refactored that code while doing the releases work - I must have gotten something wrong on non-linux OSes. But anyhow, easier to remove that unnecessary code than fix it at this point.
2019-05-24 14:04:43 -07:00
Alon Zakai
e1c8f791a9 Support for tip-of-tree (tot) builds (#245)
emsdk install tot-upstream will install the very latest build from emscripten-releases. These builds are useful for emscripten github CI.

There isn't a latest or lkgr for emscripten-releases currently. What this does instead is get the git repo, and check if builds exist for the latest commits there, returning the latest of those.

This also makes us not update the emscripten-version.txt file if we are not an actual version. That is, for a tot build we leave that file unchanged in the emscripten checkout.

There is also a tot-fastcomp for fastcomp.
2019-05-24 10:23:01 -07:00
Alon Zakai
0ff164fc0c Restore lkgr (#244) 2019-05-23 19:56:13 -07:00