Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the library path in sysroot-crates-are-unstable #89033

Merged
merged 1 commit into from
Sep 17, 2021
Merged
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
13 changes: 13 additions & 0 deletions src/test/run-make-fulldeps/sysroot-crates-are-unstable/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ def convert_to_string(s):
return s


def set_ld_lib_path():
var = os.environ.get("LD_LIB_PATH_ENVVAR")
rpath = os.environ.get("HOST_RPATH_DIR")
if var and rpath:
path = os.environ.get(var)
if path:
os.environ[var] = rpath + os.pathsep + path
else:
os.environ[var] = rpath


def exec_command(command, to_input=None):
child = None
if to_input is None:
Expand Down Expand Up @@ -50,7 +61,9 @@ def get_all_libs(dir_path):
if isfile(join(dir_path, f)) and f.endswith('.rlib') and f not in STABLE_CRATES]


set_ld_lib_path()
sysroot = exec_command([os.environ['RUSTC'], '--print', 'sysroot'])[0].replace('\n', '')
assert sysroot, "Could not read the rustc sysroot!"
libs = get_all_libs(join(sysroot, 'lib/rustlib/{}/lib'.format(os.environ['TARGET'])))

ret = 0
Expand Down