Skip to content

Commit 84a35b3

Browse files
committed
create bin in view path if none exists, before creating compiler links
1 parent 6c277d2 commit 84a35b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stackinator/etc/envvars.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ def view_impl(args):
440440
print(f"error - activation script {activate_path} does not exist")
441441
exit(1)
442442

443+
bin_path = os.path.join(root_path, "bin")
444+
# ensure that the bin path exists
445+
if not os.path.exists(bin_path):
446+
os.makedirs(bin_path)
447+
443448
envvars = read_activation_script(activate_path)
444449

445450
# force all prefix path style variables (list vars) to use PREPEND the first operation.
@@ -458,7 +463,7 @@ def view_impl(args):
458463

459464
for c in compilers:
460465
source_paths = list(set([os.path.abspath(v) for _, v in c["paths"].items() if v is not None]))
461-
target_paths = [os.path.join(os.path.join(root_path, "bin"), os.path.basename(f)) for f in source_paths]
466+
target_paths = [os.path.join(bin_path, os.path.basename(f)) for f in source_paths]
462467
for src, dst in zip(source_paths, target_paths):
463468
print(f"creating compiler symlink: {src} -> {dst}")
464469
if os.path.exists(dst):

0 commit comments

Comments
 (0)