This is some cleanup after #3883.
- Make the `PYODIDE_ROOT` be modified only inside the `init_environment` function.
- Removes `__LOADED_PYODIDE_ENV`. I think it is redundant as we use `PYODIDE_ROOT` for a similar purpose.
On case-insensitive file-systems - eg like MacOS standard Extended file-system (not APFS),
FAT, etc - it is problematic if for files with .F extension the output is written as file with .f
extension, as both actually are referring to the same file.
After the operation of f2c, the original file is restored to its original name.
This PR makes build variables only accessible through the API, instead of polluting os.environ.
I also changed the API as below, as a preparation to move away from makefiles.
- `get_make_environment_vars` => `get_build_environment_vars`
- `get_make_flag` => `get_build_flag`
A few things here aren't needed:
* `"wheel"` is injected via a PEP 517 hook when building wheels for all versions of setuptools that support PEP 517.
* `LICENSE` is already included, no need for a MANIFEST.in. You can compare SDist and Git via `pipx run check-sdist`.
* Recent-ish versions of Pip and Setuptools now support editable installs without setup.py
Fixes#3770. The reason why no logs are being printed when a build fails was quite interesting:
1. There is code that deletes a build log when a build fails (This PR removes it).
2. That code was not working before #3746, since we changed the working directory into srcpath.
3. After #3746, that code started to "work", so the build log gets deleted when a build fails.
I think we definitely don't want to delete the build log. So this PR removes it.
pip can't run inside of Pyodide because it needs to do stuff like make requests
that don't work inside the virtual environment. So the virtual environment bin
folder contains a python-host executable which is a symlink to the
sys.executable that created the virtual environment. The shebang for pip uses
python-host. But then when pip installs an executable it uses sys.executable to
create the shebang for the installed executable. If that is python-host then the
installed executable will run outside of Pyodide. So we need to patch
`sys.executable` to point to the Pyodide Python.
This switches to passing the source and build directories as arguments.
It adds an output-directory argument to pyodide build allowing us to
indicate where the output wheel should go independent of the build
directory. I also did some cleanup of the logic added in #3310
I'm running into a crash in cibuildwheel where some of its CI environments don't set HOME. This fixes set_build_environment to be a bit more resistant against crashes due to missing environment variables.