diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b5d1c93e..d71838d8a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -258,10 +258,9 @@ jobs: # The hot patch test requires incremental compilation CARGO_INCREMENTAL: 1 run: | - export PATH=$PATH:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin npm ci npm install -D @playwright/test - npx playwright install --with-deps + npx playwright install npx playwright test - uses: actions/upload-artifact@v4 if: always() diff --git a/packages/cli/src/build/request.rs b/packages/cli/src/build/request.rs index a6fe2e574..178dc26f4 100644 --- a/packages/cli/src/build/request.rs +++ b/packages/cli/src/build/request.rs @@ -1715,6 +1715,17 @@ impl BuildRequest { out_args = vec![format!("@{}", self.windows_command_file().display()).into()]; } + // Add more search paths for the linker + let mut command_envs = rustc_args.envs.clone(); + + // On linux, we need to set a more complete PATH for the linker to find its libraries + if cfg!(target_os = "linux") { + command_envs.push(( + "PATH".to_string(), + "/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin".to_string(), + )); + } + // Run the linker directly! // // We dump its output directly into the patch exe location which is different than how rustc @@ -1722,7 +1733,7 @@ impl BuildRequest { let res = Command::new(linker) .args(out_args) .env_clear() - .envs(rustc_args.envs.iter().map(|(k, v)| (k, v))) + .envs(command_envs) .output() .await?; @@ -2235,11 +2246,22 @@ impl BuildRequest { out_args = vec![format!("@{}", self.windows_command_file().display())]; } + // Add more search paths for the linker + let mut command_envs = rustc_args.envs.clone(); + + // On linux, we need to set a more complete PATH for the linker to find its libraries + if cfg!(target_os = "linux") { + command_envs.push(( + "PATH".to_string(), + "/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin".to_string(), + )); + } + // Run the linker directly! let res = Command::new(linker) .args(out_args) .env_clear() - .envs(rustc_args.envs.iter().map(|(k, v)| (k, v))) + .envs(command_envs) .output() .await?;