Skip to content

Build builtins_bzl.zip with a Starlark rule#30123

Open
dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:codex/simplify-builtins-zip
Open

Build builtins_bzl.zip with a Starlark rule#30123
dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:codex/simplify-builtins-zip

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace the builtins_bzl.zip shell genrule with a dedicated builtins_zip Starlark rule.

This focused change is extracted from #30121 for independent review.

Motivation

The existing genrule discovers its source root with shell commands and invokes zip_builtins.sh, which depends on shell path handling. builtins_zip declares the zipper tool and source inputs directly, preserving the builtins_bzl/<relative path> archive layout without shell path handling.

Build API Changes

No.

Validation

  • buildifier -mode=check src/main/starlark/builtins_bzl/BUILD src/builtins_zip.bzl
  • bazel build --jobs=2 //src/main/starlark/builtins_bzl:builtins_bzl_zip
  • compared unzip -Z1 output to the sorted **/*.bzl source list; entries matched exactly
  • bazel aquery confirmed _zipper is an execution-configured declared tool and all archive mappings are correct

Release Notes

RELNOTES: None

@dzbarsky dzbarsky force-pushed the codex/simplify-builtins-zip branch from ec9bcf1 to a477a52 Compare July 3, 2026 11:14
@dzbarsky dzbarsky marked this pull request as ready for review July 3, 2026 11:25
@github-actions github-actions Bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jul 3, 2026
Comment thread src/builtins_zip.bzl Outdated
Comment thread src/builtins_zip.bzl Outdated
@github-actions github-actions Bot added the community-reviewed Reviewed by a trusted community contributor label Jul 3, 2026
@dzbarsky dzbarsky force-pushed the codex/simplify-builtins-zip branch from a477a52 to bac83ca Compare July 3, 2026 13:49
@fmeum fmeum requested a review from meisterT July 3, 2026 14:17
@dzbarsky

dzbarsky commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Need to remove

#!/usr/bin/env bash

Replace the shell genrule with a builtins_zip rule that invokes the declared zipper tool. Keep the rule in //src so the builtins source glob remains simple.

Make _zipper a private default attribute and use Args.add_all to map builtins sources into the archive.
@dzbarsky dzbarsky force-pushed the codex/simplify-builtins-zip branch from bac83ca to 30047a3 Compare July 4, 2026 19:04
@meisterT meisterT added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally community-reviewed Reviewed by a trusted community contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants