Skip to content

Commit 2caee01

Browse files
mikolalysenkoclaude
andcommitted
Merge remote-tracking branch 'origin/main' into fix/jvm-jar-limits-and-checks
main moved wrapper_maven_version into formats::maven::declared_maven and added shared answers to which Maven a project declares and how a maven.config line is read. The local repository lookup now uses them: DeclaredMaven (the wrapper's release, or a root pom only Maven 4 reads) decides how .mvn/maven.config is read, maven_config_line_properties is the reading for Maven 3.9 and later, and RootDirectory says which root directory property the declared Maven fills in. The whitespace reading of Maven before 3.9 and the choice between the two readings stay here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2 parents 855ad75 + 83d2b95 commit 2caee01

327 files changed

Lines changed: 22999 additions & 958 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.

‎.gitattributes‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The redirect golden fixtures are a byte-exact cross-language contract
2-
# (consumed by both this crate's redirect_golden.rs and the depscan backend's
3-
# golden.test.ts). EOL conversion on checkout (Windows CRLF) breaks the
2+
# (consumed by both this crate's redirect_golden.rs and the golden test of
3+
# Socket's backend). EOL conversion on checkout (Windows CRLF) breaks the
44
# byte-for-byte comparison, so they are checked out exactly as committed.
55
crates/socket-patch-core/tests/fixtures/redirect/** -text
66

‎.github/workflows/bazel-cargo.yml‎

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Bazel patch compatibility (Cargo)
2+
3+
# The Cargo flows of the real-Bazel tests (`cargo::` in `e2e_bazel_build`):
4+
# hosted and vendored mode for a crate that rules_rust's crate_universe
5+
# resolves from a Cargo workspace (`crate.from_cargo`, with the project's
6+
# cargo config and no cargo-bazel lock), on each Bazel release below.
7+
# bazel-compatibility.yml holds the legs and what every ecosystem shares;
8+
# this file says when the Cargo legs run and on which releases.
9+
#
10+
# Beyond what every leg needs, a Cargo leg downloads the Rust toolchain
11+
# from static.rust-lang.org, the cargo-bazel binary and ruleset archives
12+
# from github.com, and the crates rules_rust builds its own tools from, from
13+
# static.crates.io (60 of them with rules_rust 0.75.0, one with 0.56.0).
14+
# Its repository cache holds all of it. For the era of rules_rust 0.75.0
15+
# it comes to about 230 MB after one Bazel release and about 240 MB once
16+
# both releases of the era have used it, and to about 155 MB for the era of
17+
# 0.56.0 (macOS arm64). Every workspace copy unpacks the toolchain for
18+
# itself, about 1.8 GB, and a leg has two at a time, one per test: a test
19+
# removes its first copy before its second machine builds (3.6 GB at the
20+
# peak on Bazel 9.3.2, macOS arm64).
21+
#
22+
# No leg asks crates.io about the crate under test. cargo-bazel's cargo
23+
# reads no downloader config, so the test's workspace names a mirror of
24+
# crates.io in its `.cargo/config.toml`, the loopback stand-in, and the
25+
# crate has a name crates.io cannot hold. A crate file under test passes
26+
# through the repository cache as well: Bazel's downloader fetches it and
27+
# keeps it under its sha256. So a test builds the upstream crate file and
28+
# each patched one anew, with an id of the run in the library, and writes
29+
# the upstream checksum into the Cargo.lock of its workspace copy. No cache
30+
# holds a crate file of the run, and the test counts the requests for the
31+
# upstream one.
32+
#
33+
# Not required for merge: no `merge_group` trigger, and no job here is a
34+
# `needs` of ci.yml's `ci-ok`.
35+
36+
on:
37+
pull_request:
38+
types: [opened, synchronize, reopened, ready_for_review]
39+
# What a pull request run covers: the Cargo flows and their fixture, the
40+
# harness and the workflows that run it, the Bazel installer and its
41+
# pins, and the Cargo files of socket-patch-core, which the two globs
42+
# name by the `cargo` in a file's or a directory's name: the Cargo.lock
43+
# and Cargo.toml models with the hosted planner and the reader of a
44+
# source replacement (formats/cargo/), the vendored backend
45+
# (vendor/cargo*, the lock inventory), the upstream restore of
46+
# `rollback`, the crawler every `scan` starts, the cargo home and
47+
# workspace lookups, and the reader of a Cargo project that `vex` runs
48+
# (vex/discover/cargo.rs). They also match Cargo files no flow runs
49+
# (agent mode's sidecars and build cache), which are no other
50+
# ecosystem's either. One more file is here for what the flows
51+
# run through: patch/user_patches.rs, the inspection of the project's
52+
# own patches, which reads the Cargo.toml and the cargo config of every
53+
# scan. That file also holds the npm, Composer and Go parts of the
54+
# gate, so a change to those starts the Cargo legs too. The globs name
55+
# that one crate, so no bench fixture is here, and nothing another
56+
# ecosystem's flow owns: a change to one ecosystem starts that
57+
# ecosystem's legs only.
58+
#
59+
# What it does not cover: shared engine code (patch/redirect/mod.rs,
60+
# the rest of vendor/, hosted/, commands/), the shared test helpers and
61+
# the toolchain files. A change there gets its run on the push to main
62+
# (when the file is in the list below) or in the nightly run, not on the
63+
# pull request: that is the price of not running every ecosystem's legs
64+
# on every shared change. On demand, workflow_dispatch runs the legs on
65+
# any branch.
66+
paths:
67+
- '.github/workflows/bazel-cargo.yml'
68+
- '.github/workflows/bazel-compatibility.yml'
69+
- 'scripts/install-bazel.sh'
70+
- 'scripts/bazel-pins.txt'
71+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/cargo.rs'
72+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs'
73+
- 'crates/socket-patch-cli/tests/fixtures/bazel/rules_rust/**'
74+
- 'crates/socket-patch-core/src/**/*cargo*'
75+
- 'crates/socket-patch-core/src/**/*cargo*/**'
76+
- 'crates/socket-patch-core/src/patch/user_patches.rs'
77+
push:
78+
branches: [main]
79+
# The pull request paths, and what only a push to main covers: the
80+
# root of the test target (it changes when an ecosystem's module is
81+
# added; ci.yml builds the target and runs its hermetic tests on every
82+
# pull request), the shared engine code and test helpers the flows run
83+
# through, and the toolchain files. A main push outside this list waits
84+
# for the nightly run below.
85+
paths:
86+
- '.github/workflows/bazel-cargo.yml'
87+
- '.github/workflows/bazel-compatibility.yml'
88+
- 'scripts/install-bazel.sh'
89+
- 'scripts/bazel-pins.txt'
90+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/cargo.rs'
91+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs'
92+
- 'crates/socket-patch-cli/tests/fixtures/bazel/rules_rust/**'
93+
- 'crates/socket-patch-core/src/**/*cargo*'
94+
- 'crates/socket-patch-core/src/**/*cargo*/**'
95+
- 'crates/socket-patch-core/src/patch/user_patches.rs'
96+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/main.rs'
97+
- 'crates/socket-patch-core/src/patch/redirect/**'
98+
- 'crates/socket-patch-core/src/vendor/**'
99+
- 'crates/socket-patch-core/src/hosted/**'
100+
- 'crates/socket-patch-cli/src/commands/**'
101+
- 'crates/socket-patch-cli/tests/common/**'
102+
- 'crates/socket-patch-cli/tests/hosted_memory_common/**'
103+
- 'Cargo.lock'
104+
- 'Cargo.toml'
105+
- 'crates/*/Cargo.toml'
106+
- 'rust-toolchain.toml'
107+
- '.cargo/**'
108+
schedule:
109+
# Nightly, so a main change outside the push list still gets a run
110+
# within a day. The macOS leg runs here and on demand only.
111+
- cron: '57 4 * * *'
112+
workflow_dispatch:
113+
114+
permissions:
115+
contents: read
116+
117+
# The nightly run has a group of its own. A group holds one pending run, so
118+
# in the group of main's pushes a second push would replace a nightly that
119+
# waits behind the first, and the nightly is the only run with the macOS leg.
120+
concurrency:
121+
group: bazel-cargo-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'schedule' && '-nightly' || '' }}
122+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
123+
124+
jobs:
125+
cargo:
126+
uses: ./.github/workflows/bazel-compatibility.yml
127+
with:
128+
eco: cargo
129+
fixtures: rules_rust/bzlmod
130+
# One leg per line: a Bazel release, and the era of the fixture that
131+
# `cargo::FIXTURE` gives it.
132+
releases: >-
133+
[
134+
{"bazel": "9.3.2", "era": "e9"},
135+
{"bazel": "8.8.2", "era": "e9"},
136+
{"bazel": "7.7.2", "era": "e7"}
137+
]
138+
macos: >-
139+
[
140+
{"bazel": "9.3.2", "era": "e9"}
141+
]

