Commit Graph

137 Commits

Author SHA1 Message Date
Hood Chatham e732cb9dd7
meta.yaml keys for cross-build environment (#2536)
This moves unisolation into a package key. `cross-build-env: true` means the package
is part of the cross build environment and should be unisolated. `cross-build-files`
gives a list of files that should be copied from the built copy of the package into the host
copy of the package.

This will allow us to construct a cross build environment automatically as part of building
packages. If we have these files and the Python include directory, this is sufficient for 
cross-building binary packages.
2022-05-11 20:31:16 -07:00
Hood Chatham 993940bbb9
Allow multiple loading of Pyodide instances (#2391) 2022-04-14 18:04:01 -07:00
Hood Chatham bda8a85df7
Update debugging devguide (#2386) 2022-04-11 16:02:11 -07:00
Hood Chatham 389f8ff1d2
Update openssl to 1.1.1n (#2334)
Update says: 'Security Advisory: one high severity fix' so probably
a good idea to include it.
2022-03-31 20:40:12 -07:00
Hood Chatham 37057d1704
Set PLATFORM_TRIPLET, include platform in so names, only load compatible so files (#2299)
For reasons that are a bit beyond me, `--host` and `PLATFORM_TRIPLET`
seem to be independent, in particular we've had an empty
`PLATFORM_TRIPLET`. This is unfortunate because `PLATFORM_TRIPLET`
is used to generate the SOABI config variable which in turn is used
to decide whether a .so file is a good match for loading. We'd like
for linux Pythons not to try to import emscripten .so files (it
raises `ImportError: some_file.so: invalid ELF header`). Similarly,
we'd like to avoid attempting to load linux .so files in wasm. These
platform tags are our friends.

Anyways, this PR sets `PLATFORM_TRIPLET` and ensures that .so files
built by pywasmcross are tagged with our SOABI tag.

I moved the .so file renaming from pywasmcross to buildpkg just
before running the post script. That is a better place to put it in
case the package wants to look at the .so file after linking it. It
might be surprised that we moved it.

I also improved the error message if we try to `loadWebAssemblyModule`
something that is actually say a Linux .so file and updated get_dynlibs
to filter out .so files that have an incompatible abi tag.
2022-03-28 20:07:36 -07:00
Hood Chatham 694c47f151
Update emscripten to 2.0.27 (#2295) 2022-03-23 23:31:13 -07:00
Hood Chatham 5897646e04
MAINT Update emscripten to 2.0.24 (#2035) 2022-03-23 23:27:46 -07:00
Hood Chatham e865b77040
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)

Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:

sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )

where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-23 23:17:29 -07:00
Hood Chatham eabfa8101e
Use pypa/build (#2272)
This resolves #2189.

> build isolation would be a bit difficult to use in our case, as for instance
> when building scipy we need the patched numpy on the host and not the numpy
> version specified in pyproject.toml (which would be unpatched)

This is indeed the case, certain packages cannot be isolated. My strategy is to
make a list of packages that shouldn't be isolated and add symlinks from the
isolated build environment into the `.artifacts` directory to "unisolate" them.
Then we remove the unisolated package requirements from the list of packages to
install, in case pesky constraints aren't satisfied. In particular, packages
that expect to be used with `pypa/build` often feel free to put very specific
constraints on their build dependencies (often asking them to be == to a
particular version). Specific version constraints is good for build
reproducibility and with build isolation doesn't cost anything. So we just
ignore the constraints. Hopefully nothing goes wrong.

In particular, any package that does stuff both at build time and at runtime and
requires synchronization between the build time and run time environments needs
the unisolation. This includes cffi with `_cffi_backend.so`, and of course numpy
and scipy. pycparser needs to be unisolated because it is a dependency of cffi.

Currently I have also unisolated pythran and cython, though these are build time
only tools and do not really need to be unisolated. Cython I unisolated
specifically because numcodecs needs it but it isn't in the numcodecs build
dependencies. Pythran I unisolated because of a problem with the scipy build
which I don't fully understand (some problem with long double feature
detection).
2022-03-21 22:05:30 -07:00
Hood Chatham 0e1e2ac01c
Python 3.10 (#2225) 2022-03-17 15:48:56 -07:00
Hood Chatham 0a9153e7c6
Add cryptography, openssl, and _ssl packages (#2263) 2022-03-11 22:05:36 -08:00
Hood Chatham c01ab547f0
Better package cross compilation (#2238)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2022-03-09 20:34:25 -08:00
Henry Schreiner 4f8b0a0344
chore: more pre-commit checking (#2257) 2022-03-07 21:51:20 -08:00
Hood Chatham fff0f0e9b0
Add `default_converter` argument to `to_js` and `toJs` (#2208) 2022-03-05 12:32:04 -08:00
Hood Chatham 5724bbc05c
MAINT use variables for Python version rather than hardcoding it (#2241)
* As much as possible, use variable for Python version rather than hardcoding it

This should make Python updates easier.
2022-03-03 19:13:58 -08:00
Hood Chatham 30ea13fbbf
Support for C++ exceptions in packages (#2178) 2022-02-19 08:31:19 +01:00
Hood Chatham 391c43e662
MAINT Separate some things out of Module (#2144) 2022-01-30 11:08:44 -08:00
Hood Chatham 8323987b39
Use wheels instead of file_packager (#2027) 2022-01-23 17:47:04 -08:00
Hood Chatham 5309d21371
Update to Scipy 1.7.3 (#2065) 2022-01-03 23:07:13 +01:00
Hood Chatham 282fbedcad
MAINT Invoke pywasmcross via function calls (#2063) 2021-12-25 12:08:43 -08:00
Hood Chatham 6065bcd532
MAINT Clean up environment variables and pywasmcross (#2053) 2021-12-20 11:26:27 -08:00
Hood Chatham 5b085e7aa3
MAINT Don't include debug symbols in distribution (#2050) 2021-12-17 13:08:25 -08:00
Hood Chatham af0daa2d9b
MAINT Load main pyodide package as a tar file (#2023) 2021-12-14 18:12:49 -08:00
Gyeongjae Choi 446aea4d7d
BLD Remove libjpeg from the main module (#2034) 2021-12-12 11:24:39 -08:00
Hood Chatham d6035abb88
Cleanup after #2019 (#2026) 2021-12-09 17:19:05 -08:00
Hood Chatham 19261f394c
Remove function pointer cast emulation (#2019) 2021-12-09 10:31:21 -08:00
Hood Chatham 418813de33
MAINT Split CI build-packages step in two (#2017)
Split build packages into a step for everything up to and including numpy and a second step for numpy and its dependencies.
Intended to prevent timeouts.
2021-12-05 12:34:09 -08:00
Hood Chatham 8870f67fef
MAINT remove `--memory-init-file 0` and consolidate link flags (#1974) 2021-11-18 23:37:47 +01:00
Hood Chatham 63cd2fbcb8
MAINT Be more careful about checking error code return values (#1950) 2021-11-16 22:06:24 +01:00
Roman Yurchak aa1ce3adc4
BLD Use outer ccache wrapper (#1805) 2021-09-11 14:22:13 +02:00
Gyeongjae Choi 13d757de74
Fix Pillow JPEG encode/decode error (#1818) 2021-09-07 16:24:06 +02:00
Paul m. p. P d4a705bde2
Use PYMAJOR/PYMINOR according to Python devguide (#1570)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-07-06 13:28:39 +02:00
Hood Chatham 653891b045
ENH Add Ctypes support (#1656) 2021-06-26 10:34:31 +02:00
Hood Chatham bd76207bb0
Update to emscripten 2.0.16 (#1645) 2021-06-19 19:37:52 -07:00
Hood Chatham b4f4bcffdc
Update to Python 3.9.5 (#1637)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-06-19 15:49:25 -07:00
joemarshall b22b4f0c9e
Move all configuration variables for compile into Makefile.envs (#1369) 2021-03-26 15:37:59 +01:00
Dexter Chua 958724101a
Update to emscripten 2.0.15 (#1312) 2021-03-10 09:13:53 +01:00
Paul m. p. P d2bd70a52a
BLD match host and target in case of multiple pythons (#1292) 2021-02-27 10:50:30 +01:00
Dexter Chua df3861e469
Update to emscripten 2.0.14 (#1256) 2021-02-16 11:25:53 +08:00
Dexter Chua eb2bd5c458
Allow changing emscripten version with env var (#1249)
This makes it easier to test against different emscripten versions on
the same tree (e.g. tot a la #1223).
2021-02-14 12:17:20 +01:00
Roman Yurchak 1aea60d91d
MAINT Update to emscripten 2.0.13 (#1198)
Co-authored-by: Dexter Chua <dalcde@users.noreply.github.com>
2021-02-10 09:23:10 +01:00
Dexter Chua b46acbadc2
Use EM_COMPILER_WRAPPER to enable ccache (#1218)
Fixes #1007. As in #1214, this breaks build if ccache is not available.
2021-02-09 12:28:37 +08:00
joemarshall 1bd8380c01
Emscripten 2.0.12 Upstream backend (#1102)
Co-authored-by: Dexter Chua <dalcde@users.noreply.github.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-02-06 08:58:12 +01:00
Dexter Chua f6f5da1145
Create script to set emscripten env vars (#1013) 2021-01-03 12:25:14 +01:00
Dexter Chua fe0b24d124
Update binaryen (#1015)
This is the version that comes with emscripten 1.38.44
2021-01-02 21:03:23 +08:00
Dexter Chua 2ffd31284c
Only build wasm-opt in binaryen (#1012) 2021-01-02 19:40:35 +08:00
Dexter Chua 4ae245855d
Install uglifyjs and lessc via npm (#1002)
The installation is very fast, and this avoids having two copies of node
around. In particular, this avoids the need to monkey-patch uglify-js to
use the system node.

This can be further streamlined when #792 is merged
2021-01-01 23:43:48 +08:00
Dexter Chua 27e2800120
Use upstream file packager instead of fork (#991) 2021-01-01 08:48:28 +01:00
Dexter Chua 3f9062adf7
Update binaryen version_86 (#910) 2020-12-22 11:24:51 +08:00
Dexter Chua 9472852450
Update to emscripten 1.38.44 (#906) 2020-12-21 13:00:05 +08:00
Dexter Chua 808de0ed6d
Update emscripten to 1.38.43 (#903) 2020-12-20 19:37:46 +08:00
Roman Yurchak 641ce219b8
Use PYODIDE_BASE_URL for the deployment location (#855) 2020-12-18 13:23:45 +01:00
Dexter Chua 452b379363
Upgrade to emscripten 1.38.42 (#843) 2020-12-15 08:56:43 +01:00
Dexter Chua 0defcb3825
BLD Don't compile host python (#830) 2020-12-08 00:19:16 +01:00
Dexter Chua 25de5b6016
BLD Refactor emsdk/Makefile (#827)
1. Split long shell command into multiple commands
2. Make BINARYEN_VERSION a variable instead of hardcoding in Makefile
3. Set Makefile.envs and patches as dependencies
2020-12-06 11:36:37 +01:00
Dexter Chua 68d0d8229e
Fix node path (#826) 2020-12-06 11:34:07 +01:00
Dexter Chua d67648a6b8
BLD Update package build script's default ldflags (#817) 2020-12-03 14:27:40 +01:00
Roman Yurchak f7adad7eb3
Upgrade to emscripten 1.38.34 with fastcomp (#480)
Co-authored-by: Dexter Chua <dec41@srcf.net>
2020-11-30 18:54:35 +01:00
Roman Yurchak 7d4fbe9d1a
DOC Add FAQ entry on detecting pyodide at run and build time (#790) 2020-11-07 12:21:54 +01:00
Roman Yurchak fc5495ffdb
Update to Python 3.8.2 (#712)
* Updating to CPython 3.8

* More fixes

* Skip python headers check in tools/dependency-check.sh

* Fix checksum

* Fix packages

* Fix syntax error

* Fix benchmark path

* Update CPython tests

* More test fixes

* Fix PyStone

* More Cpython test fixes

* Update docs

* Fix issue in conftest

* Add documentation

* Upload updated Docker image
2020-07-07 16:21:33 +02:00
Roman Yurchak 4ee8dedeed
Update to emscripten 1.38.31 (#674)
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2020-05-28 18:13:51 +02:00
Adam Seering 3ec7849cfe
ENH Upgrade cpython to 3.7.4 (#625) 2020-03-25 12:31:12 +01:00
Adam Seering 7c0cbf61f4
Upgrade cpython to 3.7.3 (#624) 2020-03-18 10:36:50 +01:00
Michael Droettboom 2f2ed8fc26
Upgrade to Python 3.7.2 (#321)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-03-12 13:30:33 +01:00
Adam Seering f71b69bf7c
ENH Upgrade to Python 3.7.1 (#619) 2020-03-11 11:32:30 +01:00
Adam Seering 6a02cabaad Update to use sdk-fastcomp-tag-<version> for emscripten (#589)
* Update to use sdk-fastcomp-tag-<version> for emscripten, as sdk-tag-<version> is no longer available upstream.
* Update code to use new path
* Replace Circle-CI CPU_CORES hack with environment variables (now supported upstream)

Co-authored-by: AndyLockhart <AndyLockhart@users.noreply.github.com>
2019-12-31 12:09:39 -05:00
Michael Droettboom 33a7ffc1a6
Revert "Quote PATH in Makefile.envs (#535)" (#536)
This reverts commit 78cbdb4e89.
2019-10-15 13:11:49 -04:00
William Lachance 78cbdb4e89
Quote PATH in Makefile.envs (#535)
This fixes the build for cases that you have a path with a space
seperator in it (e.g. `/Applications/Racket v6.3/bin/`)
2019-10-15 13:06:33 -04:00
Michael Droettboom 047b414f3d
Upgrade to emscripten 1.38.30 (#374) 2019-04-04 07:57:47 -04:00
Madhur Tandon a704d5a04b Implement the ABI number functionality.
Modified ``Makefile`` and ``packages/Makefile`` to get ``PYODIDE_PACKAGE_ABI`` from ``Makefile.envs``
Made ``checkABI`` as a public API function.
Modified ``file_packager.py`` to check for the compatible ABI number.
Defined ABI number with which pyodide is built in Makefile.envs
Accepted ABI number in ``file_packager.py`` as an argument.
Modified ``buildpkg.py`` and ``buildall.py`` to account for the new argument.
Added the corresponding ``test_different_ABI`` test.
2019-01-23 00:07:39 +05:30
Michael Droettboom b24be2473e Export all symbols from everything 2019-01-15 16:52:00 -05:00
Michael Droettboom 4b3bfe53ad Upgrade emscripten to 1.38.22 2019-01-10 07:40:01 -05:00
Michael Droettboom c71eff248b Update PATH 2018-10-01 21:16:04 -04:00
Michael Droettboom 58048cff2c Upgrade to emscripten 1.38.12 2018-10-01 18:56:57 -04:00
Roman Yurchak b9ad36fdd7 Set "BINARYEN_TRAP_MODE='clamp'" 2018-09-27 11:38:26 +02:00
Michael Droettboom 56562257ef Fix #71: Upgrade to Python 3.7 2018-09-06 10:56:33 -04:00
Roman Yurchak f15e13d3cd Use clang-format from emcc/clang 2018-08-27 20:20:23 +03:00
Michael Droettboom a02c2de983 Fix paths 2018-07-24 17:48:18 -04:00
Michael Droettboom 4153f5bc83 Update emscripten to 1.38.10 2018-07-24 17:47:49 -04:00
Michael Droettboom 409fe3b3f4 Use ccache 2018-07-24 12:58:31 -04:00
Michael Droettboom 07b1d17f15 Restore HOSTPYTHON variable 2018-06-20 17:10:06 -04:00
Michael Droettboom 17e1562ded MVP of a proper packaging system 2018-06-20 14:54:47 -04:00
Michael Droettboom f2e46063d6 Pin the compiler to a particular version 2018-05-31 18:46:57 -04:00
Michael Droettboom b537908b2b Simplify Makefiles. Support parallel compilation. 2018-05-16 13:06:44 -04:00
Michael Droettboom deea97cd4c Use pre-built toolchain 2018-04-02 13:06:36 -04:00
Michael Droettboom 018727487b Export variables 2018-04-02 10:33:19 -04:00
Michael Droettboom b8c3e600c2 Add end-to-end build. Travis tests. 2018-03-30 13:08:06 -04:00