Cross-Compiling Environment¶
This section documents the changes to the Python environment beyond just making
cross-python
behave like host-python
.
Environment variables¶
Crossenv sets PYTHON_CROSSENV
to a non-empty value.
The sys
module¶
-
sys.
cross_compiling
¶ Set to
True
incross-python
. May be used like so:if getattr(sys, 'cross_compiling', False): ...
-
sys.
build_path
¶ Analagous to
sys.path
, but applies when importing packages frombuild-python
. This path is searched just before the entries onsys.path
that point to the Python standard library. This means thatsys.build_path
is preferred when loading modules from the standard library, but prepending tosys.path
still works as expected.
The os
module¶
-
os.
uname
()¶ In addition to returning
host-python
’s information, it always reports thenode
as “build
”.
The platform
module¶
-
platform.
uname
()¶ In addition to returning
host-python
’s information, it always reports thenode
as “build
”.