This completes the out of tree build CLI. This PR is paired up with:
numpy/numpy#21895
I have also successfully built scikit-learn, statsmodels, pandas, and
astropy with this.
The last thing we need to do after this is set up deployment of the
cross build environment. We can deploy one version to s3 for each
tagged commit. I will do that in a separate PR after this is merged.
Symlinking cc to pywasmcross.py only works if pywasmcross.py has
execute permissions. When we install the package with pip, it will not
set execute permissions on pywasmcross.py. It does set execute flags
on entrypoints. Thus, define an entrypoint called _pywasmcross which
calls pywasmcross.main. If a script called _pywasmcross exists, we are
using an out-of-tree install so symlink cc to _pywasmcross. Otherwise,
we should be in tree and pywasmcross.py should have the execute flag
set, so symlink cc to pywasmcross.py.
On the other side, if __main__.__file__ is in a folder named pyodide_build
or bin we are being invoked normally, otherwise we are being invoked via
a symlink.