]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: disable wheels and C compilers when building cephadm zipapp
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 14 Jul 2023 19:41:54 +0000 (15:41 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 3 Nov 2023 17:56:32 +0000 (13:56 -0400)
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>
src/cephadm/build.py

index 0680abad21a09fc307f97d0444c06d2b984f0a48..f5a2ce27479f8971f03accd039ef243e7d41f660 100755 (executable)
@@ -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,
     )