Skip to content

Commit fff45bc

Browse files
committed
revert back for cwd
1 parent 023d1b9 commit fff45bc

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

cime_config/buildlib

+1-8
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,9 @@ def _build_musica(clone_dest: str) -> str:
291291
except OSError as e:
292292
raise OSError("An error occurred while executing the 'cmake' command.") from e
293293

294-
# The installation requires the current working directory to be the build (CMake binary) directory.
295-
# Using the cwd option in subprocess.run does not work.
296-
current_dir = os.getcwd()
297-
os.chdir(bld_path)
298-
299294
command = ["cmake", "--build", ".", "--target", "install"]
300295
try:
301-
subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
296+
subprocess.run(command, cwd=bld_path, stdout=subprocess.PIPE,
302297
text=True, check=False)
303298
except subprocess.CalledProcessError as e:
304299
raise subprocess.CalledProcessError(e.returncode, e.cmd, "The subprocess \
@@ -308,8 +303,6 @@ def _build_musica(clone_dest: str) -> str:
308303
except OSError as e:
309304
raise OSError("An error occurred while executing the 'cmake' command.") from e
310305

311-
os.chdir(current_dir)
312-
313306
musica_install_path = os.path.join(bld_path, install_dir)
314307

315308
return musica_install_path

0 commit comments

Comments
 (0)