‎.github/workflows/bazel-nuget.yml‎

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Bazel patch compatibility (NuGet)
2+
3+
# The NuGet flow of the real-Bazel tests (`nuget::` in `e2e_bazel_build`):
4+
# hosted mode for a package that rules_csharp's `nuget.from_lock` reads from
5+
# `packages.lock.json` and `nuget.config`, on each Bazel release below.
6+
# bazel-compatibility.yml holds the legs and what every ecosystem shares;
7+
# this file says when the NuGet legs run and on which releases.
8+
#
9+
# A NuGet leg downloads no .NET SDK and needs none on the runner: the
10+
# fixture's consumer is a `genrule` over the assembly that the hub hands to
11+
# a C# rule, and no C# rule is built. Beyond what every leg needs, a leg
12+
# downloads the rules_csharp archive (about 140 kB) and nothing else, so
13+
# its repository cache holds little more than what Bazel resolves for
14+
# itself: about 1 MB on Bazel 9, half of that on Bazel 7, and about 13 MB
15+
# on Bazel 8, which fetches protobuf for its own modules, as it does in a
16+
# workspace without rules_csharp. No leg asks nuget.org: the test's
17+
# downloader config sends every URL of that host to the loopback stand-in
18+
# and blocks the host. A package under test never comes from the
19+
# repository cache: the test builds the packages of a run with an id of
20+
# that run in their names and in their bytes, so no earlier run saved a
21+
# file with their checksums.
22+
#
23+
# Not required for merge: no `merge_group` trigger, and no job here is a
24+
# `needs` of ci.yml's `ci-ok`.
25+
26+
on:
27+
pull_request:
28+
types: [opened, synchronize, reopened, ready_for_review]
29+
# What a pull request run covers: the NuGet flow and its fixture, the
30+
# harness and the workflows that run it, the Bazel installer and its
31+
# pins, and the NuGet files of the product that `scan --mode hosted`,
32+
# `vex` and `rollback` run through in the fixture, each by its own
33+
# path: the readers of `packages.lock.json` and `nuget.config` and the
34+
# `contentHash` of a package (formats/nuget), the NuGet crawler, which
35+
# finds a package in the global packages folder, the reader of the
36+
# NuGet settings a project inherits (vendor/nuget_config.rs), the
37+
# discovery of a hosted pin in the two files, the upstream restore of
38+
# `rollback`, and the hosted scan's check of that folder.
39+
# vendor/nuget_feed.rs is the vendored backend; it is here for the
40+
# version and folder helpers that every one of those files calls.
41+
# Nothing another ecosystem's flow owns is here, so a change to one
42+
# ecosystem starts that ecosystem's legs only.
43+
#
44+
# What it does not cover: shared engine code. The hosted rewrite itself
45+
# is there (`rewrite_nuget` in patch/redirect/mod.rs, the file of every
46+
# ecosystem's rewriter), and so are patch/redirect/grant.rs,
47+
# hosted/engine.rs, commands/scan/hosted.rs and the rest of vex/, the
48+
# shared test helpers and the toolchain files. A change to one of those
49+
# gets its run on the push to main (when the file is in the list below)
50+
# or in the nightly run, not on the pull request: that is the price of
51+
# not running every ecosystem's legs on every shared change. The flow
52+
# does not run agent mode (patch/sidecars/nuget.rs), which is in neither
53+
# list. On demand, workflow_dispatch runs the legs on any branch.
54+
paths:
55+
- '.github/workflows/bazel-nuget.yml'
56+
- '.github/workflows/bazel-compatibility.yml'
57+
- 'scripts/install-bazel.sh'
58+
- 'scripts/bazel-pins.txt'
59+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/nuget.rs'
60+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs'
61+
- 'crates/socket-patch-cli/tests/fixtures/bazel/rules_csharp/**'
62+
- 'crates/socket-patch-core/src/formats/nuget/**'
63+
- 'crates/socket-patch-core/src/crawlers/nuget_crawler.rs'
64+
- 'crates/socket-patch-core/src/vendor/nuget_config.rs'
65+
- 'crates/socket-patch-core/src/vendor/nuget_feed.rs'
66+
- 'crates/socket-patch-core/src/vex/discover/nuget.rs'
67+
- 'crates/socket-patch-core/src/patch/redirect/upstream/nuget.rs'
68+
- 'crates/socket-patch-cli/src/commands/scan/hosted/nuget.rs'
69+
push:
70+
branches: [main]
71+
# The pull request paths, and what only a push to main covers: the
72+
# root of the test target (it changes when an ecosystem's module is
73+
# added; ci.yml builds the target and runs its hermetic tests on every
74+
# pull request), the shared engine code and test helpers the flow runs
75+
# through, `vex`, whose verdicts the flow asserts, and the toolchain
76+
# files. A main push outside this list waits for the nightly run below.
77+
paths:
78+
- '.github/workflows/bazel-nuget.yml'
79+
- '.github/workflows/bazel-compatibility.yml'
80+
- 'scripts/install-bazel.sh'
81+
- 'scripts/bazel-pins.txt'
82+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/nuget.rs'
83+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs'
84+
- 'crates/socket-patch-cli/tests/fixtures/bazel/rules_csharp/**'
85+
- 'crates/socket-patch-core/src/formats/nuget/**'
86+
- 'crates/socket-patch-core/src/crawlers/nuget_crawler.rs'
87+
- 'crates/socket-patch-core/src/vendor/nuget_config.rs'
88+
- 'crates/socket-patch-core/src/vendor/nuget_feed.rs'
89+
- 'crates/socket-patch-core/src/vex/discover/nuget.rs'
90+
- 'crates/socket-patch-core/src/patch/redirect/upstream/nuget.rs'
91+
- 'crates/socket-patch-cli/src/commands/scan/hosted/nuget.rs'
92+
- 'crates/socket-patch-cli/tests/e2e_bazel_build/main.rs'
93+
- 'crates/socket-patch-core/src/patch/redirect/**'
94+
- 'crates/socket-patch-core/src/hosted/**'
95+
- 'crates/socket-patch-core/src/vex/**'
96+
- 'crates/socket-patch-cli/src/commands/**'
97+
- 'crates/socket-patch-cli/tests/common/**'
98+
- 'crates/socket-patch-cli/tests/hosted_memory_common/**'
99+
- 'Cargo.lock'
100+
- 'Cargo.toml'
101+
- 'crates/*/Cargo.toml'
102+
- 'rust-toolchain.toml'
103+
- '.cargo/**'
104+
schedule:
105+
# Nightly, so a main change outside the push list still gets a run
106+
# within a day. The macOS leg runs here and on demand only.
107+
- cron: '7 5 * * *'
108+
workflow_dispatch:
109+
110+
permissions:
111+
contents: read
112+
113+
# The nightly run has a group of its own. A group holds one pending run, so
114+
# in the group of main's pushes a second push would replace a nightly that
115+
# waits behind the first, and the nightly is the only run with the macOS leg.
116+
concurrency:
117+
group: bazel-nuget-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'schedule' && '-nightly' || '' }}
118+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
119+
120+
jobs:
121+
nuget:
122+
uses: ./.github/workflows/bazel-compatibility.yml
123+
with:
124+
eco: nuget
125+
fixtures: rules_csharp/bzlmod
126+
# One leg per line: a Bazel release, and the era of the fixture that
127+
# `nuget::FIXTURE` gives it.
128+
releases: >-
129+
[
130+
{"bazel": "9.3.2", "era": "e9"},
131+
{"bazel": "8.8.2", "era": "e9"},
132+
{"bazel": "7.7.2", "era": "e9"}
133+
]
134+
macos: >-
135+
[
136+
{"bazel": "9.3.2", "era": "e9"}
137+
]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ jobs:
312312
# The releases the download step staged: the matrix release or the
313313
# dispatch override, minus any pre-1.1.0 release skipped on Windows.
314314
BUN_VERSIONS: ${{ steps.bun.outputs.versions }}
315-
# Provenance for the captures the depscan SBOM fixtures import:
315+
# Provenance for the captures the Socket backend's SBOM fixtures import:
316316
# `cliRevision` is the branch-resolvable head commit (PR head, or the
317317
# pushed commit on main); `cliBuildSha` is the commit actions/checkout
318318
# actually built (refs/pull/N/merge on PRs) — they diverge once main

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ concurrency:
6868
# values stay `ubuntu-latest`/`ubuntu-22.04`, so job names, cache keys and
6969
# scripts are unchanged; only `runs-on` maps them. Kill switch: set the
7070
# repository variable DISABLE_DEPOT_RUNNERS=true to fall back to GitHub-hosted
71-
# runners (the same switch depscan uses). The compile-bound critical-path
71+
# runners (the same switch Socket's other repos use). The compile-bound critical-path
7272
# jobs (clippy, coverage, e2e-build, test-release) use 16-vCPU Depot runners
7373
# (depot-ubuntu-24.04-16). The compatibility workflows follow
7474
# the same mapping. Release, publish and merge-queue workflows stay
@@ -1457,6 +1457,12 @@ jobs:
14571457
# skip. Node 24 (step below): the
14581458
# corepack pnpm@10/11 legs require it.
14591459
- {os: ubuntu-latest, suite: e2e_redirect_pnpm_build, test_filter: '--ignored --skip pnpm_pinned_matrix', pnpm_required: '1'}
1460+
# Vendored mode in a Rush monorepo against the real `@microsoft/rush`
1461+
# (fetched with `npm x`; Rush downloads the pinned pnpm 10 and 11
1462+
# itself): vendor, `rush update` must rewrite nothing, a fresh
1463+
# checkout's `rush install` lands the patched bytes, revert. Node 24
1464+
# (step below): pnpm 11 requires Node >= 22.13.
1465+
- {os: ubuntu-latest, suite: e2e_vendor_rush, pnpm_required: '1'}
14601466
# Real-uv hosted/vendored capstones ending in manifest-less VEX:
14611467
# the oldest and newest line + the 0.5.x boundary (0.5.4 still
14621468
# re-resolves a transitive override / rejects a repointed
@@ -1596,7 +1602,7 @@ jobs:
15961602
run: npm install -g pnpm@10
15971603

