Commit Graph

134 Commits

Author SHA1 Message Date
Joe Marshall f696930e63
added tzdata package (#4697)
For zoneinfo to work, we need the tzdata package. This PR does that.
2024-04-17 17:41:49 +02:00
Hood Chatham 07a06070e0
Make sysconfigdata relocatable (#4573)
This replaces PYODIDE_ROOT with a variable in all places in the
sysconfigdata. It fixes out of tree numpy build.
2024-02-27 22:12:23 -08:00
Hood Chatham d2c0b5b1f6
Fix linking of libhacl and tidy up cpython makefile (#4482) 2024-02-08 20:17:00 +09:00
Hood Chatham 2a8fae8656
Use `ModuleNotFoundError.add_note` to add cause info to exceptions (#4484)
And remove the importlib patch.
2024-02-07 15:10:36 -08:00
Hood Chatham fb31fff09a
Upgrade to Python 3.12.1 (#4435) 2024-02-03 19:25:45 -08:00
Hood Chatham 1a9c0d3da0
Maintainers docs on releases, docker images, python updates (#4470) 2024-02-03 15:26:00 -08:00
Hood Chatham 7a7696bc0f
MAINT sysconfigdata updates split from #4435 (#4467) 2024-02-03 10:24:09 +09:00
Hood Chatham 16db2158ff
Update docker image to bookworm (#4431)
Buster isn't available for anymore for Python 312 so we have to update.

This also updates to Python 3.11.7, which turns out to be relatively invasive. I broadly
xfailed failing tests in `python_tests.yaml` since we'll upgrade to Python 3.12 soon anyways.
2024-01-30 08:19:53 -08:00
Hood Chatham d6ccedfa29
MAINT python build improvements for 3.12 (#4432)
* use PYMAJOR and PYMINOR variables in --with-build-python option
* reorder sysconfigdata creation
2024-01-27 15:14:54 -08:00
Gyeongjae Choi a14d34fb1b
Emscripten 3.1.52 (#4399)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-23 21:18:42 +09:00
Hood Chatham d44293f3c3
Update JSPI code to handle change in type reflection spec (#4384)
Resolves #4378. Tested manually.
2024-01-16 16:37:48 -08:00
Hood Chatham d97eaa586a Use branch in macro to choose trampoline (#3990)
One of the cpython tests (test_plistlib.TestBinaryPlistlib.test_deep_nesting)
seems to be extremely sensitive to stack utilization and stack overflows in our
CI when even a tiny amount of extra stack is used. I doubt this is a problem in
real life -- I certainly cannot reproduce it outside of the CI service. But this
rearranges the code to avoid any additional stack usage so that CI will pass.
2023-10-21 09:20:09 -07:00
Hood Chatham c931b06ab6 Patch CPython to use a type reflection trampoline if possible (#3964) 2023-10-21 09:20:09 -07:00
Hood Chatham b460383505
Use hoodmane/hiwire library instead of our own implementation (#4128)
This change switches to my external implementation of hiwire. This is the
minimal change set to do this, it uses some hacks to avoid changing any files
outside of `hiwire.{c,h,js}`. In followups, I will gradually switch to using
the new APIs rather than compatibility shims.
2023-09-23 18:21:19 -07:00
Hood Chatham a24d69e953
MAINT use the correct version of Python in the cpython makefile (#4168) 2023-09-23 14:40:22 -07:00
Hood Chatham b57beb1e36
MAINT Add a rebuild makefile rule for Python [skip ci] (#4166) 2023-09-22 11:55:38 -07:00
Hood Chatham f28d8c9efc Revert JSPI Changes
This reverts commits:
9ed5e839ff
8861b317a6
b2c47ae766
ab8dc2eac6
3bcc527c92
2505d4d6a3
2023-09-14 07:26:46 -07:00
Hood Chatham ab8dc2eac6 Use branch in macro to choose trampoline (#3990)
One of the cpython tests (test_plistlib.TestBinaryPlistlib.test_deep_nesting)
seems to be extremely sensitive to stack utilization and stack overflows in our
CI when even a tiny amount of extra stack is used. I doubt this is a problem in
real life -- I certainly cannot reproduce it outside of the CI service. But this
rearranges the code to avoid any additional stack usage so that CI will pass.
2023-09-13 16:25:24 -07:00
Hood Chatham 8861b317a6 Patch CPython to use a type reflection trampoline if possible (#3964) 2023-09-13 16:25:24 -07:00
Hood Chatham b67660ff9d
BLD Add CPYTHON_DEBUG environment variable to request a debug Python (#3966) 2023-06-28 17:01:15 -07:00
Hood Chatham 71cc8bc925 Revert "MAINT Use sigstore to validate Python source signature (#3916)"
This reverts commit 59bb655957.
2023-06-12 15:16:55 -07:00
Hood Chatham 59bb655957
MAINT Use sigstore to validate Python source signature (#3916)
This should make Python updates a little easier and more secure.

See: python.org/download/sigstore
2023-06-12 12:28:44 -07:00
Gyeongjae Choi 73c497bfbe
Remove in-tree dependency when building unvendored python modules (#3864) 2023-06-05 19:48:48 +09:00
Christian Clauss b2201c19b1
Upgrade to Python v3.11.3 (#3741) 2023-04-12 17:38:05 +02:00
Hood Chatham 32ccad8f6e
Use upstream libffi (#3629) 2023-04-01 17:32:38 -07:00
Christian Clauss 154fbed9fa
Upgrade to Python v3.11.2 (#3614) 2023-03-01 23:57:17 +01:00
Gyeongjae Choi ed3ae1ba49
Download standard libraries in a zipfile (#3582) 2023-03-01 23:11:30 +01:00
Gyeongjae Choi 9e1e575dfe
Deepfreeze essential parts of the encodings module (#3585) 2023-02-22 18:40:05 +09:00
Gyeongjae Choi dcdc1e6941
Unvendor pydoc_data and _pydecimal (#3525)
Removes / unvendors some python modules:

- Remove `_aix_support.py`, which is for supporting IBM AIX OS.

- Unvendor `_pydecimal.py`.
  - _pydecimal is a pure Python implementation of `decimal` module. [Importing `decimal` fallbacks](https://github.com/python/cpython/blob/main/Lib/decimal.py) to `_pydecimal` if the C-implementation `_decimal` is not available. In our case, _decimal is available, so _pydecimal will not be normally used. 

- Unvendor `pydoc_data`.
  - pydoc_data contains [a large (~700KB) dictionary](https://github.com/python/cpython/blob/main/Lib/pydoc_data/topics.py) for explaining python builtins. This is mostly used when `help("...")` is called.
2023-02-01 11:00:17 +09:00
Gyeongjae Choi f50c749c9a
Apply upstream cpython commits to relocate test directories (#3507) 2023-01-30 13:34:33 +09:00
Hood Chatham 3b2952fc92
Python3.11 (#3252) 2023-01-23 19:45:59 -08:00
Hood Chatham 68b3f3d067
Fix top level multiprocessing.connection import and update yt (#3371)
This updates yt. The new yt has a top level `multiprocessing.connection` import so we patch
that so that it can be imported without raising an error.
2022-12-19 16:56:31 -08:00
Gyeongjae Choi cb29aca290
Patch ctypes.util.find_library to support Emscripten platform (#3353) 2022-12-18 11:20:00 +01:00
Hood Chatham 33d1794a6e
Use a more robust method to improve our ModuleNotFound errors (#3263)
@ryanking13 added these very nice error messages to the `ModuleNotFound`
errors. However they introduce a few problems:
1. `find_spec` is supposed to return `None` or a spec and not to raise an error.
If it raises errors, it can cause trouble in code that tries to check if a module is
installed or not.
2. Other code that tries to add new import hooks has to know to insert them
before these error-raising import hooks.

See the discussion in #3262.

This instead patches `importlib._bootstrap` to create a function called
`_get_module_not_found_error`. We then can monkey patch this to modify
the error messages that `importlib` raises.

See Python issue: https://github.com/python/cpython/issues/100208
2022-12-12 18:35:51 -08:00
Hood Chatham 1335d7ee64
Add argument handling and _run_main function (#3021)
The command line runner in #2976 finally works, but it is a large change set so
I am planning to split it up. This is the first PR split off from there.

This PR adds a patch to Python to expose pymain_run_python. We cannot use the
public API Py_RunMain for this purpose because it finalizes the Python
interpreter with Py_FinalizeEx when it is done. If we start an async task with
Py_RunMain then it will segfault. pymain_run_python does a large amount of work
and reproducing it is undesirable.

I added an args parameter which accepts command line arguments. The private
entry point pyodide._main._run_main() executes the main Python entrypoint
without shutting down the interpreter and returns the return code.
2022-08-30 08:49:06 -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
Gyeongjae Choi a72ce423b4
BLD Use emscripten ports of bzip and zlib when building cpython (#2912) 2022-07-28 10:17:58 +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 55a53df4a5
Update libffi tag (#2772)
Since the Emscripten update, libffi can support closures with up to 1000 arguments.
2022-06-23 12:05:40 -07:00
Hood Chatham 060f1f4ba6
MAINT Use the patched version of setuptools-rust (#2735) 2022-06-20 09:28:19 +09: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 8a8629f2c6
MAINT Switch to using a tag to version libffi port (#2673) 2022-06-08 21:37:24 +02: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
Ryan May 91fd7dbe89
Fix building CPython on macos (Fixes #2360) (#2554)
Updates the Makefile to avoid separating the source command from the build.
2022-05-12 15:50:01 -07:00
stonebig be59fae4f4
upgrade to SQLIte-3.38.5 (#2518) 2022-05-08 09:56:59 +09:00
echorand (Amit Saha) 213288f200
ENH Update sqlite (#2477) 2022-05-04 14:18:07 -06:00
Hood Chatham f04ba9d56a
Add bitarray (#2459) 2022-05-04 09:50:44 -06:00