Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions relenv/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ def wrapper(
if relocate().is_elf(file):
debug(f"Relenv - Found elf {file}")
relocate().handle_elf(plat / file, rootdir / "lib", True, rootdir)
elif relocate().is_macho(file):
otool_bin = shutil.which("otool")
if otool_bin:
relocate().handle_macho(str(plat / file), str(rootdir), True)
else:
debug(
"The otool command is not available, please run `xcode-select --install`"
)

return wrapper

Expand Down
43 changes: 42 additions & 1 deletion tests/test_verify_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,44 @@ def find_library(path, search):
assert valid, p.stdout.decode()


@pytest.mark.skip_unless_on_darwin
@pytest.mark.parametrize("cryptography_version", ["42.0.5", "40.0.1"])
def test_cryptography_rpath_darwin(pipexec, build, minor_version, cryptography_version):
# def find_library(path, search):
# for root, dirs, files in os.walk(path):
# for fname in files:
# if fname.startswith(search) and fname.endswith(".so"):
# return fname

env = os.environ.copy()
env["RELENV_BUILDENV"] = "yes"
env["OPENSSL_DIR"] = f"{build}"

if minor_version == "3.13":
env["PYO3_USE_ABI3_FORWARD_COMPATIBILITY"] = "1"

p = subprocess.run(
[
str(pipexec),
"install",
f"cryptography=={cryptography_version}",
"--no-cache-dir",
"--no-binary=cryptography",
],
env=env,
)
assert p.returncode != 1, "Failed to pip install cryptography"
p = subprocess.run(
[
"otool",
"-L",
f"{build}/lib/python{minor_version}/site-packages/cryptography/hazmat/bindings/_rust.abi3.so",
],
capture_output=True,
)
assert "/usr/local" not in p.stdout.decode(), p.stdout.decode()


@pytest.mark.skip_unless_on_linux
def test_install_pycurl(pipexec, build):
_install_ppbt(pipexec)
Expand Down Expand Up @@ -1423,9 +1461,12 @@ def test_install_with_target_namespaces(pipexec, build, minor_version, build_ver


@pytest.mark.skip_unless_on_linux
def test_debugpy(pipexec, build, minor_version):
def test_debugpy(pipexec, build, arch, minor_version):
if "3.13" in minor_version:
pytest.xfail("Failes on python 3.13.0")
if arch == "arm64":
pytest.xfail("Failes on arm64")

p = subprocess.run(
[
str(pipexec),
Expand Down