Skip to content

Commit fb8dbf5

Browse files
committed
Merge main into ci/independent-pipelines
Conflicts in ci.yml only: kept main's (#1133) ungated yarn/cargo matrices and draft gate comments, and re-applied this branch's `needs: clippy` preflight on top. Co-Authored-By: Claude <noreply@anthropic.com>
2 parents 0c9a5e1 + a845bf9 commit fb8dbf5

187 files changed

Lines changed: 6802 additions & 4567 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,17 +1507,23 @@ jobs:
15071507

15081508
- name: Install Maven ${{ matrix.maven || '3.9.16' }}
15091509
if: steps.jvm.outputs.maven == 'true'
1510-
# Straight from the Apache archive (sha512-verified), so a leg gets
1511-
# exactly the release it names rather than the runner's Maven.
1512-
# --ssl-revoke-best-effort: see the `test` job's vexctl step.
1510+
# The exact release a leg names rather than the runner's Maven. The
1511+
# tarball comes from Maven Central's CDN (well under a second);
1512+
# archive.apache.org throttles bulk downloads to 1.5-5.5 minutes per
1513+
# leg. Its sha512 still comes from the Apache archive (Central has
1514+
# none for 3.6.3/3.8.9), so the bytes are checked against a digest
1515+
# from a second origin. --ssl-revoke-best-effort: see the `test`
1516+
# job's vexctl step.
15131517
shell: bash
15141518
env:
15151519
MAVEN_VERSION: ${{ matrix.maven || '3.9.16' }}
15161520
run: |
15171521
major="${MAVEN_VERSION%%.*}"
1518-
url="https://archive.apache.org/dist/maven/maven-${major}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
1522+
file="apache-maven-${MAVEN_VERSION}-bin.tar.gz"
1523+
url="https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${MAVEN_VERSION}/${file}"
1524+
sha_url="https://archive.apache.org/dist/maven/maven-${major}/${MAVEN_VERSION}/binaries/${file}.sha512"
15191525
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort "$url" -o "$RUNNER_TEMP/maven.tgz"
1520-
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort "$url.sha512" -o "$RUNNER_TEMP/maven.sha512"
1526+
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort "$sha_url" -o "$RUNNER_TEMP/maven.sha512"
15211527
python -c 'import hashlib, pathlib, os; p=pathlib.Path(os.environ["RUNNER_TEMP"]); assert hashlib.sha512((p/"maven.tgz").read_bytes()).hexdigest() == (p/"maven.sha512").read_text().split()[0]'
15221528
# Python accepts native Windows paths for both archive and destination.
15231529
python -m tarfile -e "$RUNNER_TEMP/maven.tgz" "$RUNNER_TEMP"
@@ -1983,7 +1989,12 @@ jobs:
19831989
# ----------------------------------------------------------------------
19841990
yarn-classic-matrix:
19851991
name: yarn-classic ${{ matrix.release }}
1986-
# Only wait for preflight; this job consumes no unit-test artifacts.
1992+
# No `needs: [test, coverage]`: nothing here consumes their outputs,
1993+
# and waiting on the ~30 min windows `test` leg made this the merge
1994+
# queue's critical path.
1995+
# Dropping that `needs` also dropped the draft skip it inherited, so
1996+
# gate on draft here directly (push/merge_group/schedule still run).
1997+
# Only wait for the clippy preflight.
19871998
if: github.event.pull_request.draft != true
19881999
needs: clippy
19892000
runs-on: ubuntu-latest
@@ -2021,7 +2032,12 @@ jobs:
20212032

