summaryrefslogtreecommitdiffstats
path: root/src/cephadm/build.py
diff options
context:
space:
mode:
authorJohn Mulligan <jmulligan@redhat.com>2023-07-14 21:41:54 +0200
committerJohn Mulligan <jmulligan@redhat.com>2023-11-03 18:56:32 +0100
commita375e5d9aa87c0409940388bda382252a81e4936 (patch)
treecb22f35cc2ec3830893a06d8a90041d5e6793162 /src/cephadm/build.py
parentMerge pull request #54077 from adk3798/event-update-timestamp (diff)
downloadceph-a375e5d9aa87c0409940388bda382252a81e4936.tar.xz
ceph-a375e5d9aa87c0409940388bda382252a81e4936.zip
cephadm: disable wheels and C compilers when building cephadm zipapp
We can not rely on any particular python version (py 3.6+ is supported) and can not assume any particular architecture. So using wheels based on the build system is pointless. Installing binary .so files compiled from C/C++ similarly so. Attempt to block the behaviors when adding dependencies to the zipapp. Signed-off-by: John Mulligan <jmulligan@redhat.com>
Diffstat (limited to 'src/cephadm/build.py')
-rwxr-xr-xsrc/cephadm/build.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cephadm/build.py b/src/cephadm/build.py
index 0680abad21a..f5a2ce27479 100755
--- a/src/cephadm/build.py
+++ b/src/cephadm/build.py
@@ -120,6 +120,11 @@ def _install_deps(tempdir):
"""Install dependencies with pip."""
# TODO we could explicitly pass a python version here
log.info("Installing dependencies")
+ # best effort to disable compilers, packages in the zipapp
+ # must be pure python.
+ env = os.environ.copy()
+ env['CC'] = '/bin/false'
+ env['CXX'] = '/bin/false'
# apparently pip doesn't have an API, just a cli.
subprocess.check_call(
[
@@ -127,11 +132,14 @@ def _install_deps(tempdir):
"-m",
"pip",
"install",
+ "--no-binary",
+ ":all:",
"--requirement",
"requirements.txt",
"--target",
tempdir,
- ]
+ ],
+ env=env,
)