15981604
- name: Setup Node.js 24 (named pnpm legs)
1599-
if: matrix.suite == 'e2e_redirect_pnpm_build'
1605+
if: matrix.suite == 'e2e_redirect_pnpm_build' || contains(matrix.suite, 'e2e_vendor_rush')
16001606
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
16011607
with:
16021608
node-version: '24.21.0' # exact: bump deliberately (#1645)
@@ -2244,7 +2250,7 @@ jobs:
22442250
suite: e2e_redirect_npm_build
22452251
npm_required: '1'
22462252
- os: windows-latest
2247-
suite: e2e_redirect_rush_sim
2253+
suite: e2e_redirect_rush_sim e2e_vendor_rush
22482254
pnpm_required: '1'
22492255
- os: windows-latest
22502256
suite: e2e_redirect_bun_build e2e_vendor_bun_build mode_migration_bun
@@ -2283,7 +2289,7 @@ jobs:
22832289
suite: e2e_redirect_npm_build
22842290
npm_required: '1'
22852291
- os: macos-latest
2286-
suite: e2e_redirect_rush_sim
2292+
suite: e2e_redirect_rush_sim e2e_vendor_rush
22872293
pnpm_required: '1'
22882294
- os: macos-latest
22892295
suite: e2e_redirect_bun_build

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name: Composer patch compatibility
1313
# bearing there; 2.10.3 = current, no fallback.
1414
#
1515
# PHP: Composer 1 never on 8.5 (broken there). No 7.4 cell: the psr/log
16-
# 3.0.2 capstones need PHP >= 8.0; the depscan harness covers 7.4.
16+
# 3.0.2 capstones need PHP >= 8.0; the Socket backend's harness covers 7.4.
1717
#
1818
# Each leg runs one checksum-pinned composer.phar through `php` (the
1919
# capstones' SOCKET_PATCH_COMPOSER_PHAR mode), which is also what makes

