[cli] Update lib linking for darwin only case

pull/15/head
Daniel Van Der Maden 4 years ago
parent e10ea06c82
commit f92259b68b
  1. 23
      pyhmy/cli.py

@ -368,15 +368,16 @@ def download(path="./bin/hmy", replace=True, verbose=True):
os.chdir(old_cwd) os.chdir(old_cwd)
env = os.environ.copy() env = os.environ.copy()
files_in_parent_dir = set(os.listdir(parent_dir)) if sys.platform.startswith("darwin"): # Dynamic linking for darwin
if files_in_parent_dir.intersection(_libs) == _libs: try:
if sys.platform.startswith("linux"): files_in_parent_dir = set(os.listdir(parent_dir))
env["LD_LIBRARY_PATH"] = parent_dir if files_in_parent_dir.intersection(_libs) == _libs:
else: env["DYLD_FALLBACK_LIBRARY_PATH"] = parent_dir
env["DYLD_FALLBACK_LIBRARY_PATH"] = parent_dir elif os.path.exists(f"{get_gopath()}/src/github.com/harmony-one/bls") \
elif os.path.exists(f"{get_gopath()}/src/github.com/harmony-one/bls") \ and os.path.exists(f"{get_gopath()}/src/github.com/harmony-one/mcl"):
and os.path.exists(f"{get_gopath()}/src/github.com/harmony-one/mcl"): env.update(get_bls_build_variables())
env.update(get_bls_build_variables()) else:
else: raise RuntimeWarning(f"Could not get environment for downloaded hmy CLI at `{path}`")
raise RuntimeWarning(f"Could not get environment for downloaded hmy CLI at `{path}`") except Exception as e:
raise RuntimeWarning(f"Could not get environment for downloaded hmy CLI at `{path}`") from e
return env return env

Loading…
Cancel
Save