用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kevmoo/dart-sdk-bazel --skill bazel-bridge命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | bazel_bridge |
| description | Import, test, and export upstream Gerrit CLs or GitHub PRs in the Bazel workspace. |
Use this skill to import, test, and export upstream changes (Gerrit CLs or GitHub PRs) using the Bazel developer bridge tools. This workflow allows developers and agents to test upstream patches in the hermetic Bazel build environment and export the validated non-Bazel core SDK changes back to an upstream-ready branch.
The bridge workflow uses two main Dart scripts located in the repository:
tools/bazel/bridge/import.dart: For importing and applying upstream changes to a new Bazel branch.tools/bazel/bridge/export.dart: For extracting, filtering, and exporting core SDK changes back to a clean branch.To import an upstream Gerrit CL or GitHub PR into the local Bazel workspace, run the import.dart script:
dart tools/bazel/bridge/import.dart <cl-number-or-pr-url> [options]
505900https://dart-review.googlesource.com/c/sdk/+/505900https://dart-review.googlesource.com/c/sdk/+/505900/1https://github.com/dart-lang/sdk/pull/123-b, --base <branch>: The base branch to branch off. Defaults to bazel-fork/main.-n, --name <name>: An explicit name for the created branch. If omitted, a default name like gerrit-<cl-number> or github-pr-<pr-number> is used.-p, --patchset <number>: A specific Gerrit patchset to import. If omitted, the script automatically queries the Gerrit API to find and use the latest patchset.--no-sync: Skip running gclient sync after importing. By default, the script will run gclient sync to align all dependencies.-v, --verbose: Enable verbose logging to see the underlying git commands.refs/changes/... for Gerrit or refs/pull/.../head for GitHub).bazel-fork/main).BUILD.gn or .gni files were modified, it warns you that you may need to run the translator (tools/bazel/translate_gn_desc.py) to update the Bazel build files.gclient sync to align the workspace.If the cherry-pick/apply step fails due to conflicts:
2, leaving you on the new feature branch in the middle of a cherry-pick.git add <file>git cherry-pick --continuegit cherry-pick --abortOnce the change is imported and any conflicts or build-file translation issues are resolved:
Verify the Build:
bazel build //runtime/bin:dartvm
bazel build //sdk:create_sdk
Run the Test Suite:
Use the standard test runner with the --bazel flag. Be sure to target the correct architecture (e.g., arm64 if on Apple Silicon, or x64 if on Intel/Linux):
python3 tools/test.py --bazel -n vm-release-arm64 <path-to-test>
Example:
python3 tools/test.py --bazel -n vm-release-arm64 corelib/list_test
Debug Failures: Fix any issues found in the core SDK or Bazel configuration. Feel free to make multiple commits on your feature branch as you work.
Once the changes are fully validated and ready to be submitted back to the upstream Core SDK, use the export.dart script to surgically extract and package the core changes, leaving all Bazel-specific files behind:
dart tools/bazel/bridge/export.dart [options]
git format-patch for all commits on the current branch since the base branch (default: bazel-fork/main), or for a single specific commit.tools/bazel/ (Bazel-specific tools and the bridge itself)*.bzl (Starlark rules)BUILD.bazel / BUILD (Bazel build files)WORKSPACE / WORKSPACE.bazel / MODULE.bazel (Workspace configs).bazelrc (Bazel configuration)
Any commits that only modified these files are automatically and silently dropped, ensuring the exported history is completely clean and contains only Core SDK modifications.origin/main). The branch is named export-<timestamp> or a custom name if specified.git am. This reconstructs the commit history, preserving the original author, date, and commit messages.--upload flag is provided, the script automatically runs git cl upload, allowing you to upload the clean CL directly to the Gerrit code review system.-b, --base <branch>: The Bazel base branch to compare the current branch against. Defaults to bazel-fork/main.-c, --commit <hash>: Export only a single specific commit instead of the entire branch history.--target-base <branch>: The Core SDK base branch to branch off of for the export. Defaults to origin/main.-n, --name <name>: Custom name for the newly created export branch.-u, --upload: Automatically run git cl upload after a successful export.-v, --verbose: Enable verbose logging to see the details of the patch generation and application.git am failures)If git am fails to apply the patch due to conflicts:
am session.git add <file>), and run git am --continue.git am --abort and switch back to your original development branch:
git checkout <your-dev-branch>