‎.github/workflows/installer-drift.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Installer drift
44
# scripts/install.sh — the README says so, and the whole point of hosting the
55
# installer on a Socket domain is that the bytes are auditable against this
66
# repository. Nothing enforces that at publish time from this side: the copy is
7-
# published out of depscan's vendored `submodules/socket-patch` pin, so an
8-
# installer change merged here is not live until that pin is bumped and depscan
9-
# deploys (see docs/installer-hosting.md).
7+
# published by Socket's deploy from a pinned commit of this repository, so an
8+
# installer change merged here is not live until that pin is bumped and
9+
# deployed (see docs/installer-hosting.md).
1010
#
1111
# This job is the watchdog for that gap. It is deliberately NOT part of CI: it
1212
# checks a deployed artifact, not the diff, and a red run here means "go bump
@@ -71,7 +71,7 @@ jobs:
7171
if: steps.fetch.outputs.deployed == 'true'
7272
run: |
7373
if ! diff -u scripts/install.sh hosted-install.sh; then
74-
echo "::error::install.socket.dev/patch has drifted from scripts/install.sh. Fix: bump submodules/socket-patch in depscan to this commit and deploy — see docs/installer-hosting.md."
74+
echo "::error::install.socket.dev/patch has drifted from scripts/install.sh. Fix: Socket has to bump its pinned commit of this repository and deploy — see docs/installer-hosting.md."
7575
exit 1
7676
fi
7777
echo "install.socket.dev/patch matches scripts/install.sh"

0 commit comments

Comments
 (0)