Skip to content

Commit 4cf47c1

Browse files
BUG: Add fallback for DYLD library path - error arising from MasOS Intel
1 parent 17989b5 commit 4cf47c1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

noxfile.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ def _build_env(session: nox.Session) -> Path:
7777
env = {"CONDA_PREFIX": str(env_dir)}
7878
env.update(_darwin_sdk_env())
7979
if platform.system() == "Darwin":
80-
# Also pass an explicit rpath so delocate-wheel can bundle deps even
81-
# when meson would otherwise embed a @loader_path-relative path.
80+
# Pass an explicit rpath so delocate-wheel can bundle deps even when
81+
# meson would otherwise embed a @loader_path-relative path.
8282
env["LDFLAGS"] = (env.get("LDFLAGS", "") + f" -Wl,-rpath,{lib_dir}").strip()
83+
# conda-forge's ld64_osx-64 linker may be invoked from the micromamba
84+
# pkgs cache path (hard-linked), so @loader_path/../lib/libtapi.dylib
85+
# resolves against the cache dir rather than the installed env. Set a
86+
# fallback so dyld finds libtapi.dylib in the env's lib/ dir instead.
87+
existing = os.environ.get("DYLD_FALLBACK_LIBRARY_PATH", "")
88+
env["DYLD_FALLBACK_LIBRARY_PATH"] = f"{lib_dir}:{existing}".strip(":")
8389
session.env.update(env)
8490

8591

0 commit comments

Comments
 (0)