Skip to content

Commit 2ad3598

Browse files
authored
[AMDGPU] Change CWD from within tmp directory (#403)
As pointed out in #402 the former solution deleted the CWD from within that directory, rendering the state quite useless and resulting in errors on execution. The approach in here creates a temp directory, changes to it, removes the old CWD, recreates it, and changes back to that directory. I opted for this solution as, oddly enough, I had some trouble removing the enumerated list of files in the buildtree.
1 parent 872f477 commit 2ad3598

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ def main(argv):
1919
# If we do not do this, the resident config will take precedence and changes
2020
# to the cache file are ignored.
2121
cwd = os.getcwd()
22+
tdir = tempfile.mkdtemp()
23+
os.chdir(tdir)
2224
util.clean_dir(cwd)
25+
os.chdir(cwd)
26+
util.rmtree(tdir)
2327

2428
with step("cmake", halt_on_fail=True):
2529
# TODO make the name of the cache file an argument to the script.

0 commit comments

Comments
 (0)