Skip to content

Commit e09e582

Browse files
committed
conditional build-isolation
1 parent ef45ded commit e09e582

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

ci/dockerfile_creator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def docker_header(image: str, image_tag: str, geant4_tag: str) -> str:
3232
commands += f"# run bash instead of sh\n"
3333
commands += f"SHELL [\"/bin/bash\", \"-c\"]\n\n"
3434
commands += f"ENV AUTOBUILD=1\n"
35+
if 'almalinux' in image.lower():
36+
commands += f"ENV GEMC_NO_BUILD_ISOLATION=1\n"
3537
return commands
3638

3739

ci/install_python_env.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
venv_python = str(venv_dir / 'bin' / 'python3')
3232
subprocess.run([venv_python, '-m', 'pip', 'install', '--no-cache-dir',
3333
'--upgrade', 'pip', 'setuptools'], check=True)
34-
# --no-build-isolation avoids pip spawning an extra isolated build env, reducing memory pressure.
35-
subprocess.run([venv_python, '-m', 'pip', 'install', '--no-cache-dir',
36-
'--no-build-isolation', pygemc_src], check=True)
34+
35+
pip_args = [venv_python, '-m', 'pip', 'install', '--no-cache-dir']
36+
if os.environ.get('GEMC_NO_BUILD_ISOLATION') == '1':
37+
# Avoids pip spawning an extra isolated build env; reduces memory pressure on
38+
# constrained runners (e.g. AlmaLinux arm64). Requires pip/setuptools pre-installed above.
39+
pip_args.append('--no-build-isolation')
40+
pip_args.append(pygemc_src)
41+
subprocess.run(pip_args, check=True)

0 commit comments

Comments
 (0)