diff --git a/docs/ecosystems.md b/docs/ecosystems.md index 31eabcfd0..5590a6414 100644 --- a/docs/ecosystems.md +++ b/docs/ecosystems.md @@ -46,13 +46,15 @@ below is about what a package manager installs and builds. The matrix above lists what each mode handles. This table says how much that support is worth for v5.x. v5 removes no format or mode: everything in the matrix works in v5.0 -and keeps working through v5.x. +and keeps working through v5.x. The Experimental tier is the exception: what it covers is +new in v5.x and can change. | Tier | Meaning | |---|---| | **Supported** | The default. Covered by CI. A regression is a release blocker. | | **Beta** | Works for the build shapes documented on this page and is tested in CI. Some shapes outside them are refused, and the open issues for that ecosystem describe shapes that are patched incompletely. Preview with `--dry-run` and confirm with a real build before you commit the result. | | **Legacy** | A format that the package manager itself has retired. socket-patch keeps reading and writing it in v5 and still fixes its bugs, but adds no new features for it. Prefer the upgrade path in the table below. | +| **Experimental** | New, and tested in CI only on the build shapes its section lists. What a command does, what it writes and how it words a refusal can change in any v5.x release, and a regression is not a release blocker. Preview with `--dry-run` and confirm with a real build before you commit the result. | | **Not supported** | Refused with an error code that names the remedy. | | Ecosystem / format | agent | vendored | hosted | @@ -67,6 +69,7 @@ and keeps working through v5.x. | Gradle | Supported, with the [`files-2.1` advisories](#gradle) | Beta (Gradle 6.8+) | Beta (Gradle 6.8+) | | sbt / Mill / scala-cli | Beta | Beta (sbt and scala-cli directory builds; Mill is not wired) | Beta (Mill and scala-cli get manual snippets only) | | Deno | Supported | Not supported | Not supported | +| A project in a Bazel workspace: everything socket-patch does differently there, `vex` included (see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported)) | No tier: agent mode is not for a Bazel build | Experimental where that section's table says Supported; elsewhere what the table says | Experimental, the same | **Hosted and vendored Maven and Gradle are Beta in v5.** Each wiring is built to fail closed: hosted mode and vendored Maven pin a Socket-only `-socket.` version, and @@ -96,7 +99,10 @@ Each Legacy format has an upgrade path and an undo path. Both work in v5: and do not make a format refuse that v5.0 accepts. Bug fixes can still refuse a specific input that would otherwise produce a wrong result. Each refusal has an error code and a remedy. -- **A tier can move up** (Beta to Supported) in any release. A move down, or a new +- **The Experimental tier is outside that rule.** What it covers was not in v5.0. A v5.x + release can change what its commands do, write, refuse and report there, and says so in + the release notes. +- **A tier can move up** (Experimental to Beta, Beta to Supported) in any release. A move down, or a new Legacy entry, is announced in the release notes and on this page. - **Removing write support for a Legacy format** can happen only in a major release. The removed path becomes a refusal with an error code and a re-lock remedy. socket-patch @@ -1481,6 +1487,8 @@ Honest limits of the Maven and NuGet flows — documented behavior, not bugs: ## Bazel workspaces: NuGet +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + rules_csharp's `nuget.from_lock` tag (in `MODULE.bazel`) downloads every package of a `packages.lock.json` and fails the build on a file that does not match the lock's `contentHash`. All the `nuget.from_lock` tags of a workspace make one hub (rules_csharp 0.5.0): @@ -1981,6 +1989,18 @@ the repository list, so it is left as a ## Bazel workspaces: what is supported +**Everything socket-patch does differently because a project is in a Bazel workspace is +experimental** (see the [v5 support tiers](#v5-support-tiers)): the modes this section +describes, what `vex` says there, the `.bazelignore` lines, and the refusals and warnings +that only a Bazel workspace brings, also for a project in the workspace that Bazel does not +build. It is new, each ruleset is an integration of its own, and a Bazel build fails late: +a command can exit 0 and the build after it can still fail or take the unpatched package, +in any shape the table below does not list as Supported (the known problems name some). So +what the commands do there, the files they write and the words of their refusals can +change in any v5.x release. After a command, build with Bazel before you commit the result. +None of it applies to a project that is in no Bazel workspace: there socket-patch does what +the rest of this page says. + A Bazel build takes each package from what a ruleset reads in the checkout (a lock, a call in `MODULE.bazel`), in a repository of Bazel's own, and not from the copies a package manager installed. So the [matrix at the top](#mode--ecosystem-matrix) does not carry over to a @@ -2176,6 +2196,8 @@ And three that concern neither: ## Bazel workspaces: npm +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + aspect_rules_js reads the pnpm lock itself, so a hosted pin in `pnpm-lock.yaml` is what the build links, and no pnpm runs. One wiring differs. With `update_pnpm_lock = True` on `npm.npm_translate_lock`, rules_js runs a pnpm of its own during the build whenever the lock @@ -2277,6 +2299,8 @@ when it decides this: see the known problems of ## Bazel workspaces: Maven +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + A rules_jvm_external hub (`maven.install` in `MODULE.bazel`) builds the jars that its own lock, `maven_install.json`, names, each at the sha256 the lock holds. It reads no `pom.xml` and no Gradle file. A lock with `m2local` takes a jar that none of its repositories lists from the @@ -2520,6 +2544,8 @@ Limits: ## Bazel workspaces: Cargo +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + A crate_universe hub of rules_rust (`crate.from_cargo` in `MODULE.bazel`, `crates_repository` in a `WORKSPACE` file) builds its crates from the `Cargo.toml` files and the `Cargo.lock` it names. Its tool, cargo-bazel, links what stands beside each of those `Cargo.toml` files into a @@ -2864,6 +2890,8 @@ version = "1.0.4+socket." ## Bazel workspaces: the build file in a vendored crate +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + A rules_rust crate hub (`crate.from_cargo`) builds a vendored crate from its copy under `.socket/vendor/cargo`: the build after `scan --mode vendored` is the patched one, with no repin. From rules_rust 0.59.0 on, the hub's tool, cargo-bazel, also writes a `BUILD.bazel` @@ -3067,6 +3095,8 @@ with the command that does, and ### Bazel workspaces: `.bazelignore` +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + In a Bazel workspace the module copies of vendored and agent mode are directories that Bazel and gazelle walk like any other. A BUILD file in a copy (one the module ships, or the one `bazel run //:gazelle` writes there) is then a package of the workspace, gazelle's `go_deps` @@ -3357,6 +3387,8 @@ The implemented hosted shape and fresh-checkout behavior are exercised by ## Bazel workspaces: Composer +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + No Bazel ruleset builds PHP or takes Composer packages, so a PHP project in a Bazel workspace brings its packages into the build with a few lines of its own: a repository rule or a genrule that runs `composer install` from the committed `composer.lock`, or a committed `vendor/` tree @@ -3849,6 +3881,8 @@ restores the original sources and build. ## Bazel workspaces: RubyGems +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + rules_ruby's `ruby.bundle_fetch` tag (in `MODULE.bazel`) downloads every gem of its `gemfile_lock` with Bazel's downloader. Its `gem_checksums` names a sha256 per gem, under `-` (the words of the gem's line in the lock, so `-` for a @@ -3946,6 +3980,8 @@ What is read, and what is not: ## Bazel workspaces: VEX +*Experimental: see [Bazel workspaces: what is supported](#bazel-workspaces-what-is-supported).* + `vex` and `--vex` read what socket-patch wrote and what the project's own package manager installed. In a Bazel workspace (the Bazel root of the section on `.bazelignore` above) they also read `MODULE.bazel` and the files it includes, for the calls of three rulesets that hand diff --git a/docs/migrating-to-v5.md b/docs/migrating-to-v5.md index 4eb4ef566..45cf079d8 100644 --- a/docs/migrating-to-v5.md +++ b/docs/migrating-to-v5.md @@ -177,6 +177,9 @@ v5 keeps every lockfile format in the support matrix, including the ones the pac managers have retired. The [v5 support tiers](ecosystems.md#v5-support-tiers) say how mature each one is. +- **Experimental:** what socket-patch does for a project in a Bazel workspace. It is new + in v5.x and can change in any v5.x release; see + [Bazel workspaces: what is supported](ecosystems.md#bazel-workspaces-what-is-supported). - **Beta:** Maven and Gradle in hosted and vendored mode, and sbt / Mill / scala-cli. They work for the documented build shapes. Run the build before you rely on the result or on a `--vex` document. diff --git a/docs/usage.md b/docs/usage.md index 7ef597cee..990002789 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -299,8 +299,8 @@ any file, so it also attests an agent-mode patch whose files are unpatched or mi It never does so silently: the run warns how many statements it emitted that way, and each one ends its impact statement with `; not verified on disk`. -In a Bazel workspace the document describes what Bazel builds from the project's lock, and -says `affected` of a package whose patch is only in the installed copy (see +In a Bazel workspace (experimental) the document describes what Bazel builds from the +project's lock, and says `affected` of a package whose patch is only in the installed copy (see [Bazel workspaces: VEX](ecosystems.md#bazel-workspaces-vex)). `--no-bazel` (`--vex-no-bazel` on `scan`, `apply` and `vendor`, or `SOCKET_VEX_NO_BAZEL` in the environment) makes it describe what the package manager installed; use it when the installed tree is what you ship. @@ -339,6 +339,8 @@ scala-cli resolve into (restart a running sbt server, Bloop or Metals after [ecosystem caveats](ecosystems.md) before using agent mode in shared environments. The removed `setup` command is covered in the [migration guide](migrating-to-v5.md). +What socket-patch does in a Bazel workspace is experimental +([Bazel workspaces: what is supported](ecosystems.md#bazel-workspaces-what-is-supported)). Agent mode is not supported for a package that Bazel builds: Bazel takes its packages from what its rulesets read, and runs no `socket-patch apply`. Use hosted mode there, or vendored mode where [Bazel workspaces: what is supported](ecosystems.md#bazel-workspaces-what-is-supported)