From 71fb4ac275a41e6c013ae66ddcc7ee2b6b4b4a2c Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 6 Nov 2026 00:58:57 +0000 Subject: [PATCH] fix(deps): make the weekly Dependabot cargo jobs runnable again turso_core prerelease requirement over a stable lock, path-dep fixtures picking up bashkit's workspace deps, and fork-only Monty deps being bumped. --- .github/dependabot.yml | 64 +++++++++++++- Cargo.toml | 8 +- knowledge/log.md | 4 + knowledge/operations/dependencies.md | 15 ++++ scripts/tests/test_dependabot_coverage.py | 101 ++++++++++++++++++++++ 5 files changed, 188 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5a41a73aa..13a541b9d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -45,6 +45,39 @@ updates: - dependency-name: "monty-types" - dependency-name: "monty-macros" + # Crates only the two forks declare. The forks track Monty 1.4.0's own + # dependency versions and move only when upstream source is re-copied; + # a Dependabot bump edits the fork manifests directly (#2848 bumped + # ruff_python_* 0.0.14 -> 0.0.20 and unicode_names2 1 -> 4, and failed + # CI). Deps the forks share with bashkit's own crates (fancy-regex, + # chrono, sha2, ...) are not listed: bashkit must be able to move them, + # and CI shows whether the fork still builds. + # scripts/tests/test_dependabot_coverage.py keeps this list complete. + - dependency-name: "ahash" + - dependency-name: "hashbrown" + - dependency-name: "itertools" + - dependency-name: "itoa" + - dependency-name: "jiff" + - dependency-name: "jiter" + - dependency-name: "libm" + - dependency-name: "memchr" + - dependency-name: "minicbor-serde" + - dependency-name: "num-integer" + - dependency-name: "postcard" + - dependency-name: "ruff_python_ast" + - dependency-name: "ruff_python_codegen" + - dependency-name: "ruff_python_parser" + - dependency-name: "ruff_python_stdlib" + - dependency-name: "ruff_source_file" + - dependency-name: "ruff_text_size" + - dependency-name: "serde_bytes" + - dependency-name: "smallvec" + - dependency-name: "speedate" + - dependency-name: "strum" + - dependency-name: "unicode-general-category" + - dependency-name: "unicode-normalization" + - dependency-name: "unicode_names2" + # wasmtime is pinned exactly (=48.0.6): the `cpython` feature embeds a # module precompiled by build.rs, and a precompiled module loads only # into the same wasmtime version. 49.x also needs a newer rustc than @@ -149,6 +182,21 @@ updates: # # Grouped per directory: these are example and fixture builds, so a week of # bumps should arrive as one reviewable PR each. + # + # `allow` names only the crates these manifests declare themselves. Each one + # path-depends on `crates/bashkit`, and Dependabot follows that path into the + # root workspace and treats every `workspace = true` dep of bashkit as a + # direct dep of this directory. Those requirements live in the root manifest + # (the "/" entry owns them), and the optional ones (num-bigint, pyo3 via the + # python feature) are in no lockfile here, so the grouped update had nothing + # to change for them and aborted with InvalidUpdatedDependencies on every + # run since 2026-10-13. A new direct dep in one of these manifests must be + # added to `allow`, or it goes unwatched. + # + # `versioning-strategy: increase` because the two random-fs fixtures have no + # committed lockfile: an in-range bump there has no previous version and no + # requirement change, which Dependabot also rejects. Raising the requirement + # gives every update a visible change. - package-ecosystem: "cargo" directories: - "/examples/hyperlight" @@ -159,15 +207,25 @@ updates: interval: "weekly" commit-message: prefix: "chore(deps)" + versioning-strategy: increase + allow: + - dependency-name: "wit-bindgen" + - dependency-name: "futures-util" + - dependency-name: "getrandom" + - dependency-name: "wasmtime" + - dependency-name: "napi" + - dependency-name: "napi-derive" + - dependency-name: "napi-build" + - dependency-name: "pyo3" groups: example-cargo: patterns: - "*" ignore: # `examples/hyperlight/host` pins wasmtime "48" and is built by required - # CI (the "WASM component (no JS, no WASI)" job) on the same pinned - # 1.95.0 toolchain, so a 49.x bump here fails resolution exactly as it - # did in #2708. Keep in step with the "/" entry; see the rationale there. + # CI (the "WASM component (no JS, no WASI)" job) on the pinned toolchain, + # so a 49.x bump here fails resolution exactly as it did in #2708. Keep + # in step with the "/" entry; see the rationale there. - dependency-name: "wasmtime" # npm / pnpm. diff --git a/Cargo.toml b/Cargo.toml index 46f61e7a1..d832d0e0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -145,7 +145,13 @@ tower = { version = "0.5", features = ["util"] } russh = "0.65" # Embedded SQLite engine (Turso, pure Rust). Upstream is BETA — gated behind # the `sqlite` feature and disabled by default; see knowledge/runtimes/sqlite-builtin.md. -turso_core = "0.8.0-pre.1" +# Stable requirement on purpose. A prerelease requirement (it was "0.8.0-pre.1" +# while the lockfile held 0.8.3) makes Dependabot treat prereleases like +# 0.9.0-pre.2 as in range and try a lockfile-only `cargo update --precise`, +# which cargo rejects (`^0.8.0-pre.1` stops below 0.9). That failed the weekly +# "/" update job on every run since 2026-10-19. A deliberate prerelease bump +# edits this line by hand. +turso_core = "0.8.3" # Not used by any bashkit code. Present only to turn ON `branches/std` for the # whole graph: `turso_core` depends on `branches` with `default-features = false`, # and the resulting no_std path compiles `core::intrinsics::abort()`, which rustc diff --git a/knowledge/log.md b/knowledge/log.md index aec241072..6f4002a6f 100644 --- a/knowledge/log.md +++ b/knowledge/log.md @@ -1,5 +1,9 @@ # Bashkit Knowledge Update Log +## 2026-11-06 + +* **Dependabot jobs green again**: the weekly cargo "/" job failed since 2026-10-19 because `turso_core = "0.8.0-pre.1"` (lock at 0.8.3) made Dependabot try 0.9.0-pre.2 as an in-range lockfile update, which cargo rejects; the requirement is now the stable `0.8.3`. The example/fixture job failed since 2026-10-13 because Dependabot follows the `crates/bashkit` path dep into the root workspace and tries to bump bashkit's own (root-owned, partly optional) deps; that entry now `allow`s only each manifest's own deps and uses `versioning-strategy: increase` for the lockfile-less fixtures. Crates only the Monty forks declare are ignored in the "/" entry so they move with upstream (#2848 had bumped them and broke the build). All three are pinned by `scripts/tests/test_dependabot_coverage.py`. See [Dependencies](operations/dependencies.md). + ## 2026-11-05 * **Writes through links under linked dirs**: `> dl/link` (with `dl -> sub`, `sub/link -> ../file`) replaced `sub/link` with a regular file and `>>` failed with NotFound, because the write path resolved only the parents once the inner `stat` failed. Writes now resolve the final component too (issue #2829). See [Virtual Filesystem](foundations/vfs.md#symlink-handling). diff --git a/knowledge/operations/dependencies.md b/knowledge/operations/dependencies.md index e69186917..c59b15f89 100644 --- a/knowledge/operations/dependencies.md +++ b/knowledge/operations/dependencies.md @@ -168,6 +168,21 @@ against a newer oxc, and then means bumping the pinned toolchain and porting the vendored parser in one deliberate change — not inside an aggregated `chore(deps)` PR. +## Dependabot rules that keep its jobs runnable + +- No prerelease requirement over a stable lock: `turso_core = "0.8.0-pre.1"` + with 0.8.3 locked made Dependabot treat 0.9.0-pre.2 as in range and fail the + whole "/" job. Require the stable version; bump to a prerelease by hand. +- Directories that path-depend on `crates/bashkit` (hyperlight guest, the two + random-fs fixtures) see bashkit's workspace deps as their own. Their entry + `allow`s only the crates their manifests declare, with + `versioning-strategy: increase` because the fixtures commit no lockfile. +- Crates only the Monty forks declare are ignored in the "/" entry: the forks + keep Monty 1.4.0's versions until upstream source is re-copied. Shared deps + stay bumpable. + +`scripts/tests/test_dependabot_coverage.py` enforces all three. + ## Measure size and audit surface separately The `idna_adapter` pin removes 21 crates but only **15 KB (0.16%)** from the diff --git a/scripts/tests/test_dependabot_coverage.py b/scripts/tests/test_dependabot_coverage.py index 3d4b52fbd..dc43c6a79 100644 --- a/scripts/tests/test_dependabot_coverage.py +++ b/scripts/tests/test_dependabot_coverage.py @@ -21,6 +21,7 @@ """ from pathlib import Path +import tomllib import unittest import yaml @@ -152,6 +153,106 @@ def test_no_cargo_entry_can_propose_a_wasmtime_bump(self): 'compatibility, so every cargo entry must ignore it', ) + def test_entries_that_path_depend_on_bashkit_allow_only_own_deps(self): + # A manifest that path-depends on crates/bashkit makes Dependabot walk + # into the root workspace and treat every `workspace = true` dep of + # bashkit as this directory's own. It cannot change those (the root + # manifest holds them) and the optional ones are in no lockfile here, + # so the grouped job aborted with InvalidUpdatedDependencies every week + # (2026-10-13 .. 2026-11-06). The fix is an `allow` list; this keeps it + # complete, since a dep missing from it is silently never updated. + config = yaml.safe_load(CONFIG.read_text()) + checked = 0 + for entry in config['updates']: + if entry['package-ecosystem'] != 'cargo': + continue + dirs = entry.get('directories') or [entry.get('directory')] + for d in dirs: + manifest = ROOT / d.lstrip('/') / 'Cargo.toml' + data = tomllib.loads(manifest.read_text()) + deps = {} + for table in ('dependencies', 'build-dependencies', 'dev-dependencies'): + deps.update(data.get(table) or {}) + if not any( + isinstance(v, dict) and 'path' in v and 'bashkit' in v['path'] + for v in deps.values() + ): + continue + checked += 1 + allowed = {a.get('dependency-name') for a in entry.get('allow') or []} + own = { + name for name, v in deps.items() + if not (isinstance(v, dict) and 'path' in v) + } + with self.subTest(directory=d): + self.assertTrue(allowed, f'{d} path-depends on bashkit but its entry has no allow list') + self.assertFalse(own - allowed, f'{d}: direct deps missing from allow: {sorted(own - allowed)}') + # hyperlight guest + the two random-fs fixtures (the fuzz crate uses + # `path = ".."` and its job is green, so it is not matched). + self.assertGreaterEqual(checked, 3) + + def test_root_requirements_are_not_prereleases_over_a_stable_lock(self): + # `turso_core = "0.8.0-pre.1"` with 0.8.3 locked made Dependabot think + # 0.9.0-pre.2 was in range; its lockfile-only update then failed in + # cargo (`^0.8.0-pre.1` stops below 0.9) and reddened the weekly "/" + # job from 2026-10-19 on. Require the stable version once one is locked. + workspace = tomllib.loads((ROOT / 'Cargo.toml').read_text())['workspace'] + lock = tomllib.loads((ROOT / 'Cargo.lock').read_text()) + locked = {} + for pkg in lock['package']: + locked.setdefault(pkg['name'], []).append(pkg['version']) + for name, spec in workspace['dependencies'].items(): + req = spec if isinstance(spec, str) else spec.get('version') + if not req or '-' not in req: + continue + versions = locked.get(spec.get('package', name) if isinstance(spec, dict) else name, []) + with self.subTest(dependency=name): + self.assertFalse( + any('-' not in v for v in versions), + f'{name} requires prerelease {req!r} but the lock holds {versions}; ' + 'use the stable version so Dependabot does not offer out-of-range prereleases', + ) + + def test_fork_only_deps_are_ignored_by_the_root_entry(self): + # crates/bashkit-monty(-types) are forks of Monty 1.4.0 and keep its + # dependency versions until upstream source is re-copied. Crates only + # they declare must not be bumped by Dependabot (#2848 did, and broke + # the fork build). Shared ones stay bumpable for bashkit's sake. + def direct(manifest): + data = tomllib.loads(manifest.read_text()) + names = set() + for table in ('dependencies', 'build-dependencies', 'dev-dependencies'): + for name, spec in (data.get(table) or {}).items(): + if isinstance(spec, dict) and 'path' in spec: + continue + if isinstance(spec, dict): + name = spec.get('package', name) + names.add(name) + return names + + forks = ('bashkit-monty', 'bashkit-monty-types') + fork_deps = set().union(*(direct(ROOT / 'crates' / f / 'Cargo.toml') for f in forks)) + other = set() + for manifest in (ROOT / 'crates').glob('*/Cargo.toml'): + if manifest.parent.name not in forks: + other |= direct(manifest) + fork_only = fork_deps - other + self.assertGreaterEqual(len(fork_only), 10, fork_only) + + config = yaml.safe_load(CONFIG.read_text()) + root = next( + u for u in config['updates'] + if u['package-ecosystem'] == 'cargo' and u.get('directory') == '/' + ) + ignored = { + i.get('dependency-name') for i in root.get('ignore') or [] + if not i.get('update-types') + } + self.assertFalse( + fork_only - ignored, + f'fork-only deps Dependabot may bump: {sorted(fork_only - ignored)}', + ) + def test_config_is_a_well_formed_dependabot_v2_file(self): config = yaml.safe_load(CONFIG.read_text()) self.assertEqual(config['version'], 2)