[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ADESXNSW4QYY9GJDY41KVN":3,"skill-same:01M6ADESXNSW4QYY9GJDY41KVN":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M6ADESXNSW4QYY9GJDY41KVN","bazel",null,"github\u002Fcodeql","github","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9919?v=4","01M6AC83DS133TPXFSP1DHNCC6","GitHub","01M6ADDS8C2CRX670863V1TCD4",10350,"MIT","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcodeql\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbazel\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"---\nname: bazel\ndescription: Conventions for editing Bazel files in the github\u002Fcodeql repository: the shared `misc\u002Fbazel` helpers, `codeql_platform_select` and the `{CODEQL_PLATFORM}` packaging placeholder, adding `MODULE.bazel` dependencies, and the `semmle_code` stub that keeps the standalone build working. Use when editing any `BUILD.bazel`, `*.bzl`, `MODULE.bazel` or `.bazelrc` here, and before validating such an edit.\n---\n\n# Bazel in the codeql repository\n\nA bzlmod module named `ql`, repo name `@codeql` ([`MODULE.bazel`](..\u002F..\u002F..\u002FMODULE.bazel)). It builds standalone, and is\nalso consumed by an internal module; standalone builds replace that module with a stub.\n\n## Traps\n\nThings that will waste your time or produce a wrong edit here. Read this section even if you skip the rest.\n\n* **`\u002F\u002F...` does not work.** `bazel build \u002F\u002F...`, and even `bazel query \u002F\u002F...`, fail at the repo root: the patched\n  modules under [`misc\u002Fbazel\u002Fregistry`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fregistry) are real packages referencing repos that are not\n  visible from the main repo, and [`.bazelrc`](..\u002F..\u002F..\u002F.bazelrc) notes separately that transitions break `...` builds.\n  The error names a registry directory unrelated to your edit, so it is easy to misdiagnose. **Validate the specific\n  target or package you changed**, not a recursive pattern.\n* **There is no `MODULE.bazel.lock`, deliberately.** [`.bazelrc`](..\u002F..\u002F..\u002F.bazelrc) sets `--lockfile_mode=off` because\n  the workspace-relative module override makes a lockfile unstable. Do not add one, and do not \"fix\" its absence.\n* **`linux_arm64` vs `linux-arm64`.** The keyword argument and config setting use an underscore; the platform *string*\n  substituted into paths and zip names uses a hyphen. They are not interchangeable.\n* **Do not stub your way out of a missing internal dependency.** See [Building standalone](#building-standalone) for the\n  one narrow case where extending the stub is correct.\n\n## Conventions\n\n* **Copy a neighboring target rather than inventing a shape.** Packaging is not uniform: some packages use the\n  `codeql_*` wrappers, others still use `pkg_files` directly. Copy the closest *working* neighbor, and prefer the\n  wrapper for new code.\n* **Pin anything fetched over the network** with `sha256` or `integrity`. Bazel only *warns* on an unpinned download, so\n  nothing fails loudly, but the build stops being reproducible and a retagged upstream release silently changes what you\n  build. `lfs_archive` is the exception: content is pinned by git object.\n* **Format with `bazel run \u002F\u002Fmisc\u002Fbazel\u002Fbuildifier`.** It rewrites in place, so do not hand-tune formatting. Also wired\n  as a `pre-commit` hook ([`.pre-commit-config.yaml`](..\u002F..\u002F..\u002F.pre-commit-config.yaml)).\n\n## Where new code goes\n\nBazel's own macro \u002F rule \u002F repository-rule distinction applies as usual. What is repo-specific:\n\n| Adding | Goes in |\n| --- | --- |\n| a new packaging shape | extend [`misc\u002Fbazel\u002Fpkg.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fpkg.bzl), do not fork `pkg_files` |\n| a new OS or arch split | [`misc\u002Fbazel\u002Fos.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fos.bzl), do not hand-roll a `select()` over `@platforms\u002F\u002F` |\n| a fetch of something external | a repository rule ([`lfs.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Flfs.bzl), [`ripunzip.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fripunzip\u002Fripunzip.bzl)), not a `genrule` |\n| a wrapper used by one language | next to that language ([`swift\u002Frules.bzl`](..\u002F..\u002F..\u002Fswift\u002Frules.bzl)) |\n| a wrapper used across languages | `misc\u002Fbazel\u002F` |\n\nPrefer inline rules in `BUILD.bazel`. A `.bzl` file earns its `load()` only when the shape repeats across packages or a\nvalue must be computed: [`rust.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Frust.bzl) is worth it because every Rust binary that ships in a\npack must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. A local\ndebugging aid opts out and declares a plain `rust_binary`; see `swift-syntax-parse` in\n[`unified\u002Fswift-syntax-rs\u002FBUILD.bazel`](..\u002F..\u002F..\u002Funified\u002Fswift-syntax-rs\u002FBUILD.bazel). The `_gen_binaries` list in\n[`go\u002FBUILD.bazel`](..\u002F..\u002F..\u002Fgo\u002FBUILD.bazel) does not earn a `.bzl`, because it is shared within a single file, where a\nlocal variable does the job.\n\nMacros here are typically a thin public wrapper around a private rule (`codeql_csharp_binary`, `swift_cc_binary`). Keep\nthe rule narrow and the ergonomics in the macro. Each macro decorates the caller's `name` to mint its helper targets,\nfor example `internal\u002F\u003Cname>` or `single_arch\u002F\u003Cname>`. Their visibility is that macro's choice (private, package\ndefault, or the caller's own), so read the macro instead of assuming. When an error names a target you cannot find in\nany source file, a macro minted it: grep the suffix under `misc\u002Fbazel\u002F`.\n\n## Shared helpers\n\nFrequently-used pieces, so you load the existing one instead of rewriting it. Read the file for its actual exports.\n\n| `load()` path | Covers |\n| --- | --- |\n| `\u002F\u002Fmisc\u002Fbazel:pkg.bzl` | CodeQL packs and packaging |\n| `\u002F\u002Fmisc\u002Fbazel:os.bzl` | platform and architecture selection |\n| `\u002F\u002Fmisc\u002Fbazel:lfs.bzl` | on-demand git-LFS repositories |\n| `\u002F\u002Fmisc\u002Fbazel:rust.bzl` | Rust binary wrapper |\n| `\u002F\u002Fmisc\u002Fbazel:csharp.bzl` | C# binary\u002Flibrary\u002Ftest wrappers |\n| `\u002F\u002Fmisc\u002Fbazel:utils.bzl` | `select_os`; prefer `os.bzl`'s `os_select` in new code |\n\n[`defs.bzl`](..\u002F..\u002F..\u002Fdefs.bzl) at the root exports `codeql_platform` for *dependent* modules. It is not the way to get\nthe platform string here; use `os.bzl`.\n\n## Platform selection\n\n[`codeql_platform_select`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fos.bzl) takes one keyword argument per CodeQL platform: `linux64`,\n`linux_arm64`, `osx64` and `win64`. `otherwise` supplies the value for whichever of those you leave unset; it is **not**\na `\u002F\u002Fconditions:default`. If you only care about the OS, use `os_select`, which gives Linux the same value on both\narchitectures and has a `posix` shorthand for the shared Linux\u002FmacOS value.\n\nIn a macro (no `ctx`) it returns a `select()`:\n\n```python\nload(\"\u002F\u002Fmisc\u002Fbazel:os.bzl\", \"codeql_platform_select\")\nload(\"\u002F\u002Fmisc\u002Fbazel:pkg.bzl\", \"codeql_pkg_files\")\n\ncodeql_pkg_files(\n    name = \"extractor-arch\",\n    exes = codeql_platform_select(\n        otherwise = [\"\u002F\u002Funified\u002Fextractor\"],\n        win64 = [\"\u002F\u002Funified\u002Fextractor-unsupported-os:extractor\"],\n    ),\n    prefix = \"tools\u002F{CODEQL_PLATFORM}\",\n)\n```\n\nIf implementation code needs to *branch* on the value rather than pass it through, pass `ctx` and add\n`OS_DETECTION_ATTRS` to the rule's attributes. The value is then resolved eagerly instead of being an opaque `select()`:\n\n```python\nload(\"\u002F\u002Fmisc\u002Fbazel:os.bzl\", \"OS_DETECTION_ATTRS\", \"os_select\")\n\ndef _impl(ctx):\n    ext = os_select(ctx, windows = \".exe\", posix = \"\")\n    ...\n\nmy_rule = rule(\n    implementation = _impl,\n    attrs = {\"src\": attr.label()} | OS_DETECTION_ATTRS,\n)\n```\n\n## Packs\n\n`codeql_pack` assembles the files that become an extractor pack. See [`unified\u002FBUILD.bazel`](..\u002F..\u002F..\u002Funified\u002FBUILD.bazel)\nfor a minimal complete example and [`pkg.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fpkg.bzl) for the arguments. The non-obvious parts:\n\n* **`{CODEQL_PLATFORM}` in a destination path is the routing mechanism**, not just a substitution. A path containing it\n  is *arch-specific* and lands in the per-architecture zip; every other path is *common*. So `prefix =\n  \"tools\u002F{CODEQL_PLATFORM}\"` both places the file and marks it arch-specific. `arch_overrides` forces named\n  destinations into the arch-specific part without a placeholder.\n* **`codeql_pkg_files` splits `srcs` (plain) from `exes` (mode 755)** and **rejects `attributes =`** with an explicit\n  error. Use `exes` rather than hand-rolling `pkg_attributes(mode = \"755\")`.\n* **`pkg_dirs` and `pkg_symlinks` are unsupported** and fail at analysis time.\n* `codeql_pack` also generates an installer and an `install` alias, hence `bazel run \u002F\u002Funified:install`. Pass\n  `installer_alias = None` if one package defines several packs.\n* `codeql_pack_group` exists for bundling packs into distribution zips, but nothing in this repo instantiates it.\n\n## Adding a dependency\n\nIn order of preference:\n\n1. **A [Bazel Central Registry](https:\u002F\u002Fregistry.bazel.build\u002F) module.** Add a `bazel_dep` in\n   [`MODULE.bazel`](..\u002F..\u002F..\u002FMODULE.bazel).\n2. **A patched upstream module.** Add it under [`misc\u002Fbazel\u002Fregistry`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fregistry), which `.bazelrc`\n   puts ahead of the BCR. Put patches in `modules\u002F\u003Crepo>\u002F\u003Cversion>\u002Fpatches`, rename the version with a `-codeql.N`\n   suffix, and run [`fix.py`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fregistry\u002Ffix.py) to realign the metadata.\n3. **A raw archive.** Use `http_archive` via `use_repo_rule`, or a repository rule. Copy an adjacent declaration and\n   keep its checksum field populated.\n\nVendored Rust crates under [`misc\u002Fbazel\u002F3rdparty`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002F3rdparty) are generated. Regenerate with\n[`update_all_rust_deps.sh`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002F3rdparty\u002Fupdate_all_rust_deps.sh) rather than editing, and keep the\n`use_repo` lists in sync, which `bazel mod tidy` does for module extensions.\n\n## Building standalone\n\n[`MODULE.bazel`](..\u002F..\u002F..\u002FMODULE.bazel) declares `semmle_code` with a `local_path_override` pointing at `..`, which\nresolves when this repo is checked out inside the internal module. [`.bazelrc`](..\u002F..\u002F..\u002F.bazelrc), which Bazel reads\nwhen invoked in *this* workspace, overrides that with a stub. This line is the whole reason a standalone build resolves:\n\n```\ncommon --override_module=semmle_code=%workspace%\u002Fmisc\u002Fbazel\u002Fsemmle_code_stub\n```\n\nDo not change either the override path or the `local_path_override`; they work as a pair.\n\n[`misc\u002Fbazel\u002Fsemmle_code_stub`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fsemmle_code_stub) is an otherwise empty module supplying no-op\nversions of the internal helpers that shared `.bzl` files load *unconditionally*. That is its only job, and it is small\nenough to read.\n\n**Extend the stub only when a `.bzl` file every standalone target loads gains a new internal `load()`**, which breaks\npackage loading outright, for everyone. Prefer not needing one. **Never add a stub so that an internal-only target\nappears to build**: some targets depend on internal libraries (`grep -rl @semmle_code --include=*.bazel` finds them) and\nare correctly unbuildable here. Unlike a `load()`, such a dependency only fails when that target is actually requested.\n\n[`.bazelrc.internal`](..\u002F..\u002F..\u002F.bazelrc.internal) is **not** read here; it carries settings for the internal build. A\nsetting needed by both has to be written in both files, with paths differing because this repo sits at a different depth\nthere.\n","# Bazel in the codeql repository\n\nA bzlmod module named `ql`, repo name `@codeql` ([`MODULE.bazel`](..\u002F..\u002F..\u002FMODULE.bazel)). It builds standalone, and is\nalso consumed by an internal module; standalone builds replace that module with a stub.\n\n## Traps\n\nThings that will waste your time or produce a wrong edit here. Read this section even if you skip the rest.\n\n* **`\u002F\u002F...` does not work.** `bazel build \u002F\u002F...`, and even `bazel query \u002F\u002F...`, fail at the repo root: the patched\n  modules under [`misc\u002Fbazel\u002Fregistry`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fregistry) are real packages referencing repos that are not\n  visible from the main repo, and [`.bazelrc`](..\u002F..\u002F..\u002F.bazelrc) notes separately that transitions break `...` builds.\n  The error names a registry directory unrelated to your edit, so it is easy to misdiagnose. **Validate the specific\n  target or package you changed**, not a recursive pattern.\n* **There is no `MODULE.bazel.lock`, deliberately.** [`.bazelrc`](..\u002F..\u002F..\u002F.bazelrc) sets `--lockfile_mode=off` because\n  the workspace-relative module override makes a lockfile unstable. Do not add one, and do not \"fix\" its absence.\n* **`linux_arm64` vs `linux-arm64`.** The keyword argument and config setting use an underscore; the platform *string*\n  substituted into paths and zip names uses a hyphen. They are not interchangeable.\n* **Do not stub your way out of a missing internal dependency.** See [Building standalone](#building-standalone) for the\n  one narrow case where extending the stub is correct.\n\n## Conventions\n\n* **Copy a neighboring target rather than inventing a shape.** Packaging is not uniform: some packages use the\n  `codeql_*` wrappers, others still use `pkg_files` directly. Copy the closest *working* neighbor, and prefer the\n  wrapper for new code.\n* **Pin anything fetched over the network** with `sha256` or `integrity`. Bazel only *warns* on an unpinned download, so\n  nothing fails loudly, but the build stops being reproducible and a retagged upstream release silently changes what you\n  build. `lfs_archive` is the exception: content is pinned by git object.\n* **Format with `bazel run \u002F\u002Fmisc\u002Fbazel\u002Fbuildifier`.** It rewrites in place, so do not hand-tune formatting. Also wired\n  as a `pre-commit` hook ([`.pre-commit-config.yaml`](..\u002F..\u002F..\u002F.pre-commit-config.yaml)).\n\n## Where new code goes\n\nBazel's own macro \u002F rule \u002F repository-rule distinction applies as usual. What is repo-specific:\n\n| Adding | Goes in |\n| --- | --- |\n| a new packaging shape | extend [`misc\u002Fbazel\u002Fpkg.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fpkg.bzl), do not fork `pkg_files` |\n| a new OS or arch split | [`misc\u002Fbazel\u002Fos.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fos.bzl), do not hand-roll a `select()` over `@platforms\u002F\u002F` |\n| a fetch of something external | a repository rule ([`lfs.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Flfs.bzl), [`ripunzip.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fripunzip\u002Fripunzip.bzl)), not a `genrule` |\n| a wrapper used by one language | next to that language ([`swift\u002Frules.bzl`](..\u002F..\u002F..\u002Fswift\u002Frules.bzl)) |\n| a wrapper used across languages | `misc\u002Fbazel\u002F` |\n\nPrefer inline rules in `BUILD.bazel`. A `.bzl` file earns its `load()` only when the shape repeats across packages or a\nvalue must be computed: [`rust.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Frust.bzl) is worth it because every Rust binary that ships in a\npack must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. A local\ndebugging aid opts out and declares a plain `rust_binary`; see `swift-syntax-parse` in\n[`unified\u002Fswift-syntax-rs\u002FBUILD.bazel`](..\u002F..\u002F..\u002Funified\u002Fswift-syntax-rs\u002FBUILD.bazel). The `_gen_binaries` list in\n[`go\u002FBUILD.bazel`](..\u002F..\u002F..\u002Fgo\u002FBUILD.bazel) does not earn a `.bzl`, because it is shared within a single file, where a\nlocal variable does the job.\n\nMacros here are typically a thin public wrapper around a private rule (`codeql_csharp_binary`, `swift_cc_binary`). Keep\nthe rule narrow and the ergonomics in the macro. Each macro decorates the caller's `name` to mint its helper targets,\nfor example `internal\u002F\u003Cname>` or `single_arch\u002F\u003Cname>`. Their visibility is that macro's choice (private, package\ndefault, or the caller's own), so read the macro instead of assuming. When an error names a target you cannot find in\nany source file, a macro minted it: grep the suffix under `misc\u002Fbazel\u002F`.\n\n## Shared helpers\n\nFrequently-used pieces, so you load the existing one instead of rewriting it. Read the file for its actual exports.\n\n| `load()` path | Covers |\n| --- | --- |\n| `\u002F\u002Fmisc\u002Fbazel:pkg.bzl` | CodeQL packs and packaging |\n| `\u002F\u002Fmisc\u002Fbazel:os.bzl` | platform and architecture selection |\n| `\u002F\u002Fmisc\u002Fbazel:lfs.bzl` | on-demand git-LFS repositories |\n| `\u002F\u002Fmisc\u002Fbazel:rust.bzl` | Rust binary wrapper |\n| `\u002F\u002Fmisc\u002Fbazel:csharp.bzl` | C# binary\u002Flibrary\u002Ftest wrappers |\n| `\u002F\u002Fmisc\u002Fbazel:utils.bzl` | `select_os`; prefer `os.bzl`'s `os_select` in new code |\n\n[`defs.bzl`](..\u002F..\u002F..\u002Fdefs.bzl) at the root exports `codeql_platform` for *dependent* modules. It is not the way to get\nthe platform string here; use `os.bzl`.\n\n## Platform selection\n\n[`codeql_platform_select`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fos.bzl) takes one keyword argument per CodeQL platform: `linux64`,\n`linux_arm64`, `osx64` and `win64`. `otherwise` supplies the value for whichever of those you leave unset; it is **not**\na `\u002F\u002Fconditions:default`. If you only care about the OS, use `os_select`, which gives Linux the same value on both\narchitectures and has a `posix` shorthand for the shared Linux\u002FmacOS value.\n\nIn a macro (no `ctx`) it returns a `select()`:\n\n```python\nload(\"\u002F\u002Fmisc\u002Fbazel:os.bzl\", \"codeql_platform_select\")\nload(\"\u002F\u002Fmisc\u002Fbazel:pkg.bzl\", \"codeql_pkg_files\")\n\ncodeql_pkg_files(\n    name = \"extractor-arch\",\n    exes = codeql_platform_select(\n        otherwise = [\"\u002F\u002Funified\u002Fextractor\"],\n        win64 = [\"\u002F\u002Funified\u002Fextractor-unsupported-os:extractor\"],\n    ),\n    prefix = \"tools\u002F{CODEQL_PLATFORM}\",\n)\n```\n\nIf implementation code needs to *branch* on the value rather than pass it through, pass `ctx` and add\n`OS_DETECTION_ATTRS` to the rule's attributes. The value is then resolved eagerly instead of being an opaque `select()`:\n\n```python\nload(\"\u002F\u002Fmisc\u002Fbazel:os.bzl\", \"OS_DETECTION_ATTRS\", \"os_select\")\n\ndef _impl(ctx):\n    ext = os_select(ctx, windows = \".exe\", posix = \"\")\n    ...\n\nmy_rule = rule(\n    implementation = _impl,\n    attrs = {\"src\": attr.label()} | OS_DETECTION_ATTRS,\n)\n```\n\n## Packs\n\n`codeql_pack` assembles the files that become an extractor pack. See [`unified\u002FBUILD.bazel`](..\u002F..\u002F..\u002Funified\u002FBUILD.bazel)\nfor a minimal complete example and [`pkg.bzl`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fpkg.bzl) for the arguments. The non-obvious parts:\n\n* **`{CODEQL_PLATFORM}` in a destination path is the routing mechanism**, not just a substitution. A path containing it\n  is *arch-specific* and lands in the per-architecture zip; every other path is *common*. So `prefix =\n  \"tools\u002F{CODEQL_PLATFORM}\"` both places the file and marks it arch-specific. `arch_overrides` forces named\n  destinations into the arch-specific part without a placeholder.\n* **`codeql_pkg_files` splits `srcs` (plain) from `exes` (mode 755)** and **rejects `attributes =`** with an explicit\n  error. Use `exes` rather than hand-rolling `pkg_attributes(mode = \"755\")`.\n* **`pkg_dirs` and `pkg_symlinks` are unsupported** and fail at analysis time.\n* `codeql_pack` also generates an installer and an `install` alias, hence `bazel run \u002F\u002Funified:install`. Pass\n  `installer_alias = None` if one package defines several packs.\n* `codeql_pack_group` exists for bundling packs into distribution zips, but nothing in this repo instantiates it.\n\n## Adding a dependency\n\nIn order of preference:\n\n1. **A [Bazel Central Registry](https:\u002F\u002Fregistry.bazel.build\u002F) module.** Add a `bazel_dep` in\n   [`MODULE.bazel`](..\u002F..\u002F..\u002FMODULE.bazel).\n2. **A patched upstream module.** Add it under [`misc\u002Fbazel\u002Fregistry`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fregistry), which `.bazelrc`\n   puts ahead of the BCR. Put patches in `modules\u002F\u003Crepo>\u002F\u003Cversion>\u002Fpatches`, rename the version with a `-codeql.N`\n   suffix, and run [`fix.py`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fregistry\u002Ffix.py) to realign the metadata.\n3. **A raw archive.** Use `http_archive` via `use_repo_rule`, or a repository rule. Copy an adjacent declaration and\n   keep its checksum field populated.\n\nVendored Rust crates under [`misc\u002Fbazel\u002F3rdparty`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002F3rdparty) are generated. Regenerate with\n[`update_all_rust_deps.sh`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002F3rdparty\u002Fupdate_all_rust_deps.sh) rather than editing, and keep the\n`use_repo` lists in sync, which `bazel mod tidy` does for module extensions.\n\n## Building standalone\n\n[`MODULE.bazel`](..\u002F..\u002F..\u002FMODULE.bazel) declares `semmle_code` with a `local_path_override` pointing at `..`, which\nresolves when this repo is checked out inside the internal module. [`.bazelrc`](..\u002F..\u002F..\u002F.bazelrc), which Bazel reads\nwhen invoked in *this* workspace, overrides that with a stub. This line is the whole reason a standalone build resolves:\n\n```\ncommon --override_module=semmle_code=%workspace%\u002Fmisc\u002Fbazel\u002Fsemmle_code_stub\n```\n\nDo not change either the override path or the `local_path_override`; they work as a pair.\n\n[`misc\u002Fbazel\u002Fsemmle_code_stub`](..\u002F..\u002F..\u002Fmisc\u002Fbazel\u002Fsemmle_code_stub) is an otherwise empty module supplying no-op\nversions of the internal helpers that shared `.bzl` files load *unconditionally*. That is its only job, and it is small\nenough to read.\n\n**Extend the stub only when a `.bzl` file every standalone target loads gains a new internal `load()`**, which breaks\npackage loading outright, for everyone. Prefer not needing one. **Never add a stub so that an internal-only target\nappears to build**: some targets depend on internal libraries (`grep -rl @semmle_code --include=*.bazel` finds them) and\nare correctly unbuildable here. Unlike a `load()`, such a dependency only fails when that target is actually requested.\n\n[`.bazelrc.internal`](..\u002F..\u002F..\u002F.bazelrc.internal) is **not** read here; it carries settings for the internal build. A\nsetting needed by both has to be written in both files, with paths differing because this repo sits at a different depth\nthere.\n",{},"main","fbf9fca5ce7c3b64c2f5d719ea0444577850cb4a",".github\u002Fskills\u002Fbazel",2145,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcodeql","https:\u002F\u002Fcodeql.github.com","https:\u002F\u002Fgithub.com\u002Fgithub","https:\u002F\u002Fgithub.com\u002Fabout","How people build software.","2026-11-14 01:42:53",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add github\u002Fcodeql --skill bazel",{"tool":39,"command":40},"bunx","bunx skills add github\u002Fcodeql --skill bazel",{"tool":42,"command":43},"pnpm","pnpm dlx skills add github\u002Fcodeql --skill bazel","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcodeql\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbazel\u002FSKILL.md",true,[],[]]