pyodide / pyodide-build

Tool for building packages targeting Pyodide
Mozilla Public License 2.0
5 stars 5 forks source link

[DRAFT] Stop excluding unisolated packages from build dependencies #21

Open ryanking13 opened 3 weeks ago

ryanking13 commented 3 weeks ago

This PR is not ready to be reviewed yet. I am opening a PR for visibility.


This changes how we handle unisolated packages + hostsitepackages directory.

The current mechanism of unisolated packages is as follows:

  1. We have a few number of isolated packages. Numpy and Scipy are the most important ones.
  2. These isolated packages are often used as a build dependency for other packages.
  3. When some packages set these dependencies as build dependencies, we intercept the call of installing the build dependencies and exclude those packages from being installed.
  4. Instead, we pass PYTHONPATH to point to the WASM build of unisolated packages so that these unisolated packages can be used instead of the native packages when building the package.

However, this mechanism introduced a few issues, such as https://github.com/pyodide/pyodide/pull/5012#discussion_r1720979108.

This PR changes it in the following way:

  1. Do not exclude the unisolated packages when installing build dependencies.
  2. Instead, install the packages as is, and only replace the cross build files of the installed package.