Commit Graph

173 Commits

Author SHA1 Message Date
Hood Chatham 1c34d76482
Emscripten 3.1.27 (#3314) 2022-12-02 16:12:42 -08:00
Hood Chatham 2df7a286ee
Emscripten 3.1.26 (#3280) 2022-11-21 17:34:49 -08:00
Hood Chatham 3692ff8b22
Emscripten 3.1.25 (#3239)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>

Adds a patch reverting an Emscripten commit that dropped a freetype patch.
2022-11-14 13:44:29 -08:00
Hood Chatham 201f541b63
Emscripten 3.1.24 (#3236) 2022-11-07 14:00:05 -08:00
Hood Chatham 3dfe5b35ef
Emscripten 3.1.23 (#3148) 2022-11-07 08:51:24 -08:00
Gyeongjae Choi a916ea0b34
BLD simplify building CMake based packages (#3128)
This PR makes building CMake based packages easier.
- Introduce a custom toolchain file for Pyodide. It inherits most of settings from the original Emscripten toolchain file with some modifications. Packages built by pyodide-build will automatically use that toolchain file.
- Proxy cmake in pywasmcross.py, in order to proxy other compiler toolchains.
2022-09-22 10:42:26 +09:00
Gyeongjae Choi 69b2d3f157
Add debug build option for js package (#3129) 2022-09-21 14:20:08 +09:00
Hood Chatham 0eb6036b85
Update to emscripten 3.1.21 (#3107) 2022-09-15 16:58:14 -07:00
Hood Chatham 939b615df0
Emscripten 3.1.20 (#3027)
GSW patch:
TEOS-10/GSW-Python#99

galpy patch:
jobovy/galpy#499

pyerfa patch:
liberfa/pyerfa#89

astropy patch:
astropy/astropy#13586

scipy patch:
scipy/scipy#16924
2022-08-29 18:57:05 -07:00
Hood Chatham 325291ab87
Use upstream C++ error formatting support (#2828)
The logic that we are using to format C++ exceptions has been upstreamed. 
This will also work correctly with wasm exceptions.
2022-08-25 14:41:39 -07:00
Hood Chatham 67aa16861d
Update Emscripten to 3.1.18 (#2950) 2022-08-21 17:17:49 -07:00
Gyeongjae Choi 26535e33cd
Unvendor sqlite3 from stdlib (#2946)
Unvendor the standard library sqlite3 to reduce the size of the main module. It reduces the size of pyodide.asm.wasm around ~1.4MB.

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-08-22 08:52:50 +09:00
Hood Chatham 02644bd353
Set MIN_SAFARI_VERSION to include v14.0 (#2994) 2022-08-20 07:55:22 +02:00
Gyeongjae Choi da70299d1e
Update emscripten to 3.1.15 (#2958) 2022-08-17 19:14:10 +09:00
Gyeongjae Choi b497ce26ed
Add lzma (#2939) 2022-08-11 17:52:23 +09:00
Gyeongjae Choi a72ce423b4
BLD Use emscripten ports of bzip and zlib when building cpython (#2912) 2022-07-28 10:17:58 +02:00
Gyeongjae Choi 9fbb2972eb
Remove freetype and png from the main module (#2813) 2022-07-04 09:11:55 +02:00
Hood Chatham 52287a179d
More work on create_xbuildenv to allow building numpy (#2811)
This is more WIP on create_xbuildenv. I am including some of the WASM_LIB_DIR
but not all of it to keep size in check. The current cross build environment that we
would upload/download is 20mb.

To use this, we need an extra CLI entrypoint which I am working on.
2022-07-01 11:20:45 -07:00
Hood Chatham deb344cd37
Update Rust nightly version (#2792)
Yesterday's nightly includes rust-lang/rust#98149 which allows us to remove the
PIC setting. This also means we won't ever have to put -Zbuild-std back in.
2022-06-26 21:21:34 -07:00
John Wason 810be8869f
Add Robot Raconteur package to Pyodide (without wasm-exceptions) (#2794)
This PR adds the Robot Raconteur Pyodide package, which is a modified version
of Robot Raconteur designed to run in the Pyodide environment, using WebSockets
for communication. See robotraconteur/robotraconteur for the full version of the
package. Robot Raconteur is used to communicate with robots and other automation
components, and has a large library of drivers and packages: robotraconteur/robotraconteur-directory.
It is used as the bases for PyRI, a robotics programming environment: 
https://github.com/pyri-project/pyri-core/blob/master/README.md. Using a bridge, this package can
also be used to communicate with ROS2 networks: robotraconteur-contrib/robotraconteur_ros2_bridge
2022-06-26 21:17:58 -07:00
Hood Chatham f3e8836902
Update emscripten to v3.1.14 (#2775) 2022-06-23 15:51:06 -07:00
Hood Chatham fac51bdcf0
Default to -sSIDE_MODULE=2 in packages (#2712)
Drops the size of the dist directory from 271mb to 226 mb which is a 17% size reduction.
2022-06-23 07:15:21 -07:00
Hood Chatham be331255f7
Pass -Zlink-native-libraries=no when building Rust (#2753) 2022-06-21 08:21:33 +02:00
Hood Chatham fcdcc47d66
Drop mutable-globals flag when compiling Rust (#2723) 2022-06-15 19:37:41 -07:00
Hood Chatham 6868d2e93c
Use -sSIDE_MODULE=2 when compiling rust (#2713) 2022-06-15 07:27:34 -07:00
Hood Chatham 8d30ebdf13
Update emscripten patches again (#2684)
This drops the Rust patch and "Throw away errors in minify wasm_js" which
I suspect was fixed by an emscripten update (I'm not sure how long ago). It 
replaces the two remaining emscripten patches with new versions that match
the versions I am upstreaming.
2022-06-14 17:01:09 -07:00
Hood Chatham 9c305efc46
Fix cryptography build after emscripten update (#2683) 2022-06-14 14:54:07 +02:00
Hood Chatham c834085995
Use emscripten 3.1.13 (#2679) 2022-06-10 22:26:10 +02:00
Hood Chatham 52f27f06ad
Update to emscripten 3.1.6 (#2672) 2022-06-10 08:13:36 -07:00
Hood Chatham dbbbbb67b2
Cryptography v36.0.2 w/ Rust (#2378) 2022-06-09 10:57:34 -07:00
Hood Chatham 95b1194945
Enable Wasm BigInt (#2643)
This enables WASM_BIGINT while maintaining (hypothetical) Safari 14 support
by shimming BigInt64Array and BigUint64Array if they are missing. I think the
last time we tried to enable WASM_BIGINT was before #2019 so our chances
are significantly better this time.

This will fix dynamic linking bugs and yields a minor reduction in code size.
2022-06-02 10:09:54 -07:00
Hood Chatham 951681cfba
MAINT Improve debug settings in Makefile.envs (#2648) 2022-05-30 17:16:55 -07:00
Hood Chatham 2f4f258bb5
MAINT Use target sysconfigdata rather than host sysconfigdata when cross compiling (#2516)
sysconfig.py uses the environment variable `_PYTHON_SYSCONFIGDATA_NAME`
to decide where to look for the sysconfig data file with info about the compile target.
We also need to separately insure that our sysconfig data file is on the path. We
don't want the rest of our target stdlib on the path, so I made an extra sysconfigdata
folder, copied the sysconfig data into it, and put it on the path.
2022-05-29 18:59:10 -07:00
Hood Chatham 798da1796e
Add loadDynlib to micropip._compat (split off from #2591) (#2639) 2022-05-28 23:06:51 -07:00
Kyle Cutler 7d3c724665
Export PATH and ERRNO_CODES from Emscripten (#2582)
BrowserFS can mount custom filesystems into Emscripten. 
However it requires the PATH and ERRNO_CODES exports from
Emscripten in addition to FS.

This exports `PATH` and `ERRNO_CODES` from `Module` into the `pyodide`
Javascript API so they can be used with BrowserFS.
2022-05-19 11:02:52 -07:00
Gyeongjae Choi ad0064e2c4
BLD Install libraries to centralized directory (#2551) 2022-05-18 13:14:16 +09:00
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