diff --git a/tests/hw/libnux/with_hostcode/wscript b/tests/hw/libnux/with_hostcode/wscript
index 160109b06af29d04a324bfe93644901111e63931..0a29f005de020a93201b6ffe8afe96965bc3281a 100644
--- a/tests/hw/libnux/with_hostcode/wscript
+++ b/tests/hw/libnux/with_hostcode/wscript
@@ -133,33 +133,36 @@ def build_host_python(bld, chip_version: Integral):
 
 
 def build_ppu_cpp(bld, chip_version: Integral):
+    env = bld.all_envs[f"nux_vx_v{chip_version}"].derive()
+    env.detach()
+
     bld.program(name=f"libnux-test-refgen_access_pattern-ppu_vx_v{chip_version}",
                 features="cxx",
                 target=f"refgen_access_pattern-ppu_vx_v{chip_version}.bin",
                 source="vx/refgen_access_pattern-ppu.cpp",
                 use=[f"nux_runtime_vx_v{chip_version}"],
-                env=bld.all_envs[f"nux_vx_v{chip_version}"])
+                env=env)
 
     bld.program(name=f"libnux-test-synram_access_pattern-ppu_vx_v{chip_version}",
                 features="cxx",
                 target=f"synram_access_pattern-ppu_vx_v{chip_version}.bin",
                 source="vx/synram_access_pattern-ppu.cpp",
                 use=[f"nux_runtime_vx_v{chip_version}"],
-                env=bld.all_envs[f"nux_vx_v{chip_version}"])
+                env=env)
 
     bld.program(name=f"libnux-test-correlation_reset_causal-ppu_vx_v{chip_version}",
                 features="cxx",
                 target=f"correlation_reset_causal-ppu_vx_v{chip_version}.bin",
                 source="vx/correlation_reset_causal-ppu.cpp",
                 use=[f"nux_runtime_vx_v{chip_version}"],
-                env=bld.all_envs[f"nux_vx_v{chip_version}"])
+                env=env)
 
     bld.program(name=f"libnux-test-neuron_reset_global-ppu_vx_v{chip_version}",
                 features="cxx",
                 target=f"neuron_reset_global-ppu_vx_v{chip_version}.bin",
                 source="vx/neuron_reset_global-ppu.cpp",
                 use=[f"nux_runtime_vx_v{chip_version}"],
-                env=bld.all_envs[f"nux_vx_v{chip_version}"])
+                env=env)
 
     if chip_version >= 2:
         bld.program(name=f"libnux-test-neuron_reset_vector-ppu_vx_v{chip_version}",
@@ -167,12 +170,12 @@ def build_ppu_cpp(bld, chip_version: Integral):
                     target=f"neuron_reset_vector-ppu_vx_v{chip_version}.bin",
                     source="vx/neuron_reset_vector-ppu.cpp",
                     use=[f"nux_runtime_vx_v{chip_version}"],
-                    env=bld.all_envs[f"nux_vx_v{chip_version}"])
+                    env=env)
 
     bld.program(
         features = 'cxx',
         target = f"barrier_two_ppus_vx_v{chip_version}.bin",
         source = ['vx/barrier_two_ppus.cpp'],
         use = [f"nux_vx_v{chip_version}", f"nux_runtime_vx_v{chip_version}"],
-        env = bld.all_envs[f"nux_vx_v{chip_version}"],
+        env = env,
     )
diff --git a/tests/wscript b/tests/wscript
index c21903ba1364a9868b4757a2a2acb0ec1515dec8..21fd14f5ee781e62d1e913f2f1495c1852b9becd 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -81,7 +81,8 @@ def build(bld):
         )
 
     for chip_version_number in [2, 3]:
-        env = bld.all_envs[f"nux_vx_v{chip_version_number}"]
+        env = bld.all_envs[f"nux_vx_v{chip_version_number}"].derive()
+        env.detach()
 
         program_list = []
         program_list += [f"hw/libnux/vx/{os.path.basename(str(f))}"
@@ -96,7 +97,7 @@ def build(bld):
                 source = [program],
                 use = [f"nux_vx_v{chip_version_number}",
                        f"nux_runtime_vx_v{chip_version_number}"],
-                env = bld.all_envs[f"nux_vx_v{chip_version_number}"],
+                env = env,
             )
 
         def max_size_empty():
diff --git a/wscript b/wscript
index e32907cb9a0b5d4ab3c8ced67706c1241536a6d1..8352116babc8b10f35eafbfa52d52cc19ad37d43 100644
--- a/wscript
+++ b/wscript
@@ -112,7 +112,8 @@ def build(bld):
     if not bld.env.have_ppu_toolchain:
         return
 
-    env = bld.all_envs["nux_vx"]
+    env = bld.all_envs["nux_vx"].derive()
+    env.detach()
 
     bld(
         target = 'nux_inc_host_vx',
@@ -149,7 +150,8 @@ def build(bld):
     )
 
     for chip_version_number in [2, 3]:
-        env = bld.all_envs[f"nux_vx_v{chip_version_number}"]
+        env = bld.all_envs[f"nux_vx_v{chip_version_number}"].derive()
+        env.detach()
 
         bld.install_files(
             dest = '${PREFIX}/',
@@ -226,7 +228,7 @@ def build(bld):
                 source = [program],
                 use = [f"nux_vx_v{chip_version_number}",
                        f"nux_runtime_vx_v{chip_version_number}"],
-                env = bld.all_envs[f"nux_vx_v{chip_version_number}"],
+                env = env,
             )
 
     bld.add_post_fun(summary)