20222033
yarn-berry-e2e:
20232034
name: yarn-berry ${{ matrix.yarn }} (${{ matrix.os }})
2024-
# Only wait for preflight; this job consumes no unit-test artifacts.
2035+
# No `needs: [test, coverage]`: nothing here consumes their outputs,
2036+
# and waiting on the ~30 min windows `test` leg made this the merge
2037+
# queue's critical path.
2038+
# Dropping that `needs` also dropped the draft skip it inherited, so
2039+
# gate on draft here directly (push/merge_group/schedule still run).
2040+
# Only wait for the clippy preflight.
20252041
if: github.event.pull_request.draft != true
20262042
needs: clippy
20272043
strategy:
@@ -2105,7 +2121,8 @@ jobs:
21052121
# e2e_safety_cargo_build (its headline test honours the knobs).
21062122
cargo-vex-matrix:
21072123
name: cargo ${{ matrix.toolchain }} lock-v${{ matrix.lock || 'own' }} (${{ matrix.os }})
2108-
# Only the matching OS build is needed.
2124+
# e2e-build only (its binaries; only the matching OS build is needed);
2125+
# see yarn-classic-matrix on test/coverage.
21092126
needs: [e2e-build]
21102127
runs-on: ${{ matrix.os }}
21112128
timeout-minutes: 40
@@ -2243,7 +2260,12 @@ jobs:
22432260
# available; this leg pulls both images and requires them.
22442261
cargo-old-toolchains:
22452262
name: cargo old toolchains (manifest [patch])
2246-
# Only wait for preflight; this job consumes no unit-test artifacts.
2263+
# No `needs: [test, coverage]`: nothing here consumes their outputs,
2264+
# and waiting on the ~30 min windows `test` leg made this the merge
2265+
# queue's critical path.
2266+
# Dropping that `needs` also dropped the draft skip it inherited, so
2267+
# gate on draft here directly (push/merge_group/schedule still run).
2268+
# Only wait for the clippy preflight.
22472269
if: github.event.pull_request.draft != true
22482270
needs: clippy
22492271
runs-on: ubuntu-latest

‎.github/workflows/composer-compatibility.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ jobs:
181181
include:
182182
- {os: macos-latest, composer: '1.10.28', php: '8.1', sha256: 0915af36eb01e3f0e16cd309adff7051832b9ef014e38371756804b20425cd5a}
183183
- {os: macos-latest, composer: '2.2.30', php: '8.3', sha256: 8c2b4478b64f8f7cdf1574838fdb0033b29049ca821dad452db7a3dcfcdbffc2}
184-
- {os: macos-latest, composer: '2.10.3', php: '8.5', sha256: 7a2d379d5b8ffdaa028580ef26494c36d2feef4b178d3dd1473a4dbc5e17c8d6}
184+
# PHP 8.4 on macOS: setup-php 2.37.2 cannot install 8.5 from Homebrew
185+
# since PHP 8.6 shipped (every run from 2026-10-07 23:51Z failed in
186+
# "Setup PHP"). Ubuntu and Windows keep the 2.10.3 / 8.5 cell.
187+
- {os: macos-latest, composer: '2.10.3', php: '8.4', sha256: 7a2d379d5b8ffdaa028580ef26494c36d2feef4b178d3dd1473a4dbc5e17c8d6}
185188
runs-on: ${{ matrix.os }}
186189
timeout-minutes: 60
187190
steps: *native-steps

‎.github/workflows/gradle-compatibility.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,13 @@ jobs:
256256
# TLS handshake with CRYPT_E_REVOCATION_OFFLINE whenever the CA's
257257
# revocation server is unreachable. A revoked certificate still fails;
258258
# the body is checked against a digest right after. A no-op elsewhere.
259-
url="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
259+
# Tarball from Maven Central's CDN, digest from the Apache archive,
260+
# which throttles the tarball itself to minutes (ci.yml's copy).
261+
file="apache-maven-${MAVEN_VERSION}-bin.tar.gz"
262+
url="https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${MAVEN_VERSION}/${file}"
263+
sha_url="https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/${file}.sha512"
260264
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort "$url" -o "$RUNNER_TEMP/maven.tgz"
261-
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort "$url.sha512" -o "$RUNNER_TEMP/maven.sha512"
265+
curl -fsSL --retry 5 --retry-all-errors --ssl-revoke-best-effort "$sha_url" -o "$RUNNER_TEMP/maven.sha512"
262266
python -c 'import hashlib, pathlib, os; p=pathlib.Path(os.environ["RUNNER_TEMP"]); assert hashlib.sha512((p/"maven.tgz").read_bytes()).hexdigest() == (p/"maven.sha512").read_text().split()[0]'
263267
python -m tarfile -e "$RUNNER_TEMP/maven.tgz" "$RUNNER_TEMP"
264268
launcher="$RUNNER_TEMP/apache-maven-${MAVEN_VERSION}/bin/mvn"

‎crates/socket-patch-cli/CLI_CONTRACT.md‎

Lines changed: 29 additions & 21 deletions
Large diffs are not rendered by default.

