Skip to content

Commit

Permalink
Update this repo's orchestrating Pants 2.21 -> 2.23 (#451)
Browse files Browse the repository at this point in the history
This just updates the Pants version used for linting etc., should be no
functional change.

This requires a few extra changes:

- CI here runs on older versions of macOS that we're removing support
for (#421) and thus needs to silence the warnings with
`allow_deprecated_macos_before_12`
  - doing so causes issues with a few tests that ran against this repo's
`pants.toml` with older versions of Pants that don't understand that
option, and thus those tests are adjusted to use a dedicated
`pants.toml`
- working around pantsbuild/pants#21863
  • Loading branch information
huonw authored Jan 23, 2025
1 parent 3507055 commit a5b6370
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
41 changes: 36 additions & 5 deletions package/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,13 @@ fn test_pants_bootstrap_handling(scie_pants_scie: &Path) {
// a need to restart.
let output = execute(
Command::new(scie_pants_scie)
.args(["--no-pantsd", "-V"])
.args([
"--no-pantsd",
// Work around https://github.com/pantsbuild/pants/issues/21863, which results in
// irrelevant nailgun-related log lines
"--no-process-execution-local-enable-nailgun",
"-V",
])
.stderr(Stdio::piped()),
)
.unwrap();
Expand Down Expand Up @@ -1189,6 +1195,18 @@ fn test_pants_bootstrap_urls(scie_pants_scie: &Path) {
// A fresh directory to ensure the downloads happen fresh.
let scie_base = tmpdir.path().join("scie-base");

// Set up a pants.toml
let pants_release = "2.18.0rc1";
let pants_toml_content = format!(
r#"
[GLOBAL]
pants_version = "{pants_release}"
"#
);
let project_dir = tmpdir.path().join("project");
let pants_toml = project_dir.join("pants.toml");
write_file(&pants_toml, false, pants_toml_content).unwrap();

// The file that we'll plop our URL overrides into...
let urls_json = tmpdir.path().join("urls.json");
// ... plus helpers to write to it, we start with the `ptex` key/value of this scie-pants's
Expand Down Expand Up @@ -1217,7 +1235,6 @@ fn test_pants_bootstrap_urls(scie_pants_scie: &Path) {
// Reference data for the Pants we'll try to install (NB. we have to force new-enough version of
// Pants to install via PEXes, older versions go via PyPI which isn't managed by
// PANTS_BOOTSTRAP_URLS)
let pants_release = "2.18.0rc1";
let platforms = [
"darwin_arm64",
"darwin_x86_64",
Expand All @@ -1235,7 +1252,7 @@ fn test_pants_bootstrap_urls(scie_pants_scie: &Path) {
.arg("-V")
.env("PANTS_BOOTSTRAP_URLS", &urls_json)
.env("SCIE_BASE", &scie_base)
.env("PANTS_VERSION", pants_release);
.current_dir(&project_dir);

// Part 1: Validate that we attempt to download the CPython interpreter from (invalid) override
// URLs
Expand Down Expand Up @@ -1295,14 +1312,28 @@ fn test_pants_bootstrap_stdout_silent(scie_pants_scie: &Path) {
issue = issue_link!(20315, "pantsbuild/pants")
);
let tmpdir = create_tempdir().unwrap();

let scie_base_dir = tmpdir.path().join("scie-base");

let pants_release = "2.19.1";
let pants_toml_content = format!(
r#"
[GLOBAL]
pants_version = "{pants_release}"
"#
);
let project_dir = tmpdir.path().join("project");
let pants_toml = project_dir.join("pants.toml");
write_file(&pants_toml, false, pants_toml_content).unwrap();

// Bootstrap a new unseen version of Pants to verify there is no extra output on stdout besides
// the requested output from the pants command.
let (output, _stderr) = assert_stderr_output(
Command::new(scie_pants_scie)
.arg("-V")
.env("PANTS_VERSION", "2.19.1")
.current_dir(&project_dir)
// Customise where SCIE stores its caches to force a bootstrap...
.env("SCIE_BASE", tmpdir.path())
.env("SCIE_BASE", scie_base_dir)
.stdout(Stdio::piped()),
// ...but still assert bootstrap messages to ensure we actually bootstrapped pants during this execution.
vec![
Expand Down
5 changes: 4 additions & 1 deletion pants.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GLOBAL]
pants_version = "2.21.0"
pants_version = "2.23.0"

backend_packages = [
"pants.backend.python",
Expand All @@ -8,6 +8,9 @@ backend_packages = [
"pants.backend.python.typecheck.mypy",
]

# FIXME #421: remove this once scie-pants's CI doesn't use these versions
allow_deprecated_macos_before_12 = true

[anonymous-telemetry]
enabled = true
repo_id = "e0b99427-9bc2-4f6a-b197-f5f378849b15"
Expand Down

0 comments on commit a5b6370

Please sign in to comment.