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

bugfix: start_process ensuring passing of TMPDIR when needed #922

Merged
merged 6 commits into from
Sep 23, 2024
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
7 changes: 5 additions & 2 deletions gprofiler/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ def start_process(
# see https://github.com/JonathonReinhart/staticx#run-time-information
cmd = [f"{staticx_dir}/.staticx.interp", "--library-path", staticx_dir] + cmd
else:
# explicitly remove our directory from LD_LIBRARY_PATH
env = env if env is not None else os.environ.copy()
roi-granulate marked this conversation as resolved.
Show resolved Hide resolved
env.update({"LD_LIBRARY_PATH": ""})
# ensure `TMPDIR` env is propagated to the child processes (used by staticx)
if "TMPDIR" not in env and "TMPDIR" in os.environ:
env["TMPDIR"] = os.environ["TMPDIR"]
# explicitly remove our directory from LD_LIBRARY_PATH
env["LD_LIBRARY_PATH"] = ""

if is_windows():
cur_preexec_fn = None # preexec_fn is not supported on Windows platforms. subprocess.py reports this.
Expand Down
Loading