Skip to content

ast10x0: Make the SoC target a nested Bazel module - #671

Open
rusty1968 wants to merge 9 commits into
mainfrom
ast10x0-target
Open

rusty1968 wants to merge 9 commits into
mainfrom
ast10x0-target

Conversation

@rusty1968

@rusty1968 rusty1968 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Based on the guidelines of pigweed's adventure game project. A stepping stone for out-of-tree SoC modules.


Update: Since this PR was opened, its shape changed with 3 follow-up commits:

  • The pigweed/ureg commits, the opentitan_devbundle archive hash, the pw_rust cipd_tag,
    and 5 shared bazel_dep versions are no longer duplicated between MODULE.bazel and
    target/ast10x0/MODULE.bazel — they now live once in pins.MODULE.bazel, which both
    include().
  • presubmit/module_pins.py (the drift-detector for a subset of those same values) is
    removed; with nothing left to drift, a detect-after-the-fact check added no value, and
    its own docstring already said to delete it once the pins moved to a single source.
  • tools/sgpiom/README.md had a broken build example (a literal (from target/ast10x0)
    string left inside a copy-pasteable bash block by the bulk label rewrite) — fixed.

Verified both the root build and the standalone target/ast10x0 module build, at every step of the rebase onto main:

bazelisk mod graph --output=text
bazelisk query //...
run from the repo root, and again from inside target/ast10x0, after each conflict resolution — confirms the module graph resolves and every package loads cleanly on both sides.

Followed up with real compiles (not just query) on rot-beast:

From the repo root — exercises the VeeR PIC code the two Pigweed patches touch
bazelisk build //target/veer/...
→ 110 targets, 2473 actions, build succeeded.

Inside target/ast10x0 — the standalone nested-module build
cd target/ast10x0
bazelisk build //...
→ 366 targets, 2879 actions, build succeeded.

@rusty1968
rusty1968 marked this pull request as ready for review November 6, 2026 03:11
Comment thread presubmit/module_pins.py Resolved
@JesseMelon

JesseMelon commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The shape of this PR changed after the initial review, via 3 follow-up commits
(originally landed through #681, plus one more just now):

  1. presubmit: Share pigweed/ureg/pw_rust pins via MODULE.bazel include() instead of duplicating them
    — module_pins.py (added earlier in this stack) detected when pins drifted between the two
    MODULE.bazel files but didn't remove the duplication itself. This moves every such value
    (pigweed/ureg commits, the opentitan_devbundle archive hash, the pw_rust cipd_tag, and 5
    shared bazel_dep versions) into one new pins.MODULE.bazel, include()d by both. Since
    target/ast10x0 can't include() outside its own module tree, and root can't include()
    into target/ast10x0 (.bazelignore excludes it, and removing that exclusion breaks real
    package loading), target/ast10x0/pins.MODULE.bazel is a plain filesystem symlink back to
    the root copy.
  2. Remove module_pins.py now that pins.MODULE.bazel prevents the drift it detected — with
    nothing left to drift, a detect-after-the-fact check added no value.
  3. Minor doc fix.

Verified with bazelisk mod graph and a full bazelisk query //... on both the root build and
the standalone target/ast10x0 build after each change.

Leaving this open pending approval — flagging for re-review given the shape change, rather than
assuming the earlier review still covers it.

@JesseMelon
JesseMelon force-pushed the ast10x0-target branch 4 times, most recently from b5836e9 to 1593195 Compare November 19, 2026 16:27
rusty1968 and others added 9 commits November 19, 2026 11:34
Gate services/drivers crates on KERNEL_TARGET_COMPATIBLE_WITH (os:none)
rather than ast10x0's constraint, removing the dependency of shared
code on //target/ast10x0 so the SoC can become a nested module.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
target/ast10x0 is now its own module (openprot_ast10x0) that depends on
the enclosing checkout via local_path_override, following pigweed's
adventure example, so it can later move out of tree with a git_override.

- Add MODULE.bazel/.bazelrc/.bazelversion; run bazel from target/ast10x0.
- Repeat openprot's root-only overrides and share its crate universe via
  override_repo.
- Move the AST1060 PAC extension out of the root MODULE.bazel.
- Re-point labels to @openprot// and module-relative.
- Ignore target/ast10x0 in the root; run its presubmit from the subdir.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sort deps so @openprot// and other labels follow buildifier order, and
add the blank lines buildifier expects in MODULE.bazel, as required by
the presubmit format check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A nested module such as target/ast10x0 is a Bazel root when built on its
own, so it repeats the git_override pins (Pigweed, ureg) and the Rust
toolchain cipd_tag from the root MODULE.bazel. Nothing notices when the
copies drift, so fail the presubmit if a pin set in more than one
MODULE.bazel differs between them.

This is a stop-gap: it detects drift but does not remove the duplication.
Delete it if the pins move to a single source, such as an in-repo registry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t detected

pins.MODULE.bazel is the single source of truth for the pigweed/ureg
commits, the opentitan_devbundle archive hash, the pw_rust cipd_tag, and
the shared bazel_dep versions — module_pins.py has nothing left to compare
for any of them. Its own docstring already called for this: "delete it if
the pins move to a single source."
@rusty1968

Copy link
Copy Markdown
Collaborator Author

Transferring ownership to @JesseMelon

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants