fix collect2 ld error with hotpatching (#4771)

* get repro case

* disable --with-deps for playwright

* extend hotpatch with better path
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-11 20:33:10 -07:00
1 parent 16bbabb3e3
commit 01db142750
2 files changed
+25 -4

No files matched your search

+1 -2
View File
@@ -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()
+24 -2
View File
@@ -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?;