Skip to content

Commit e5568fc

Browse files
committed
bazel: 2026-11-26 second run (PyPI outside Bazel, #2281)
1 parent c2f5c32 commit e5568fc

3 files changed

Lines changed: 43 additions & 15 deletions

File tree

‎entries/bazel/20261126T125053Z.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[agent] 2026-11-26: Bazel bug-hunt run
2+
3+
Second run of the day. main `cfc870f` (unchanged), latest release v5.1.0, Bazel 9.3.2 (newest pin), Linux x86_64.
4+
5+
**Still blocked: no real Bazel build runs in this sandbox.** The egress proxy refuses `bcr.bazel.build`, `releases.bazel.build` and `mirror.bazel.build` (HTTP 403), and this time no Bazel binary was cached either. Other GitHub repositories answer 403 too, so newer Bazel and ruleset releases could not be looked up. Not worked around.
6+
7+
Covered:
8+
- Nightly CI on `main`: the scheduled runs of all eight `bazel-*.yml` workflows on 24, 25 and 26 Nov are green (PyPI legs read per job: 7.7.2, 8.8.2, 9.3.2 and macOS 9.3.2 pass). No red leg, no flake.
9+
- Outside a Bazel build, PyPI (hashed `requirements.txt`, lock-only checkout, a loopback stand-in for the Socket API, the patch host and the index): hosted scan, `vex`, a second scan, `rollback`; vendored scan, `vex`, `vendor --check`, `vendor --revert`; each with `--json` and without, with main and with v5.1.0. Pass: the same exit codes and the same files at every step (the vendor marker differs by its timestamp only), and each undo gives the tree back byte for byte. The output differs only by changes that are not Bazel's: main with `SOCKET_NO_BAZEL=1` prints the same as main without it.
10+
- A project Bazel does not build, PyPI: under a root `MODULE.bazel` with no hub, under a leftover empty `WORKSPACE`, and in `tools/` of a workspace whose `pip.parse` reads `//svc:requirements.txt`. Pass: identical to the same project in no workspace (files, output, exit codes).
11+
- File level only, no build, in the rules_python fixture workspace (the hub reads `//:requirements.txt`):
12+
- never built (no `MODULE.bazel.lock`): `scan --mode vendored` declines with `vendor_pypi_bazel_hub`, exit 1, and writes nothing; the message names the call, the line, `--mode hosted`, `--allow-vendored-in-bazel` and the condition that failed. Hosted scan then `rollback` gives every file back.
13+
- as a build leaves it (lock names rules_python 2.5.0-rc4, `.bazelversion` 9.3.2): vendored mode writes the download cache (the hosted line, the wheel, two lines in `.bazelrc`); `vendor --check` passes; `vendor --revert` gives every file back byte for byte, also for a `.bazelrc` with CRLF, with no final newline, with blank lines at its end, and for a checkout with no `.bazelrc`.
14+
These are not matrix passes: nothing was built.
15+
- `vex`, files only: `not_affected` after a hosted scan and after a download cache; no document after each undo and after the decline.
16+
17+
Filed:
18+
- https://github.com/SocketDev/socket-patch/issues/2281: after a hosted PyPI scan under a rules_python hub, `scan --vex` exits 1 and `vex` writes no document when a virtualenv in the project still holds the unpatched release, although the hub builds from the pinned `requirements.txt`. The docs carry this condition for NuGet only; the PyPI cell says "Supported". A missing document, not a false one. The claim that the build is patched rests on the green `pypi::hosted_pip_parse` legs, not on a build here.
19+
20+
Commented on or closed: none. Open `pm:bazel` issues before this run: none.
21+
22+
Ruled out (see `known-non-bugs/bazel.md`): the undo of a download cache removes an empty `.bazelrc` of the user's (documented); `scannedPackages` 97 on v5.1.0 against 2 on main (not Bazel's); `scan --yes` without `--mode` in a lock-only checkout is hosted mode, not agent mode.
23+
24+
Not covered (need a build): every Hosted, Vendored and Agent cell of the matrix, the shapes list, new Bazel and ruleset releases.

