The five pinned CPython images have no C compiler in them. command -v cc gcc clang finds nothing on any of them, and sysconfig.get_config_var("CC") reports gcc, which is not there, so anything that shells out to the compiler dies with FileNotFoundError: 'gcc'.
I ran into this writing C07. The lesson is about the GIL coming back on at run time, and the sharpest demonstration of that is a two line extension module with no Py_mod_gil slot: import it on a free threaded build and sys._is_gil_enabled() flips from False to True, with a warning naming the module. It works on a local free threaded build in about a second. It cannot be a Tier 1 recording, because the image cannot compile the two lines.
The workaround for C07 was to point the recordings at something else and keep the extension build as an ordinary notebook cell that skips itself when there is no compiler. That is fine for one lesson, but it will keep coming up. Anything about the C API tiers, the stable ABI, abi3t, module slots or Py_mod_multiple_interpreters wants to compile something small and watch what the runtime does with it, and R01 through R09 on the M8 list are full of that.
Two possible fixes.
The small one is to install gcc and python3-dev equivalents into the images. They are Debian trixie, so it is one apt-get install line in the Dockerfile. It costs image size and pull time on every recording, which is the thing to weigh.
The larger one is a sixth image, built from the same CPython but with a toolchain on top, and a build="toolchain" value that experiments can ask for when they need one. That keeps the five existing images small and makes the requirement explicit in the experiment definition, which fits how needs already works.
I lean towards the second, but it touches cpybuild, the digest table in tier1.run.image_for and the publish workflow, so it is worth deciding before doing.
Also worth noting while this is open: _testmultiphase is not in the images either, and it is the module CPython's own test suite uses to import a module that declares Py_MOD_GIL_USED without compiling anything. If the images shipped the test extension modules, that would solve the C07 case on its own without a compiler. That may be the cheapest fix of the three.
The five pinned CPython images have no C compiler in them.
command -v cc gcc clangfinds nothing on any of them, andsysconfig.get_config_var("CC")reportsgcc, which is not there, so anything that shells out to the compiler dies withFileNotFoundError: 'gcc'.I ran into this writing C07. The lesson is about the GIL coming back on at run time, and the sharpest demonstration of that is a two line extension module with no
Py_mod_gilslot: import it on a free threaded build andsys._is_gil_enabled()flips from False to True, with a warning naming the module. It works on a local free threaded build in about a second. It cannot be a Tier 1 recording, because the image cannot compile the two lines.The workaround for C07 was to point the recordings at something else and keep the extension build as an ordinary notebook cell that skips itself when there is no compiler. That is fine for one lesson, but it will keep coming up. Anything about the C API tiers, the stable ABI,
abi3t, module slots orPy_mod_multiple_interpreterswants to compile something small and watch what the runtime does with it, and R01 through R09 on the M8 list are full of that.Two possible fixes.
The small one is to install
gccandpython3-devequivalents into the images. They are Debian trixie, so it is oneapt-get installline in the Dockerfile. It costs image size and pull time on every recording, which is the thing to weigh.The larger one is a sixth image, built from the same CPython but with a toolchain on top, and a
build="toolchain"value that experiments can ask for when they need one. That keeps the five existing images small and makes the requirement explicit in the experiment definition, which fits howneedsalready works.I lean towards the second, but it touches
cpybuild, the digest table intier1.run.image_forand the publish workflow, so it is worth deciding before doing.Also worth noting while this is open:
_testmultiphaseis not in the images either, and it is the module CPython's own test suite uses to import a module that declaresPy_MOD_GIL_USEDwithout compiling anything. If the images shipped the test extension modules, that would solve the C07 case on its own without a compiler. That may be the cheapest fix of the three.