mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 19:27:10 +00:00
Make build-all a bit friendlier for python partial install success
This commit is contained in:
+20
-8
@@ -258,7 +258,7 @@ def run(cmds, cwd=None):
|
|||||||
print("-" * 70)
|
print("-" * 70)
|
||||||
print(stderr)
|
print(stderr)
|
||||||
print("-" * 70)
|
print("-" * 70)
|
||||||
raise Exception(f"Command `{' '.join(cmds)}` returned exit code {proc.returncode}")
|
raise RuntimeError(f"Command `{' '.join(cmds)}` returned exit code {proc.returncode}")
|
||||||
|
|
||||||
return stdout.strip()
|
return stdout.strip()
|
||||||
|
|
||||||
@@ -579,13 +579,25 @@ if "python" in targets and not USE_CURRENT_PYTHON_VERSION:
|
|||||||
PYTHON_CONFIGURE_ARGS = ["--disable-static", "--enable-shared"]
|
PYTHON_CONFIGURE_ARGS = ["--disable-static", "--enable-shared"]
|
||||||
|
|
||||||
for PYTHON_VERSION in PYTHON_VERSIONS:
|
for PYTHON_VERSION in PYTHON_VERSIONS:
|
||||||
build_dependency(
|
try:
|
||||||
f"python-{PYTHON_VERSION}",
|
build_dependency(
|
||||||
"autoconf",
|
f"python-{PYTHON_VERSION}",
|
||||||
PYTHON_CONFIGURE_ARGS,
|
"autoconf",
|
||||||
f"http://www.python.org/ftp/python/{PYTHON_VERSION}/",
|
PYTHON_CONFIGURE_ARGS,
|
||||||
f"Python-{PYTHON_VERSION}.tgz"
|
f"http://www.python.org/ftp/python/{PYTHON_VERSION}/",
|
||||||
)
|
f"Python-{PYTHON_VERSION}.tgz"
|
||||||
|
)
|
||||||
|
except RuntimeError as e:
|
||||||
|
# Sometimes setting up modules such as pip/lzma can cause
|
||||||
|
# the python installer script to return a non zero exit
|
||||||
|
# code where actually the headers and dynamic libraries
|
||||||
|
# are installed correctly. This is all we need so we catch
|
||||||
|
# the exception and only reraise if a partially succesful
|
||||||
|
# install is not detected.
|
||||||
|
if not os.path.exists(
|
||||||
|
os.path.join(DEPS_DIR, "install", f"python-{PYTHON_VERSION}")
|
||||||
|
):
|
||||||
|
raise e
|
||||||
|
|
||||||
os.environ["CXXFLAGS"] = OLD_CXX_FLAGS
|
os.environ["CXXFLAGS"] = OLD_CXX_FLAGS
|
||||||
os.environ["CFLAGS"] = OLD_C_FLAGS
|
os.environ["CFLAGS"] = OLD_C_FLAGS
|
||||||
|
|||||||
Reference in New Issue
Block a user