From 407b8d6b19d5b1d3a64d71ccac8289aee8b235f5 Mon Sep 17 00:00:00 2001 From: Roi Agai Date: Wed, 11 Sep 2024 09:55:28 +0300 Subject: [PATCH 1/5] ensuring propogation of TMPDIR if needed --- gprofiler/utils/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gprofiler/utils/__init__.py b/gprofiler/utils/__init__.py index 2fad553bd..04d83387d 100644 --- a/gprofiler/utils/__init__.py +++ b/gprofiler/utils/__init__.py @@ -148,7 +148,9 @@ def start_process( else: # explicitly remove our directory from LD_LIBRARY_PATH env = env if env is not None else os.environ.copy() - env.update({"LD_LIBRARY_PATH": ""}) + if "TMPDIR" not in env and "TMPDIR" in os.environ: + env["TMPDIR"] = os.environ.get("TMPDIR") + env["LD_LIBRARY_PATH"] = "" if is_windows(): cur_preexec_fn = None # preexec_fn is not supported on Windows platforms. subprocess.py reports this. From a3c1d989a773447164630c74c6ce237edecff179 Mon Sep 17 00:00:00 2001 From: Roi Agai Date: Sun, 22 Sep 2024 14:29:11 +0300 Subject: [PATCH 2/5] CR: remove .get approach --- gprofiler/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gprofiler/utils/__init__.py b/gprofiler/utils/__init__.py index 04d83387d..fb7b343ab 100644 --- a/gprofiler/utils/__init__.py +++ b/gprofiler/utils/__init__.py @@ -149,7 +149,7 @@ def start_process( # explicitly remove our directory from LD_LIBRARY_PATH env = env if env is not None else os.environ.copy() if "TMPDIR" not in env and "TMPDIR" in os.environ: - env["TMPDIR"] = os.environ.get("TMPDIR") + env["TMPDIR"] = os.environ["TMPDIR"] env["LD_LIBRARY_PATH"] = "" if is_windows(): From dea43d8da5eb6070f201160f081f47c8d6114b38 Mon Sep 17 00:00:00 2001 From: Roi Agai Date: Sun, 22 Sep 2024 14:46:36 +0300 Subject: [PATCH 3/5] CR: adding TMPDIR propagation to child processes comment --- gprofiler/utils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gprofiler/utils/__init__.py b/gprofiler/utils/__init__.py index fb7b343ab..e93483c6b 100644 --- a/gprofiler/utils/__init__.py +++ b/gprofiler/utils/__init__.py @@ -146,10 +146,11 @@ 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() + # 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(): From 09d7a72ac364158686528f8c501051bf663f3c62 Mon Sep 17 00:00:00 2001 From: Roi Agai Date: Sun, 22 Sep 2024 14:53:50 +0300 Subject: [PATCH 4/5] actions/upload-artifact@v3(?) --- .github/workflows/build-test-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index 72aed2354..97e346844 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -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/ @@ -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/ @@ -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/ From 7595a51e29f4258c7fda12f310ae70d189782e02 Mon Sep 17 00:00:00 2001 From: Roi Agai Date: Mon, 23 Sep 2024 08:50:38 +0300 Subject: [PATCH 5/5] Revert "actions/upload-artifact@v3(?)" This reverts commit 09d7a72ac364158686528f8c501051bf663f3c62. --- .github/workflows/build-test-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index 97e346844..72aed2354 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -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@v3 + uses: actions/upload-artifact@v2 with: name: gprofiler_x86_64 path: output/ @@ -130,7 +130,7 @@ jobs: mv build/aarch64/gprofiler output/gprofiler_aarch64 - name: Upload the executables as job artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v2 with: name: gprofiler_aarch64 path: output/ @@ -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@v3 + uses: actions/upload-artifact@v2 with: name: gprofiler_x86_64.img path: output/