Skip to content

Commit

Permalink
cd into the wrapper package directory
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Mar 23, 2024
1 parent 8a794ae commit cbfa54f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ fn wrap(linker: &str, build_script_path: &Path) -> Result<()> {
let wrapper_package = wrapper::package(build_script_path)?;

let mut command = util::cargo_build();
command.arg("--manifest-path");
command.arg(wrapper_package.path().join("Cargo.toml"));
if var_os("BUILD_WRAP_CMD").is_none() {
command.env("BUILD_WRAP_CMD", DEFAULT_CMD);
}
Expand All @@ -102,6 +100,9 @@ fn wrap(linker: &str, build_script_path: &Path) -> Result<()> {
"--config",
&format!("target.'cfg(all())'.linker = '{linker}'"),
]);
// smoelius: `cd` into `wrapper_package`'s directory to avoid any `.cargo/config.toml` that may
// be in ancestors of the current directory.
command.current_dir(&wrapper_package);
util::exec(command, true)?;

copy(
Expand Down

0 comments on commit cbfa54f

Please sign in to comment.