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
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cp output/gprofiler_x86_64 output/gprofiler # for backwards compatibility, we upload both with arch suffix and without

- name: Upload the executables as job artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: gprofiler_x86_64
path: output/
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
mv build/aarch64/gprofiler output/gprofiler_aarch64

- name: Upload the executables as job artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: gprofiler_aarch64
path: output/
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
run: mkdir -p output && docker image save gprofiler_x86_64 > output/gprofiler_x86_64.img

- name: Upload the image artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: gprofiler_x86_64.img
path: output/
Expand Down
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