@@ -43,14 +43,12 @@ provided we don't need them.
4343At the end of the CPython build, it will print out a list of which modules have
4444been successfully built and which have failed.
4545
46- ## Cross-compiling modules
46+ ## Cross-compilation set-up
4747
4848Setuptools and distutils both interrogate the Python system environment during
4949the build process. This makes it quite difficult to cross-compile libraries, so
5050we use [ crossenv] ( https://github.com/benfogle/crossenv ) .
5151
52- ### Crossenv set-up
53-
5452To set up crossenv for the first time:
5553
5654```
@@ -63,9 +61,26 @@ You can then activate with:
6361. cross_venv/bin/activate
6462```
6563
66- ### Building modules
64+ From inside the virtual environment, you can inspect the set-up with:
65+
66+ ```
67+ python sanity_check.py | less
68+ ```
69+
70+ ### Changing the crossenv environment
71+
72+ Note that crossenv picks up the cross-compilation environment from the CPython
73+ build. Therefore, to make changes:
74+
75+ - Modify the CPython build (see ` tasks.py ` )
76+ - Rerun the CPython build (` inv cpython.py --clean ` )
77+ - Rebuild the crossenv (` ./crossenv_setup.sh ` )
78+ - Enter the crossenv and inspect the environment with ` sanity_check.py `
6779
68- With the crossenv activated, we can build modules with normal ` pip ` :
80+ ## Modules
81+
82+ With the crossenv activated, we can build modules with normal ` pip ` ,
83+ e.g.
6984
7085```
7186cd third-party/numpy
@@ -78,24 +93,11 @@ To get the pip logs add the `--log` argument.
7893pip install . --log /tmp/pip.log
7994```
8095
81- ### Crossenv environment issues
82-
83- Note that crossenv should pick up _ most_ of the required cross-compilation
84- environment from the CPython build artifacts. The bits that it doesn't pick up
85- will be set in ` crossenv.sh ` , so check _ both_ when debugging issues.
86-
87- The config seen by crossenv will be echoed in
88- ` cross_venv/lib/_sysconfigdata_wasi_.py ` .
89-
90- Because crossenv picks up its info from the CPython build, any changes, to the
91- cross-compile environment must be replicated in the CPython build.
92-
93- ### Runtime files
96+ ## Runtime files
9497
9598CPython needs to access certain files at runtime. These can be put in place with
9699the following:
97100
98101```
99102inv runtime
100103```
101-
0 commit comments