Skip to content

Commit 93b308f

Browse files
committed
Merge main into bazel-gap/cargo-vendor-check
Conflicts with #2192 (hosted Cargo under a rules_rust hub): - bazel/mod.rs: both modules kept (`cargo` from main, `cargo_bazel` here). - CLI_CONTRACT.md: this branch's `bazelignore_not_updated` row (Cargo vendored mode added) and main's new `redirect_cargo_bazel_config_unread` row. - e2e_bazel_build/cargo.rs: main's README-hub flow and this branch's build-file flow both kept; the module doc gets both sections; the constants are the union; the child helpers are this branch's (`hosts`, `env`, `person`), and main's two `socket_patch_person` calls use `person`. Main's `open_readme_hub` seeded the cargo home's crates.io index cache for the crate only, through the one-argument `index_line()` / `index_path()` this branch replaced; it now seeds the files of the crate and of the dependency this branch added, through the new signatures. - scripts/loc-budget.json: the bazel max is the merged count, 2770. Assisted-by: Claude Code:claude-opus-5-5
2 parents 1e3fd30 + bd5b8d5 commit 93b308f

77 files changed

Lines changed: 13036 additions & 638 deletions

Some content is hidden

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

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Bazel patch compatibility (Cargo)
33
# The Cargo flows of the real-Bazel tests (`cargo::` in `e2e_bazel_build`):
44
# hosted and vendored mode for a crate that rules_rust's crate_universe
55
# 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.
6+
# cargo config and no cargo-bazel lock), and hosted mode on the hub that
7+
# names no cargo config, on each Bazel release below.
78
# bazel-compatibility.yml holds the legs and what every ecosystem shares;
89
# this file says when the Cargo legs run and on which releases.
910
#
@@ -22,13 +23,15 @@ name: Bazel patch compatibility (Cargo)
2223
# No leg asks crates.io about the crate under test. cargo-bazel's cargo
2324
# reads no downloader config, so the test's workspace names a mirror of
2425
# 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.
26+
# crate has a name crates.io cannot hold. The flow of the hub without a
27+
# cargo config names the mirror in the cargo home of the test instead, which
28+
# that hub's cargo is run with (`CARGO_BAZEL_ISOLATED=false`). A crate file
29+
# under test passes through the repository cache as well: Bazel's
30+
# downloader fetches it and keeps it under its sha256. So a test builds the
31+
# upstream crate file and each patched one anew, with an id of the run in
32+
# the library, and writes the upstream checksum into the Cargo.lock of its
33+
# workspace copy. No cache holds a crate file of the run, and the test
34+
# counts the requests for the upstream one.
3235
#
3336
# Not required for merge: no `merge_group` trigger, and no job here is a
3437
# `needs` of ci.yml's `ci-ok`.

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Bazel patch compatibility (Composer)
33
# The Composer flows of the real-Bazel tests (`composer::` in
44
# `e2e_bazel_build`), on each Bazel release below: hosted mode where a
55
# repository rule runs `composer install` from the committed lock, hosted
6-
# mode where a genrule does, and agent mode on a committed `vendor/` tree.
6+
# mode where a genrule does, agent mode on a committed `vendor/` tree, and
7+
# vendored mode where the repository rule installs and on the committed tree.
78
# No Bazel ruleset builds PHP or takes Composer packages, so the three
89
# shapes are the fixture's own, as a PHP project under Bazel writes them by
910
# hand. bazel-compatibility.yml holds the legs and what every ecosystem
@@ -46,13 +47,15 @@ on:
4647
# with `composer` in its name. The flows run through most of them: the
4748
# lock's model and its hosted rewrite (formats/composer), the crawler
4849
# that finds an installed package, the lock inventory, the discovery of
49-
# a hosted pin for `vex`, the upstream restore of `rollback`, and the
50-
# hints a command prints. The vendored backend (vendor/composer_lock)
51-
# matches the patterns too, and no flow runs vendored mode. One more
52-
# file is here: patch/user_patches.rs, the inspection of a project's own
53-
# patches, whose Composer part every scan of a Composer project runs.
54-
# That file also holds the npm, Cargo and Go parts, so a change to
55-
# those starts the Composer legs too.
50+
# a hosted pin for `vex`, the upstream restore of `rollback`, the hints
51+
# a command prints, and the vendored backend (vendor/composer_lock), with
52+
# the refusal of vendored mode in a Bazel workspace. Four more are here.
53+
# patch/user_patches.rs is the inspection of a project's own patches,
54+
# whose Composer part every scan of a Composer project runs; it also
55+
# holds the npm, Cargo and Go parts, so a change to those starts the
56+
# Composer legs too. bazel/mod.rs finds the Bazel root that refusal asks
57+
# for, on the walk of utils/repo_root.rs, and vendor/refusals.rs hands
58+
# the refusal to every command.
5659
#
5760
# What it does not cover: shared engine code (patch/redirect/mod.rs,
5861
# hosted/, the apply and rollback engines of agent mode, vex/,
@@ -72,6 +75,9 @@ on:
7275
- 'crates/*/src/**/*composer*'
7376
- 'crates/*/src/**/*composer*/**'
7477
- 'crates/socket-patch-core/src/patch/user_patches.rs'
78+
- 'crates/socket-patch-core/src/bazel/mod.rs'
79+
- 'crates/socket-patch-core/src/utils/repo_root.rs'
80+
- 'crates/socket-patch-core/src/vendor/refusals.rs'
7581
push:
7682
branches: [main]
7783
# The pull request paths, and what only a push to main covers: the
@@ -91,6 +97,9 @@ on:
9197
- 'crates/*/src/**/*composer*'
9298
- 'crates/*/src/**/*composer*/**'
9399
- 'crates/socket-patch-core/src/patch/user_patches.rs'
100+
- 'crates/socket-patch-core/src/bazel/mod.rs'
101+
- 'crates/socket-patch-core/src/utils/repo_root.rs'
102+
- 'crates/socket-patch-core/src/vendor/refusals.rs'
94103
- 'crates/socket-patch-cli/tests/e2e_bazel_build/main.rs'
95104
- 'crates/socket-patch-core/src/patch/redirect/**'
96105
- 'crates/socket-patch-core/src/patch/apply.rs'

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,22 @@ jobs:
110110
pattern: pixi-cli-${{ matrix.os }}*
111111
merge-multiple: true
112112
path: native-cli
113-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
113+
- name: Setup Python (attempt 1)
114+
# A runner that doesn't cache 3.12.10 downloads it. Cap the download
115+
# and try once more, as ci.yml does: a hung manifest fetch has held
116+
# a leg there for 19 min.
117+
id: setup-python
118+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
119+
timeout-minutes: 4
120+
continue-on-error: true
114121
with:
115-
python-version: '3.12.13'
122+
python-version: '3.12.10' # exact: last 3.12 with a macOS build (#2184); the pin ci.yml uses
123+
- name: Setup Python (attempt 2)
124+
if: steps.setup-python.outcome != 'success'
125+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
126+
timeout-minutes: 4
127+
with:
128+
python-version: '3.12.10' # exact: last 3.12 with a macOS build (#2184); the pin ci.yml uses
116129
- name: Exercise real pixi projects
117130
shell: bash
118131
env:

‎README.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ socket-patch list # what is patched here; in a terminal
9191
socket-patch vendor # eject an existing hosted patch set
9292
socket-patch repair # restore agent or vendored patch artifacts
9393
socket-patch rollback lodash # restore one package to upstream
94+
socket-patch report lodash --reason tests # tell Socket a patch broke something
9495
socket-patch rollback # restore upstream dependencies
9596
```
9697

@@ -108,11 +109,14 @@ to Socket as a small JSON event. An event holds the event name (for example
108109
`patch_applied` or `patch_scan_failed`), the subcommand, the CLI version, the
109110
operating system and CPU architecture, a timestamp, a random ID generated for
110111
that one run, and a few counters and flags for the command (such as patches
111-
applied, packages scanned, ecosystems found, the patch mode, `dry_run`). `get`
112-
adds the patch UUID. A failure adds the error message, with URL credentials
113-
redacted and your home directory replaced by `~`. Apart from what an error
114-
message quotes, events hold no package names, file paths, file contents, or
115-
dependency lists.
112+
applied, packages scanned, ecosystems found, the patch mode, `dry_run`). An
113+
event about specific patches (downloading, applying, vendoring, removing, or
114+
rolling them back) names each by its patch UUID, with its ecosystem, mode, and
115+
outcome; a patch UUID tells Socket which package version the patch is for. A
116+
failure adds an error code and the error message, with URL credentials redacted
117+
and your home directory replaced by `~`. Apart from those patch UUIDs and what
118+
an error message quotes, events hold no package names, file paths, file
119+
contents, or dependency lists.
116120

117121
Events go to `api.socket.dev` with your API token when a token and organization
118122
are configured, otherwise anonymously to `patches-api.socket.dev`. They are sent

0 commit comments

Comments
 (0)