Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9bd7d4f
Test PyPI and RubyGems vendored mode beside a Bazel hub on real Bazel
mikolalysenko Nov 23, 2026
9c9f202
Decline PyPI and RubyGems vendored mode where a Bazel hub reads the lock
mikolalysenko Nov 23, 2026
2d652c5
Close three ways a vendored run could still write a file a Bazel hub …
mikolalysenko Nov 23, 2026
9a022a8
Decline a vendored run where a hub reads a parent file or is in doubt
claude Nov 24, 2026
2e0f2d3
Test what vendored mode does for a NuGet package of a rules_csharp hu…
mikolalysenko Nov 20, 2026
89f7310
Make vendored mode work for a NuGet package of a rules_csharp hub, or…
mikolalysenko Nov 24, 2026
af5dd83
Merge main into vendored mode for a NuGet package of a rules_csharp hub
mikolalysenko Nov 24, 2026
fadf0e9
Keep the block of a rules_csharp hub right through an undo, a later p…
mikolalysenko Nov 24, 2026
ac313c0
Merge remote-tracking branch 'origin/main' into bazel-guard/vendored-…
mikolalysenko Nov 24, 2026
66d9cd1
Merge remote-tracking branch 'origin/main' into bazel-guard/vendored-…
mikolalysenko Nov 24, 2026
5d958bc
Build the NuGet hub tests on Windows
mikolalysenko Nov 24, 2026
23398b6
Accept either unseen repository where a Cargo flow comments out the i…
mikolalysenko Nov 24, 2026
f3e5623
Hold the unseen repository to Bazel's own words, and say so in the docs
mikolalysenko Nov 24, 2026
30cb8cc
Merge main into bazel-vendored/nuget-feed-block
claude Nov 25, 2026
ec60674
Merge remote-tracking branch 'origin/main' into bazel-guard/vendored-…
mikolalysenko Nov 25, 2026
8d6f447
Merge main into bazel-vendored/nuget-feed-block
claude Nov 25, 2026
4fe3b14
Pass over a WORKSPACE file where the checkout names Bazel 9 or later
mikolalysenko Nov 25, 2026
b84835d
Merge main into vendored mode for a NuGet package of a rules_csharp hub
mikolalysenko Nov 25, 2026
49b963e
Merge remote-tracking branch 'origin/main' into bazel-guard/vendored-…
mikolalysenko Nov 25, 2026
6b67c81
Hold the off switch and the VEX answer to a NuGet package vendored fo…
mikolalysenko Nov 25, 2026
de7cc74
Decline a NuGet package for vendored mode where a hub may read the lo…
mikolalysenko Nov 25, 2026
cc616d1
Merge main into vendored mode for a NuGet package of a rules_csharp hub
mikolalysenko Nov 25, 2026
4dde8a2
Say both ways a hub that is not seen fails after a flat vendored run
mikolalysenko Nov 25, 2026
bb5cdb2
Merge the PyPI and RubyGems vendored refusals into vendored mode for …
mikolalysenko Nov 25, 2026
af5b810
Merge main into vendored mode for a NuGet package of a rules_csharp hub
mikolalysenko Nov 25, 2026
3e12698
Hold the NuGet vendored gate apart from a WORKSPACE file
mikolalysenko Nov 25, 2026
749b2a3
Merge main into vendored mode for a NuGet package of a rules_csharp hub
mikolalysenko Nov 25, 2026
3599739
Merge main into vendored mode for a NuGet package of a rules_csharp hub
mikolalysenko Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions .github/workflows/bazel-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Bazel patch compatibility (NuGet)
# The NuGet flows of the real-Bazel tests (`nuget::` in `e2e_bazel_build`):
# hosted mode for a package that rules_csharp's `nuget.from_lock` reads from
# `packages.lock.json` and `nuget.config`, for a tag that names no
# `nuget_config`, and agent mode for the copy of the package in NuGet's
# global packages folder, on each Bazel release below.
# `nuget_config`, agent mode for the copy of the package in NuGet's
# global packages folder, and vendored mode for the same package, through
# the block it keeps in `MODULE.bazel`, on each Bazel release below.
# bazel-compatibility.yml holds the legs and what every ecosystem shares;
# this file says when the NuGet legs run and on which releases.
#
Expand Down Expand Up @@ -40,10 +41,15 @@ on:
# files, the upstream restore of `rollback`, and the hosted scan's check
# of that folder. Then what reads the tag in `MODULE.bazel`: the reader
# of the workspace files, which every ecosystem's flow shares
# (bazel/mod.rs, starlark.rs and workspace.rs), and what hosted mode
# makes of the tag (bazel/nuget.rs).
# vendor/nuget_feed.rs is the vendored backend; it is here for the
# version and folder helpers that every one of those files calls.
# (bazel/mod.rs, starlark.rs and workspace.rs), and what hosted and
# vendored mode make of the tag (bazel/nuget.rs).
# vendor/nuget_feed.rs is the vendored backend, which the vendored flow
# runs; every one of those files calls its version and folder helpers.
# The vendored flow also runs through the block of `MODULE.bazel`
# (bazel/block.rs), what bazel/maven.rs shares with it (the label of a
# `use_extension` and the release of a ruleset), what names the Bazel
# release and the rc files (bazel/rc.rs), and the dispatch of the
# refusals of vendored mode (vendor/refusals.rs).
# patch/sidecars/nuget.rs is what agent mode does to a package in
# NuGet's folder beyond its files. Last, the VEX code: `vex/` of the
# core, the files of the `vex` command, and what `vex` makes of the tag
Expand Down Expand Up @@ -78,9 +84,13 @@ on:
- 'crates/socket-patch-core/src/vex/discover/nuget.rs'
- 'crates/socket-patch-core/src/patch/redirect/upstream/nuget.rs'
- 'crates/socket-patch-cli/src/commands/scan/hosted/nuget.rs'
- 'crates/socket-patch-core/src/vendor/refusals.rs'
- 'crates/socket-patch-core/src/bazel/block.rs'
- 'crates/socket-patch-core/src/bazel/built.rs'
- 'crates/socket-patch-core/src/bazel/maven.rs'
- 'crates/socket-patch-core/src/bazel/mod.rs'
- 'crates/socket-patch-core/src/bazel/nuget.rs'
- 'crates/socket-patch-core/src/bazel/rc.rs'
- 'crates/socket-patch-core/src/bazel/starlark.rs'
- 'crates/socket-patch-core/src/bazel/workspace.rs'
- 'crates/socket-patch-core/src/patch/sidecars/nuget.rs'
Expand All @@ -92,8 +102,11 @@ on:
# root of the test target (it changes when an ecosystem's module is
# added; ci.yml builds the target and runs its hermetic tests on every
# pull request), the shared engine code and test helpers the flows run
# through, and the toolchain files. A main push outside this list waits
# for the nightly run below.
# through, the ledger and the artifact paths of vendored mode
# (vendor/state.rs and vendor/path.rs, which every ecosystem shares:
# they hold the record of the block and the place of a hub's package),
# and the toolchain files. A main push outside this list waits for the
# nightly run below.
paths:
- '.github/workflows/bazel-nuget.yml'
- '.github/workflows/bazel-compatibility.yml'
Expand All @@ -109,9 +122,13 @@ on:
- 'crates/socket-patch-core/src/vex/discover/nuget.rs'
- 'crates/socket-patch-core/src/patch/redirect/upstream/nuget.rs'
- 'crates/socket-patch-cli/src/commands/scan/hosted/nuget.rs'
- 'crates/socket-patch-core/src/vendor/refusals.rs'
- 'crates/socket-patch-core/src/bazel/block.rs'
- 'crates/socket-patch-core/src/bazel/built.rs'
- 'crates/socket-patch-core/src/bazel/maven.rs'
- 'crates/socket-patch-core/src/bazel/mod.rs'
- 'crates/socket-patch-core/src/bazel/nuget.rs'
- 'crates/socket-patch-core/src/bazel/rc.rs'
- 'crates/socket-patch-core/src/bazel/starlark.rs'
- 'crates/socket-patch-core/src/bazel/workspace.rs'
- 'crates/socket-patch-core/src/patch/sidecars/nuget.rs'
Expand All @@ -120,6 +137,8 @@ on:
- 'crates/socket-patch-cli/tests/e2e_bazel_build/main.rs'
- 'crates/socket-patch-core/src/patch/redirect/**'
- 'crates/socket-patch-core/src/hosted/**'
- 'crates/socket-patch-core/src/vendor/path.rs'
- 'crates/socket-patch-core/src/vendor/state.rs'
- 'crates/socket-patch-cli/src/commands/**'
- 'crates/socket-patch-cli/tests/common/**'
- 'crates/socket-patch-cli/tests/hosted_memory_common/**'
Expand Down
15 changes: 8 additions & 7 deletions crates/socket-patch-cli/CLI_CONTRACT.md

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions crates/socket-patch-cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,15 @@ pub struct GlobalArgs {
/// a package by default: a Composer package
/// (`vendor_composer_bazel_workspace`), whose lock names the copy by a
/// path that a Bazel rule running `composer install` in another
/// directory does not find, and a PyPI or RubyGems package whose lock
/// a rules_python or rules_ruby hub of the workspace reads
/// directory does not find; a PyPI or RubyGems package whose lock a
/// rules_python or rules_ruby hub of the workspace reads
/// (`vendor_pypi_bazel_hub`, `vendor_gem_bazel_hub`), which builds
/// nothing from a lock that names a copy under `.socket/vendor`. Pass
/// it when the build does find the copy, or does not take the
/// project's packages from that lock. Other subcommands accept it
/// silently.
/// nothing from a lock that names a copy under `.socket/vendor`; and a
/// NuGet package of a rules_csharp hub where the `MODULE.bazel` block
/// that makes the hub take the copy cannot be shown to work
/// (`vendor_nuget_bazel_workspace`). Pass it when the build does find
/// the copy, does not take the project's packages from that lock, or
/// does not build the project. Other subcommands accept it silently.
#[arg(
help_heading = GLOBAL_OPTIONS,
long = "allow-vendored-in-bazel",
Expand Down
15 changes: 15 additions & 0 deletions crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,21 @@ impl Cell {
self.downloads = Some(rules.to_vec());
}

/// Take the file whose sha256 is `sha256` out of the repository cache,
/// which the tests of a leg and every twin share: whether it was
/// there. Bazel then has to fetch that file again from where its URLs
/// lead, as on a machine that never had it.
pub fn uncache(&self, sha256: &str) -> bool {
let cache = &self.scratch.repository_cache;
let entry = cache.join("content_addressable/sha256").join(sha256);
let held = entry.join("file").is_file();
if held {
std::fs::remove_dir_all(&entry)
.unwrap_or_else(|e| panic!("remove {}: {e}", entry.display()));
}
held
}

/// Whether the repository cache of this cell, which its twins share,
/// holds a download with the sha256 `sha256`: what Bazel's downloader
/// keeps of a file it fetched under a checksum.
Expand Down
Loading
Loading