Skip to content

Commit

Permalink
Adjust the buildroot sentinel detection to align with scie-pants (a…
Browse files Browse the repository at this point in the history
…lthough it can probably be removed instead?).
  • Loading branch information
stuhood committed May 9, 2023
1 parent 0d967e1 commit 836cceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rust/engine/options/src/build_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use log::debug;
pub struct BuildRoot(PathBuf);

impl BuildRoot {
const SENTINEL_FILES: &'static [&'static str] = &["pants", "BUILDROOT", "BUILD_ROOT"];
const SENTINEL_FILES: &'static [&'static str] = &["pants.toml", "BUILDROOT", "BUILD_ROOT"];

pub fn find() -> Result<BuildRoot, String> {
let cwd = env::current_dir().map_err(|e| format!("Failed to determine $CWD: {e}"))?;
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/options/src/build_root_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn test_find_cwd() {

assert_sentinel("BUILDROOT");
assert_sentinel("BUILD_ROOT");
assert_sentinel("pants");
assert_sentinel("pants.toml");
}

#[test]
Expand All @@ -44,7 +44,7 @@ fn test_find_subdir() {
assert!(BuildRoot::find_from(&buildroot_path).is_err());
assert!(BuildRoot::find_from(&subdir).is_err());

let sentinel = &buildroot.path().join("pants");
let sentinel = &buildroot.path().join("pants.toml");
fs::write(sentinel, []).unwrap();
assert_eq!(
&buildroot_path,
Expand Down

0 comments on commit 836cceb

Please sign in to comment.