Commit Graph

105 Commits

Author SHA1 Message Date
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