Skip to content

Commit

Permalink
use @loader_path on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
EmersonDove committed Mar 11, 2024
1 parent ebc24ff commit b1eb14c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cx_Freeze/darwintools.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def getBuildPath(self) -> Path | None:

@staticmethod
def isExecutablePath(path: str) -> bool:
return path.startswith("@executable_path")
return path.startswith("@loader_path")

@staticmethod
def isLoaderPath(path: str) -> bool:
Expand Down Expand Up @@ -246,9 +246,7 @@ def resolveExecutable(self, path: str) -> Path:
# interpreter? Apparently not a big issue in practice, since the
# code has been like this forever.
if self.isExecutablePath(path):
return self.path.parent / Path(path).relative_to(
"@executable_path/"
)
return self.path.parent / Path(path).relative_to("@loader_path/")
raise PlatformError(f"resolveExecutable() called on bad path: {path}")

def resolveRPath(self, path: str) -> Path | None:
Expand Down Expand Up @@ -711,7 +709,7 @@ def set_relative_reference_paths(self, build_dir: str, bin_dir: str):
# this is where file copied in build dir
abs_build_dest = ref_target_file.getBuildPath()
rel_build_dest = os.path.relpath(abs_build_dest, build_dir)
exe_path = f"@executable_path/{rel_build_dest}"
exe_path = f"@loader_path/{rel_build_dest}"
change_load_reference(
file_path_in_bin_dir, raw_path, exe_path, verbose=False
)
Expand Down

0 comments on commit b1eb14c

Please sign in to comment.