‎known-non-bugs/bazel.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
- 2026-11-26: `vex` exits 1 with `record_unavailable` after a hosted scan against a home-made stand-in API. The stand-in did not answer `GET /patches/view/<uuid>?include_blobs=false` (query string). Not a product bug.
44
- 2026-11-26: `rollback` says `manifest_not_found` after a hosted scan against a stand-in on loopback. A hosted pin is recognised by the patch host's origin: set `SOCKET_PATCH_SERVER_URL` (and `SOCKET_NPM_REGISTRY`) as `e2e_bazel_build/npm.rs` does.
55
- 2026-11-26: main and v5.1.0 print different output for a project in no Bazel workspace (`mergePendingIds`, `removedRegistryEntries`, a second product id in the VEX document, the human scan summary). These come from changes that are not Bazel's: main with `SOCKET_NO_BAZEL=1` prints the same as main without it.
6+
- 2026-11-26: `vendor --revert` (and `rollback`) of a PyPI download cache removes a `.bazelrc` that was an empty file of the user's. Documented in "Bazel workspaces: PyPI vendored mode as a download cache" ("a `.bazelrc` left empty is removed, also when it was an empty file of yours").
7+
- 2026-11-26: for a lock-only Python project v5.1.0 reports `scannedPackages: 97` ("Found 97 packages", the machine's site-packages) and main reports 2. Not Bazel's: main with `SOCKET_NO_BAZEL=1` prints the same as main without it, and the files and exit codes are the same.
8+
- 2026-11-26: `scan --yes` with no `--mode` in a lock-only checkout pins hosted patches; it is not agent mode. To test agent mode in a Bazel workspace, the package must be installed and patched with `apply`.

‎state/bazel.md‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
[agent] Progress ledger for the scheduled Bazel workspaces bug-hunt routine (label pm:bazel).
22

3-
Last run: 2026-11-26, main `cfc870f`, release v5.1.0, newest Bazel pin 9.3.2. Real Bazel builds are blocked in the sandbox (see backlog item 1), so no Hosted, Vendored, Agent or VEX cell has been tested yet.
3+
Last run: 2026-11-26 (second run of the day), main `cfc870f`, release v5.1.0, newest Bazel pin 9.3.2. Real Bazel builds are blocked in the sandbox (see backlog item 1), so no Hosted, Vendored or Agent cell has been tested on a build yet.
44

55
Bazel support is experimental. The rows below are the rows of "Bazel workspaces: what is supported" in `docs/ecosystems.md`, which says what each cell promises and with which conditions. A cell here records what this routine saw on a real Bazel build: pass (Bazel release, date), fail (issue number), blocked (why) or untested.
66

77
## Coverage matrix
88

99
| Ecosystem, and how Bazel takes its packages | Hosted | Vendored | Agent (not supported: the build must still pass) | VEX | Nightly CI legs on `main` |
1010
|---|---|---|---|---|---|
11-
| npm: aspect_rules_js over a pnpm lock | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
12-
| PyPI: rules_python `pip.parse` over a requirements file | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
13-
| Go: gazelle `go_deps.from_file` over `go.mod` | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
14-
| RubyGems: rules_ruby `ruby.bundle_fetch` over `Gemfile.lock` | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
15-
| Cargo: rules_rust `crate.from_cargo` over `Cargo.lock` | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
16-
| NuGet: `nuget.from_lock` over `packages.lock.json` | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
17-
| Composer: a rule that runs `composer install` from `composer.lock` | untested | untested (declines by design) | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
18-
| Maven: rules_jvm_external `maven.install` with a `lock_file` | untested | untested | untested | untested | green 23, 24 and 25 Nov (2026-11-26) |
11+
| npm: aspect_rules_js over a pnpm lock | untested | untested | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
12+
| PyPI: rules_python `pip.parse` over a requirements file | untested | untested | untested | fail #2281 (no build: files only; no document for a hosted patch beside a virtualenv with the unpatched release) | green 24, 25 and 26 Nov (2026-11-26) |
13+
| Go: gazelle `go_deps.from_file` over `go.mod` | untested | untested | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
14+
| RubyGems: rules_ruby `ruby.bundle_fetch` over `Gemfile.lock` | untested | untested | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
15+
| Cargo: rules_rust `crate.from_cargo` over `Cargo.lock` | untested | untested | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
16+
| NuGet: `nuget.from_lock` over `packages.lock.json` | untested | untested | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
17+
| Composer: a rule that runs `composer install` from `composer.lock` | untested | untested (declines by design) | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
18+
| Maven: rules_jvm_external `maven.install` with a `lock_file` | untested | untested | untested | untested | green 24, 25 and 26 Nov (2026-11-26) |
1919

2020
| Outside a Bazel build | Result |
2121
|---|---|
22-
| A project in no Bazel workspace behaves exactly as v5.1.0 did | npm (pnpm lock v9): pass, main `cfc870f` against v5.1.0, 2026-11-26: same files and exit codes; output differs only by changes that are not Bazel's. Other ecosystems untested |
23-
| A project in a Bazel workspace that Bazel does not build | npm: pass under a `MODULE.bazel` with no hub and under a leftover `WORKSPACE`, 2026-11-26. Other ecosystems untested |
22+
| A project in no Bazel workspace behaves exactly as v5.1.0 did | npm (pnpm lock v9) and PyPI (hashed requirements.txt): pass, main `cfc870f` against v5.1.0, 2026-11-26: same files and exit codes; output differs only by changes that are not Bazel's. Other ecosystems untested |
23+
| A project in a Bazel workspace that Bazel does not build | npm and PyPI: pass under a `MODULE.bazel` with no hub and under a leftover `WORKSPACE`; PyPI also in `tools/` beside a `pip.parse` that reads another project's file, 2026-11-26. Other ecosystems untested |
2424

2525
## Backlog
26-
1. Feasibility: **blocked, 2026-11-26.** `bazel build` of a fixture stops at module resolution: the sandbox's network policy refuses `bcr.bazel.build` (HTTP 403 from the egress proxy). Also refused: `releases.bazel.build` (9.3.2 installed only from an existing cache), `mirror.bazel.build`, `patches-api.socket.dev`, `api.socket.dev`, `patch.socket.dev`. Reachable: `github.com`, `registry.npmjs.org`, `nodejs.org`. Each run: try one fixture build first (`cargo test -p socket-patch-cli --test e2e_bazel_build -- --ignored --exact npm::hosted_npm_translate_lock`, about 10 minutes to compile); while it fails on the registry, do only items 2, 3 and 8.
26+
1. Feasibility: **blocked, 2026-11-26.** `bazel build` of a fixture stops at module resolution: the sandbox's network policy refuses `bcr.bazel.build` (HTTP 403 from the egress proxy). Also refused: `releases.bazel.build` (9.3.2 installed only from an existing cache), `mirror.bazel.build`, `patches-api.socket.dev`, `api.socket.dev`, `patch.socket.dev`. Still so on the second run of 2026-11-26. Reachable: `github.com/SocketDev/socket-patch` only (other GitHub repositories answer 403, so new Bazel and ruleset releases cannot be looked up either), `registry.npmjs.org`, `nodejs.org`, `pypi.org`, `proxy.golang.org`. Each run: try one fixture build first (`cargo test -p socket-patch-cli --test e2e_bazel_build -- --ignored --exact npm::hosted_npm_translate_lock`, about 10 minutes to compile); while it fails on the registry, do only items 2, 3 and 8.
2727
2. The latest nightly run of each `bazel-*.yml` workflow on `main`: which legs are red, and whether an open issue covers each.
28-
3. A project in no Bazel workspace, and one in a workspace that Bazel does not build: main against v5.1.0. npm is done; next PyPI (requirements file), then Go, RubyGems, Cargo, NuGet, Composer, Maven. No public patch API here: use a loopback stand-in shaped like `tests/hosted_memory_common/mod.rs` (`--api-url`, `--org test-org`, `SOCKET_PATCH_SERVER_URL`).
28+
3. A project in no Bazel workspace, and one in a workspace that Bazel does not build: main against v5.1.0. npm and PyPI are done; next Go, then RubyGems, Cargo, NuGet, Composer, Maven. No public patch API here: use a loopback stand-in shaped like `tests/hosted_memory_common/mod.rs` (`--api-url`, `--org test-org`, `SOCKET_PATCH_SERVER_URL`).
2929
4. Hosted mode, one ecosystem per run, in the order of the table (npm first): the mode's one command, `bazel build`, the patched package in the build, `vex`, the undo, `bazel build` again.
3030
5. Vendored mode, the same way, for the rows the docs list as Supported; for the rows that decline, the command exits 1, writes nothing and the build still passes.
3131
6. Agent mode in a Bazel workspace: the message says what to use instead, and the build still passes.
3232
7. `vex` in each row: `not_affected` only for a package the Bazel build takes patched.
3333
8. The docs table against what you saw: a cell that promises more than the build holds.
34-
9. Shapes, npm first: a committed `MODULE.bazel.lock` with `--lockfile_mode=error`, two hubs, a monorepo Bazel builds in part, a `.bazelrc` with a repository cache or a downloader config, a `WORKSPACE` file beside `MODULE.bazel`.
34+
9. File-level checks that need no build, per ecosystem (done for PyPI, 2026-11-26: the vendored decline writes nothing; hosted and download-cache undo give `requirements.txt` and `.bazelrc` back byte for byte, also for a `.bazelrc` with CRLF, without a final newline or missing): next the Go fixture (`.bazelignore` lines and their undo).
35+
10. Shapes, npm first: a committed `MODULE.bazel.lock` with `--lockfile_mode=error`, two hubs, a monorepo Bazel builds in part, a `.bazelrc` with a repository cache or a downloader config, a `WORKSPACE` file beside `MODULE.bazel`.
3536

3637
## Known non-bugs
37-
See `known-non-bugs/bazel.md` (3 entries, all artifacts of a home-made stand-in API or output changes that are not Bazel's).
38+
See `known-non-bugs/bazel.md` (6 entries). Most likely to be re-filed: an empty `.bazelrc` of the user's is removed by the undo of a PyPI download cache (documented); v5.1.0 counts the machine's Python packages in `scannedPackages` and main does not (not Bazel's).

0 commit comments

Comments
 (0)