Skip to content

Commit

Permalink
Do not change directory when running pants from sources. (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaos authored Mar 6, 2023
1 parent bdc3e45 commit 92a64f2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 0.5.4

Support using pants from sources also from a projects subtree not only the project root.

## 0.5.3

This release fixes `scie-pants` caching of Pants installs. Previously a given version of Pants was
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [
[package]
name = "scie-pants"
description = "Protects your Pants from the elements."
version = "0.5.3"
version = "0.5.4"
edition = "2021"
authors = [
"John Sirois <john.sirois@gmail.com>",
Expand Down
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,17 @@ fn get_pants_from_sources_process(pants_repo_location: PathBuf) -> Result<Proces
.or_else(|| env::var_os("PANTS_PANTSD"))
.unwrap_or_else(|| "false".into());

let build_root = BuildRoot::find(None)?;
let env = vec![
("PANTS_VERSION".into(), version.trim().into()),
("PANTS_PANTSD".into(), enable_pantsd),
(
"PANTS_BUILDROOT_OVERRIDE".into(),
build_root.as_os_str().to_os_string(),
),
("no_proxy".into(), "*".into()),
];

let build_root = BuildRoot::find(None)?;
env::set_current_dir(build_root)?;

Ok(Process { exe, args, env })
}

Expand Down

0 comments on commit 92a64f2

Please sign in to comment.