‎crates/socket-patch-cli/src/args.rs‎

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ pub const GLOBAL_ARG_ENV_VARS: &[&str] = &[
687687
/// missing here escapes the empty-var scrub — the invariant tests below
688688
/// parse every entry against its owning subcommand to keep this honest.
689689
pub const LOCAL_ARG_ENV_VARS: &[&str] = &[
690-
"SOCKET_FORCE",
691690
"SOCKET_PATCH_VERSION",
692691
"SOCKET_SAVE_ONLY",
693692
"SOCKET_ALL_RELEASES",
@@ -775,6 +774,13 @@ impl Default for GlobalArgs {
775774
}
776775
}
777776

777+
/// True for a golang PURL in local mode (no `--global` / `--global-prefix`):
778+
/// `apply` redirects it to a project-local patched copy via a `go.mod`
779+
/// `replace`, and `rollback` drops the same redirect.
780+
pub(crate) fn is_local_go(purl: &str, common: &GlobalArgs) -> bool {
781+
!common.is_global() && Ecosystem::from_purl(purl) == Some(Ecosystem::Golang)
782+
}
783+
778784
#[cfg(test)]
779785
mod tests {
780786
use super::*;
@@ -1634,9 +1640,6 @@ mod tests {
16341640
// (env var, argv of a subcommand that binds it) — every bool entry
16351641
// of `LOCAL_ARG_ENV_VARS`, on each subcommand that binds it.
16361642
const BOOL_BINDINGS: &[(&str, &[&str])] = &[
1637-
("SOCKET_FORCE", &["socket-patch", "apply"]),
1638-
("SOCKET_FORCE", &["socket-patch", "vendor"]),
1639-
("SOCKET_FORCE", &["socket-patch", "self-update"]),
16401643
("SOCKET_SAVE_ONLY", &["socket-patch", "get", "x"]),
16411644
("SOCKET_ALL_RELEASES", &["socket-patch", "get", "x"]),
16421645
("SOCKET_ALL_RELEASES", &["socket-patch", "scan"]),
@@ -1674,6 +1677,48 @@ mod tests {
16741677
});
16751678
}
16761679

1680+
/// v5 retired `SOCKET_FORCE` (#615): `--force` is flag-only on `apply`,
1681+
/// `vendor` and `--update`. A stale export must be ignored, so it can
1682+
/// never quietly skip the beforeHash check or the managed-install
1683+
/// refusal; the flag itself still works.
1684+
#[test]
1685+
#[serial_test::serial]
1686+
fn socket_force_env_is_ignored_and_force_flag_still_works() {
1687+
fn force_of(argv: &[&str]) -> bool {
1688+
let argv = argv.iter().map(|s| s.to_string()).collect();
1689+
match crate::parse_argv_with_shortcuts(argv)
1690+
.unwrap_or_else(|e| panic!("parse failed: {e}"))
1691+
.command
1692+
{
1693+
crate::Commands::Apply(a) => a.force,
1694+
crate::Commands::Vendor(a) => a.force,
1695+
crate::Commands::SelfUpdate(a) => a.force,
1696+
_ => panic!("unexpected subcommand"),
1697+
}
1698+
}
1699+
1700+
const ARGVS: &[&[&str]] = &[
1701+
&["socket-patch", "apply"],
1702+
&["socket-patch", "vendor"],
1703+
&["socket-patch", "self-update"],
1704+
&["socket-patch", "--update"],
1705+
];
1706+
1707+
with_clean_socket_env(|| {
1708+
with_env_cleared(&["SOCKET_FORCE"], || {
1709+
for val in ["1", "true", "yes"] {
1710+
std::env::set_var("SOCKET_FORCE", val);
1711+
for &argv in ARGVS {
1712+
assert!(!force_of(argv), "SOCKET_FORCE={val} set force on {argv:?}");
1713+
let mut with_flag = argv.to_vec();
1714+
with_flag.push("--force");
1715+
assert!(force_of(&with_flag), "--force ignored on {argv:?}");
1716+
}
1717+
}
1718+
});
1719+
});
1720+
}
1721+
16771722
/// Companion invariant for the **value-typed** local env vars: an
16781723
/// exported-but-empty value (`VAR=`) must not crash its subcommand —
16791724
/// [`scrub_empty_env_vars`] (run by `main` before clap) removes it, and

0 commit comments

Comments
 (0)