Declares that implementation creates a file with the given filename within the specified directory.Remember that in addition to declaring a file, you must separately create an action that emits the file. Creating that action will require passing the returned File object to the action’s construction function.
sequence; or depset; or None; default is None List or depset of any tools needed by the action. Tools are executable inputs that may have their own runfiles which are automatically made available to the action.
When a list is provided, it can be a heterogenous collection of:
Files
FilesToRunProvider instances
depsets of Files
Files from ctx.executable and FilesToRunProviders which are directly in the list will have their runfiles automatically added. All tools are implicitly added as inputs.
arguments
sequence; default is [] Command line arguments of the action. Must be a list of strings or actions.args() objects.
progress_message
string; or None; default is None Progress message to show to the user during the build.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bazel Documentation","colors":{"primary":"#44a047","light":"#77d275","dark":"#004300"},"logo":{"light":"https://mintcdn.com/bazel/h7ma40U5Tjz5Hf-j/logo/light.svg?fit=max\u0026auto=format\u0026n=h7ma40U5Tjz5Hf-j\u0026q=85\u0026s=fe755972fa71b3fc4db1ccda7a78cb9d","dark":"https://mintcdn.com/bazel/h7ma40U5Tjz5Hf-j/logo/Bazel_logo.svg?fit=max\u0026auto=format\u0026n=h7ma40U5Tjz5Hf-j\u0026q=85\u0026s=78e05337ead4a8dc5dabb4819732eb25"},"favicon":"https://mintcdn.com/bazel/ZgDLXOcGz0vxy0Ai/favicon.png?fit=max\u0026auto=format\u0026n=ZgDLXOcGz0vxy0Ai\u0026q=85\u0026s=80c032647b8ae1fba9de31dfc428994e","navbar":{"links":[{"icon":"book-open-cover","href":"https://registry.bazel.build","label":"Module Registry"},{"icon":"newspaper","href":"https://blog.bazel.build/","label":"Blog"},{"icon":"github","href":"https://github.com/bazelbuild/bazel","label":"Github"}]},"footer":{"socials":{"x":"https://x.com/bazelbuild","github":"https://github.com/bazelbuild","reddit":"https://reddit.com/r/bazel"},"links":[{"header":"About","items":[{"label":"Who's using Bazel","href":"https://bazel.build/community/users"},{"label":"Contribute","href":"https://bazel.build/contribute"},{"label":"Governance model","href":"https://bazel.build/contribute/policy"},{"label":"Release model","href":"https://bazel.build/release"},{"label":"Brand guidelines","href":"https://bazel.build/brand"}]},{"header":"Stay Connected","items":[{"label":"Blog","href":"https://blog.bazel.build/"},{"label":"GitHub","href":"https://github.com/bazelbuild/bazel"},{"label":"Twitter","href":"https://twitter.com/bazelbuild"},{"label":"YouTube","href":"https://youtube.com/user/googleOSPO"}]},{"header":"Support","items":[{"label":"Support","href":"https://bazel.build/help"},{"label":"Issue tracker","href":"https://github.com/bazelbuild/bazel/issues"},{"label":"Slack","href":"https://slack.bazel.build/"},{"label":"Stack Overflow","href":"https://stackoverflow.com/questions/tagged/bazel"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://policies.google.com/privacy"},{"label":"Terms of Service","href":"https://policies.google.com/terms"}]}]},"integrations":{"ga4":{"measurementId":"G-V5WZVG5WF1"}},"banner":{"content":"Please take the [Bazel user survey](/survey) to help us improve Bazel.","dismissible":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bazel","hasAudioNarration":false,"actualSubdomain":"bazel","customDomains":["bazel.build"],"gitSource":{"type":"github","owner":"bazel-contrib","repo":"bazel-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae04185da29998d5047dc56","collectionId":"11ac585b-8f80-4bd3-ad05-060495b67a16","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae04185da29998d5047dc56"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6ae04185da29998d5047dc56","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"en","tag":"Extending","count":937},{"language":"en","tag":"User guide","count":663},{"language":"en","tag":"Getting started","count":301},{"language":"en","tag":"Community","count":264},{"language":"en","tag":"Starlark Builtins","count":250},{"language":"en","tag":"Remote Execution","count":240},{"language":"en","tag":"Reference","count":203},{"language":"en","tag":"Contributing","count":168},{"language":"en","tag":"About Bazel","count":164},{"language":"en","tag":"Install","count":151}],"searchSettings":{"isFiltersEnabled":true,"maxResults":15}},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"versions/9.2.0/rules/lib/builtins/template_ctx","slug":"/versions/9.2.0/rules/lib/builtins/template_ctx","pageMetadata":{"title":"template_ctx","description":null,"href":"/versions/9.2.0/rules/lib/builtins/template_ctx"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`A context object that is passed to the action template expansion function.`}),`\n`,_jsx(Heading,{level:`2`,id:`members`,children:`Members`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#args`,children:`args`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#declare_file`,children:`declare_file`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#run`,children:`run`})}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`args`,children:`args`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Args template_ctx.args()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Returns an Args object that can be used to build memory-efficient command lines.`}),`\n`,_jsx(Heading,{level:`2`,id:`declare_file`,children:`declare_file`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`File template_ctx.declare_file(filename, *, directory)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Declares that implementation creates a file with the given filename within the specified directory.`}),`\n`,_jsxs(_components.p,{children:[`Remember that in addition to declaring a file, you must separately create an action that emits the file. Creating that action will require passing the returned `,_jsx(_components.code,{children:`File`}),` object to the action’s construction function.`]}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`filename`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/core/string`,children:`string`}),`; required The relative path of the file within the directory.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`directory`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/File`,children:`File`}),`; required The directory in which the file should be created.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`run`,children:`run`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`None template_ctx.run(*, outputs, inputs=[], executable, tools=None, arguments=[], progress_message=None)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Creates an action that runs an executable.`}),`\n`,_jsx(Heading,{level:`3`,id:`parameters-2`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`outputs`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/core/list`,children:`sequence`}),` of `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/File`,children:`File`}),`s; required List of the output files of the action.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`inputs`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/core/list`,children:`sequence`}),` of `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/File`,children:`File`}),`s; or `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/depset`,children:`depset`}),`; default is `,_jsx(_components.code,{children:`[]`}),` List or depset of the input files of the action.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`executable`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/File`,children:`File`}),`; or `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/core/string`,children:`string`}),`; or `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/providers/FilesToRunProvider`,children:`FilesToRunProvider`}),`; required The executable file to be called by the action.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tools`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{class:`anchor`,href:`/versions/9.2.0/rules/lib/core/list.html`,children:`sequence`}),`; or `,_jsx(_components.a,{class:`anchor`,href:`/versions/9.2.0/rules/lib/builtins/depset.html`,children:`depset`}),`; or `,_jsx(_components.code,{children:`None`}),`; default is `,_jsx(_components.code,{children:`None`}),_jsx(`br`,{}),` List or `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/depset.html`,children:_jsx(_components.code,{children:`depset`})}),` of any tools needed by the action. Tools are executable inputs that may have their own runfiles which are automatically made available to the action. `,_jsxs(`p`,{children:[` When a list is provided, it can be a heterogenous collection of: `,_jsxs(`ul`,{children:[` `,_jsxs(`li`,{children:[_jsx(_components.code,{children:`File`}),`s`]}),` `,_jsxs(`li`,{children:[_jsx(_components.code,{children:`FilesToRunProvider`}),` instances`]}),` `,_jsxs(`li`,{children:[_jsx(_components.code,{children:`depset`}),`s of `,_jsx(_components.code,{children:`File`}),`s`]}),` `]}),` `,_jsx(_components.code,{children:`File`}),`s from `,_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/builtins/ctx#executable`,children:_jsx(_components.code,{children:`ctx.executable`})}),` and `,_jsx(_components.code,{children:`FilesToRunProvider`}),`s which are directly in the list will have their runfiles automatically added. All tools are implicitly added as inputs. `]})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`arguments`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/core/list`,children:`sequence`}),`; default is `,_jsx(_components.code,{children:`[]`}),` Command line arguments of the action. Must be a list of strings or `,_jsx(_components.a,{href:`#args`,children:_jsx(_components.code,{children:`actions.args()`})}),` objects.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`progress_message`})}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/versions/9.2.0/rules/lib/core/string`,children:`string`}),`; or `,_jsx(_components.code,{children:`None`}),`; default is `,_jsx(_components.code,{children:`None`}),` Progress message to show to the user during the build.`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"template_ctx","description":null,"href":"/versions/9.2.0/rules/lib/builtins/template_ctx"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Members","slug":"members","depth":2,"children":[]},{"title":"args","slug":"args","depth":2,"children":[]},{"title":"declare_file","slug":"declare_file","depth":2,"children":[{"title":"Parameters","slug":"parameters","depth":3,"children":[]}]},{"title":"run","slug":"run","depth":2,"children":[{"title":"Parameters","slug":"parameters-2","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bazel","siteName":"Bazel Documentation","title":"template_ctx - Bazel Documentation","navMaps":{"firstHrefInVersion":{"HEAD":{"href":"/rules/errors/read-only-variable","matchLevel":2},"9.3":{"href":"/versions/9.3.0/rules/lib/builtins/template_ctx","matchLevel":1},"9.2":{"href":"/versions/9.2.0/rules/lib/builtins/template_ctx","matchLevel":0},"9.1":{"href":"/versions/9.1.0/about/intro","matchLevel":4},"9.0":{"href":"/versions/9.0.0/about/intro","matchLevel":4},"8.8":{"href":"/versions/8.8.1/rules/errors/read-only-variable","matchLevel":2},"8.7":{"href":"/versions/8.7.0/about/intro","matchLevel":4},"8.6":{"href":"/versions/8.6.0/about/intro","matchLevel":4},"8.5":{"href":"/versions/8.5.1/about/intro","matchLevel":4},"8.4":{"href":"/versions/8.4.2/about/intro","matchLevel":4},"8.3":{"href":"/versions/8.3.1/about/intro","matchLevel":4},"8.2":{"href":"/versions/8.2.1/about/intro","matchLevel":4},"8.1":{"href":"/versions/8.1.1/about/intro","matchLevel":4},"8.0":{"href":"/versions/8.0.1/about/intro","matchLevel":4},"7.7":{"href":"/versions/7.7.1/about/intro","matchLevel":4}},"firstHrefInLanguage":{"en":{"href":"/versions/9.2.0/rules/lib/builtins/template_ctx","matchLevel":0}}},"lastModified":"2026-10-20T15:33:32.159Z","originalFileLocation":"versions/9.2.0/rules/lib/builtins/template_ctx.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Bazel Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"template_ctx - Bazel Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bazel Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bazel.mintlify.app/_mintlify/api/og/v2?division=Starlark+Builtins\u0026amp;title=template_ctx\u0026amp;theme=b8bffad3f1b8a1bbcfe81c25\u0026amp;signature=b58dd8551439772da1ba3b533357a626a08dabd177cb05cf8d3e737c5a9053fa\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"template_ctx - Bazel Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bazel.mintlify.app/_mintlify/api/og/v2?division=Starlark+Builtins\u0026amp;title=template_ctx\u0026amp;theme=b8bffad3f1b8a1bbcfe81c25\u0026amp;signature=b58dd8551439772da1ba3b533357a626a08dabd177cb05cf8d3e737c5a9053fa\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/bazel/PruV1ugoTEmyjX-1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bazel Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#44a047\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/versions/9.2.0/rules/lib/builtins/template_ctx.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bazel.build/#organization\",\"name\":\"Bazel Documentation\",\"url\":\"https://bazel.build\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bazel/h7ma40U5Tjz5Hf-j/logo/light.svg?fit=max\u0026auto=format\u0026n=h7ma40U5Tjz5Hf-j\u0026q=85\u0026s=fe755972fa71b3fc4db1ccda7a78cb9d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://bazel.build#website\",\"name\":\"Bazel Documentation\",\"url\":\"https://bazel.build\",\"publisher\":{\"@id\":\"https://bazel.build/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx#webpage\",\"url\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx\",\"name\":\"template_ctx\",\"dateModified\":\"2026-10-20T15:33:32.159Z\",\"isPartOf\":{\"@id\":\"https://bazel.build#website\"},\"breadcrumb\":{\"@id\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Starlark Builtins\",\"item\":\"https://bazel.build/versions/9.2.0/rules/errors/read-only-variable\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"template_ctx\",\"item\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx#article\",\"headline\":\"template_ctx\",\"name\":\"template_ctx\",\"url\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx\",\"mainEntityOfPage\":{\"@id\":\"https://bazel.build/versions/9.2.0/rules/lib/builtins/template_ctx#webpage\"},\"dateModified\":\"2026-10-20T15:33:32.159Z\",\"publisher\":{\"@id\":\"https://bazel.build/#organization\"},\"isPartOf\":{\"@id\":\"https://bazel.build#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bazel Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Bazel Documentation","nav":{"global":null,"versions":[{"version":"HEAD","pages":[{"title":"HEAD","href":"/rules/errors/read-only-variable"}]},{"version":"9.3","pages":[{"title":"9.3","href":"/versions/9.3.0/rules/lib/builtins/template_ctx"}]},{"version":"9.2","languages":[{"language":"en","tabs":[{"tab":"About Bazel","pages":[{"title":"About Bazel","href":"/versions/9.2.0/about/intro"}]},{"tab":"Getting started","pages":[{"title":"Getting started","href":"/versions/9.2.0/install"}]},{"tab":"User guide","pages":[{"title":"User guide","href":"/versions/9.2.0/release"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/versions/9.2.0/reference/be/overview"}]},{"tab":"Extending","groups":[{"group":"Concepts","pages":[{"title":"Extension Overview","href":"/versions/9.2.0/extending/concepts"},{"title":"Depsets","href":"/versions/9.2.0/extending/depsets"},{"title":"Macros","href":"/versions/9.2.0/extending/macros"},{"title":"Legacy Macros","href":"/versions/9.2.0/extending/legacy-macros"},{"title":"Aspects","href":"/versions/9.2.0/extending/aspects"},{"title":"Rules","href":"/versions/9.2.0/extending/rules"},{"title":"Configurations","href":"/versions/9.2.0/extending/config"},{"title":"Execution Groups","href":"/versions/9.2.0/extending/exec-groups"},{"title":"Automatic Execution Groups (AEGs)","href":"/versions/9.2.0/extending/auto-exec-groups"}]},{"group":"Writing rules","pages":[{"title":"Rules Tutorial","href":"/versions/9.2.0/rules/rules-tutorial"},{"title":"Creating a Symbolic Macro","href":"/versions/9.2.0/rules/macro-tutorial"},{"title":"Creating a Legacy Macro","href":"/versions/9.2.0/rules/legacy-macro-tutorial"},{"title":"Using Macros to Create Custom Verbs","href":"/versions/9.2.0/rules/verbs-tutorial"},{"title":"Starlark Language","href":"/versions/9.2.0/rules/language"},{"title":".bzl style guide","href":"/versions/9.2.0/rules/bzl-style"},{"title":"Challenges of Writing Rules","href":"/versions/9.2.0/rules/challenges"},{"title":"Writing Rules on Windows","href":"/versions/9.2.0/rules/windows"}]},{"group":"Distributing rules","pages":[{"title":"Testing","href":"/versions/9.2.0/rules/testing"},{"title":"Optimizing Performance","href":"/versions/9.2.0/rules/performance"},{"title":"Deploying Rules","href":"/versions/9.2.0/rules/deploying"}]},{"group":"Platforms \u0026 toolchains","pages":[{"title":"Migrating to Platforms","href":"/versions/9.2.0/concepts/platforms"},{"title":"Toolchains","href":"/versions/9.2.0/extending/toolchains"}]},{"group":"API Reference Overview","pages":[{"title":"One-Page Overview","href":"/versions/9.2.0/rules/lib/overview"},{"title":"Rules","href":"/versions/9.2.0/rules/index"},{"title":"Frequently Asked Questions","href":"/versions/9.2.0/rules/faq"}]},{"group":"Starlark Builtins","pages":[{"title":"Error: Variable x is read only","href":"/versions/9.2.0/rules/errors/read-only-variable"},{"title":"Built-in Types","href":"/versions/9.2.0/rules/lib/builtins"},{"title":"Action","href":"/versions/9.2.0/rules/lib/builtins/Action"},{"title":"actions","href":"/versions/9.2.0/rules/lib/builtins/actions"},{"title":"Args","href":"/versions/9.2.0/rules/lib/builtins/Args"},{"title":"Aspect","href":"/versions/9.2.0/rules/lib/builtins/Aspect"},{"title":"Attribute","href":"/versions/9.2.0/rules/lib/builtins/Attribute"},{"title":"BuildSetting","href":"/versions/9.2.0/rules/lib/builtins/BuildSetting"},{"title":"CcCompilationOutputs","href":"/versions/9.2.0/rules/lib/builtins/CcCompilationOutputs"},{"title":"CcLinkingOutputs","href":"/versions/9.2.0/rules/lib/builtins/CcLinkingOutputs"},{"title":"CompilationContext","href":"/versions/9.2.0/rules/lib/builtins/CompilationContext"},{"title":"DirectoryExpander","href":"/versions/9.2.0/rules/lib/builtins/DirectoryExpander"},{"title":"DottedVersion","href":"/versions/9.2.0/rules/lib/builtins/DottedVersion"},{"title":"ExecGroupCollection","href":"/versions/9.2.0/rules/lib/builtins/ExecGroupCollection"},{"title":"ExecGroupContext","href":"/versions/9.2.0/rules/lib/builtins/ExecGroupContext"},{"title":"ExecTransitionFactory","href":"/versions/9.2.0/rules/lib/builtins/ExecTransitionFactory"},{"title":"ExpandedDirectory","href":"/versions/9.2.0/rules/lib/builtins/ExpandedDirectory"},{"title":"Facts","href":"/versions/9.2.0/rules/lib/builtins/Facts"},{"title":"FeatureConfiguration","href":"/versions/9.2.0/rules/lib/builtins/FeatureConfiguration"},{"title":"File","href":"/versions/9.2.0/rules/lib/builtins/File"},{"title":"Label","href":"/versions/9.2.0/rules/lib/builtins/Label"},{"title":"LateBoundDefault","href":"/versions/9.2.0/rules/lib/builtins/LateBoundDefault"},{"title":"LibraryToLink","href":"/versions/9.2.0/rules/lib/builtins/LibraryToLink"},{"title":"License","href":"/versions/9.2.0/rules/lib/builtins/License"},{"title":"LinkerInput","href":"/versions/9.2.0/rules/lib/builtins/LinkerInput"},{"title":"LinkingContext","href":"/versions/9.2.0/rules/lib/builtins/LinkingContext"},{"title":"Provider","href":"/versions/9.2.0/rules/lib/builtins/Provider"},{"title":"Subrule","href":"/versions/9.2.0/rules/lib/builtins/Subrule"},{"title":"SymlinkEntry","href":"/versions/9.2.0/rules/lib/builtins/SymlinkEntry"},{"title":"Target","href":"/versions/9.2.0/rules/lib/builtins/Target"},{"title":"TemplateDict","href":"/versions/9.2.0/rules/lib/builtins/TemplateDict"},{"title":"ToolchainContext","href":"/versions/9.2.0/rules/lib/builtins/ToolchainContext"},{"title":"apple_platform","href":"/versions/9.2.0/rules/lib/builtins/apple_platform"},{"title":"bazel_module","href":"/versions/9.2.0/rules/lib/builtins/bazel_module"},{"title":"bazel_module_tags","href":"/versions/9.2.0/rules/lib/builtins/bazel_module_tags"},{"title":"configuration","href":"/versions/9.2.0/rules/lib/builtins/configuration"},{"title":"ctx","href":"/versions/9.2.0/rules/lib/builtins/ctx"},{"title":"depset","href":"/versions/9.2.0/rules/lib/builtins/depset"},{"title":"exec_result","href":"/versions/9.2.0/rules/lib/builtins/exec_result"},{"title":"extension_metadata","href":"/versions/9.2.0/rules/lib/builtins/extension_metadata"},{"title":"fragments","href":"/versions/9.2.0/rules/lib/builtins/fragments"},{"title":"java_annotation_processing","href":"/versions/9.2.0/rules/lib/builtins/java_annotation_processing"},{"title":"macro","href":"/versions/9.2.0/rules/lib/builtins/macro"},{"title":"mapped_root","href":"/versions/9.2.0/rules/lib/builtins/mapped_root"},{"title":"module_ctx","href":"/versions/9.2.0/rules/lib/builtins/module_ctx"},{"title":"path","href":"/versions/9.2.0/rules/lib/builtins/path"},{"title":"propagation_ctx","href":"/versions/9.2.0/rules/lib/builtins/propagation_ctx"},{"title":"repo_metadata","href":"/versions/9.2.0/rules/lib/builtins/repo_metadata"},{"title":"repository_ctx","href":"/versions/9.2.0/rules/lib/builtins/repository_ctx"},{"title":"repository_os","href":"/versions/9.2.0/rules/lib/builtins/repository_os"},{"title":"repository_rule","href":"/versions/9.2.0/rules/lib/builtins/repository_rule"},{"title":"root","href":"/versions/9.2.0/rules/lib/builtins/root"},{"title":"rule","href":"/versions/9.2.0/rules/lib/builtins/rule"},{"title":"rule_attributes","href":"/versions/9.2.0/rules/lib/builtins/rule_attributes"},{"title":"runfiles","href":"/versions/9.2.0/rules/lib/builtins/runfiles"},{"title":"struct","href":"/versions/9.2.0/rules/lib/builtins/struct"},{"title":"subrule_ctx","href":"/versions/9.2.0/rules/lib/builtins/subrule_ctx"},{"title":"tag_class","description":null,"href":"/versions/9.2.0/rules/lib/builtins/tag_class"},{"title":"template_ctx","href":"/versions/9.2.0/rules/lib/builtins/template_ctx"},{"title":"toolchain_type","description":null,"href":"/versions/9.2.0/rules/lib/builtins/toolchain_type"},{"title":"transition","href":"/versions/9.2.0/rules/lib/builtins/transition"},{"title":"wasm_exec_result","href":"/versions/9.2.0/rules/lib/builtins/wasm_exec_result"},{"title":"wasm_module","href":"/versions/9.2.0/rules/lib/builtins/wasm_module"}]},{"group":"Core Types","pages":[{"title":"Core Starlark data types","href":"/versions/9.2.0/rules/lib/core"},{"title":"bool","href":"/versions/9.2.0/rules/lib/core/bool"},{"title":"builtin_function_or_method","href":"/versions/9.2.0/rules/lib/core/builtin_function_or_method"},{"title":"dict","href":"/versions/9.2.0/rules/lib/core/dict"},{"title":"float","href":"/versions/9.2.0/rules/lib/core/float"},{"title":"function","href":"/versions/9.2.0/rules/lib/core/function"},{"title":"int","href":"/versions/9.2.0/rules/lib/core/int"},{"title":"json","href":"/versions/9.2.0/rules/lib/core/json"},{"title":"list","href":"/versions/9.2.0/rules/lib/core/list"},{"title":"range","href":"/versions/9.2.0/rules/lib/core/range"},{"title":"set","href":"/versions/9.2.0/rules/lib/core/set"},{"title":"string","href":"/versions/9.2.0/rules/lib/core/string"},{"title":"tuple","href":"/versions/9.2.0/rules/lib/core/tuple"}]},{"group":"Providers","pages":[{"title":"Providers","href":"/versions/9.2.0/rules/lib/providers"},{"title":"AnalysisTestResultInfo","href":"/versions/9.2.0/rules/lib/providers/AnalysisTestResultInfo"},{"title":"CcInfo","href":"/versions/9.2.0/rules/lib/providers/CcInfo"},{"title":"CcToolchainConfigInfo","href":"/versions/9.2.0/rules/lib/providers/CcToolchainConfigInfo"},{"title":"CcToolchainInfo","href":"/versions/9.2.0/rules/lib/providers/CcToolchainInfo"},{"title":"ConstraintCollection","href":"/versions/9.2.0/rules/lib/providers/ConstraintCollection"},{"title":"ConstraintSettingInfo","href":"/versions/9.2.0/rules/lib/providers/ConstraintSettingInfo"},{"title":"ConstraintValueInfo","href":"/versions/9.2.0/rules/lib/providers/ConstraintValueInfo"},{"title":"DebugPackageInfo","href":"/versions/9.2.0/rules/lib/providers/DebugPackageInfo"},{"title":"DefaultInfo","href":"/versions/9.2.0/rules/lib/providers/DefaultInfo"},{"title":"ExecutionInfo","href":"/versions/9.2.0/rules/lib/providers/ExecutionInfo"},{"title":"FeatureFlagInfo","href":"/versions/9.2.0/rules/lib/providers/FeatureFlagInfo"},{"title":"FilesToRunProvider","href":"/versions/9.2.0/rules/lib/providers/FilesToRunProvider"},{"title":"IncompatiblePlatformProvider","href":"/versions/9.2.0/rules/lib/providers/IncompatiblePlatformProvider"},{"title":"InstrumentedFilesInfo","href":"/versions/9.2.0/rules/lib/providers/InstrumentedFilesInfo"},{"title":"JavaRuntimeInfo","href":"/versions/9.2.0/rules/lib/providers/JavaRuntimeInfo"},{"title":"JavaToolchainInfo","href":"/versions/9.2.0/rules/lib/providers/JavaToolchainInfo"},{"title":"MaterializedDepsInfo","href":"/versions/9.2.0/rules/lib/providers/MaterializedDepsInfo"},{"title":"ObjcProvider","href":"/versions/9.2.0/rules/lib/providers/ObjcProvider"},{"title":"OutputGroupInfo","href":"/versions/9.2.0/rules/lib/providers/OutputGroupInfo"},{"title":"PackageSpecificationInfo","href":"/versions/9.2.0/rules/lib/providers/PackageSpecificationInfo"},{"title":"PlatformInfo","href":"/versions/9.2.0/rules/lib/providers/PlatformInfo"},{"title":"RunEnvironmentInfo","href":"/versions/9.2.0/rules/lib/providers/RunEnvironmentInfo"},{"title":"TemplateVariableInfo","href":"/versions/9.2.0/rules/lib/providers/TemplateVariableInfo"},{"title":"ToolchainInfo","href":"/versions/9.2.0/rules/lib/providers/ToolchainInfo"},{"title":"ToolchainTypeInfo","href":"/versions/9.2.0/rules/lib/providers/ToolchainTypeInfo"},{"title":"file_provider","href":"/versions/9.2.0/rules/lib/providers/file_provider"},{"title":"java_compilation_info","href":"/versions/9.2.0/rules/lib/providers/java_compilation_info"},{"title":"java_output_jars","href":"/versions/9.2.0/rules/lib/providers/java_output_jars"}]},{"group":"Global Functions","pages":[{"title":"Global functions","href":"/versions/9.2.0/rules/lib/globals"},{"title":"All Bazel files","href":"/versions/9.2.0/rules/lib/globals/all"},{"title":"BUILD files","href":"/versions/9.2.0/rules/lib/globals/build"},{"title":"REPO.bazel files","href":"/versions/9.2.0/rules/lib/globals/repo"},{"title":"VENDOR.bazel files","href":"/versions/9.2.0/rules/lib/globals/vendor"},{"title":".bzl files","href":"/versions/9.2.0/rules/lib/globals/bzl"},{"title":"MODULE.bazel files","href":"/versions/9.2.0/rules/lib/globals/module"}]},{"group":"Configuration Fragments","pages":[{"title":"Configuration Fragments","href":"/versions/9.2.0/rules/lib/fragments"},{"title":"apple","href":"/versions/9.2.0/rules/lib/fragments/apple"},{"title":"bazel_android","href":"/versions/9.2.0/rules/lib/fragments/bazel_android"},{"title":"coverage","href":"/versions/9.2.0/rules/lib/fragments/coverage"},{"title":"cpp","href":"/versions/9.2.0/rules/lib/fragments/cpp"},{"title":"java","href":"/versions/9.2.0/rules/lib/fragments/java"},{"title":"objc","href":"/versions/9.2.0/rules/lib/fragments/objc"},{"title":"platform","href":"/versions/9.2.0/rules/lib/fragments/platform"},{"title":"proto","href":"/versions/9.2.0/rules/lib/fragments/proto"}]},{"group":"Toplevel APIs","pages":[{"title":"Top-level Modules","href":"/versions/9.2.0/rules/lib/toplevel"},{"title":"apple_common","href":"/versions/9.2.0/rules/lib/toplevel/apple_common"},{"title":"attr","href":"/versions/9.2.0/rules/lib/toplevel/attr"},{"title":"cc_common","href":"/versions/9.2.0/rules/lib/toplevel/cc_common"},{"title":"config","href":"/versions/9.2.0/rules/lib/toplevel/config"},{"title":"config_common","href":"/versions/9.2.0/rules/lib/toplevel/config_common"},{"title":"coverage_common","href":"/versions/9.2.0/rules/lib/toplevel/coverage_common"},{"title":"java_common","href":"/versions/9.2.0/rules/lib/toplevel/java_common"},{"title":"native","href":"/versions/9.2.0/rules/lib/toplevel/native"},{"title":"platform_common","href":"/versions/9.2.0/rules/lib/toplevel/platform_common"},{"title":"proto","href":"/versions/9.2.0/rules/lib/toplevel/proto"},{"title":"testing","href":"/versions/9.2.0/rules/lib/toplevel/testing"}]},{"group":"Repo rules","pages":[{"title":"Repository Rules","href":"/versions/9.2.0/rules/lib/repo/index"},{"title":"cache repository rules","href":"/versions/9.2.0/rules/lib/repo/cache"},{"title":"git repository rules","href":"/versions/9.2.0/rules/lib/repo/git"},{"title":"http repository rules","href":"/versions/9.2.0/rules/lib/repo/http"},{"title":"local repository rules","href":"/versions/9.2.0/rules/lib/repo/local"},{"title":"utils repository rules","href":"/versions/9.2.0/rules/lib/repo/utils"}]},{"group":"Module system","pages":[{"title":"External dependencies overview","href":"/versions/9.2.0/external/overview"},{"title":"Bazel modules","href":"/versions/9.2.0/external/module"},{"title":"Module extensions","href":"/versions/9.2.0/external/extension"},{"title":"Bazel registries","href":"/versions/9.2.0/external/registry"},{"title":"Bazel Lockfile","href":"/versions/9.2.0/external/lockfile"},{"title":"Vendor Mode","href":"/versions/9.2.0/external/vendor"},{"title":"Repository Rules","href":"/versions/9.2.0/external/repo"},{"title":"`mod` Command","href":"/versions/9.2.0/external/mod-command"},{"title":"Bzlmod Migration Guide","href":"/versions/9.2.0/external/migration"},{"title":"Bzlmod Migration Tool","href":"/versions/9.2.0/external/migration_tool"},{"title":"Frequently asked questions","href":"/versions/9.2.0/external/faq"}]}]},{"tab":"Community","pages":[{"title":"Community","href":"/versions/9.2.0/contribute"}]}]}]},{"version":"9.1","pages":[{"title":"9.1","href":"/versions/9.1.0/about/intro"}]},{"version":"9.0","pages":[{"title":"9.0","href":"/versions/9.0.0/about/intro"}]},{"version":"8.8","pages":[{"title":"8.8","href":"/versions/8.8.1/rules/errors/read-only-variable"}]},{"version":"8.7","pages":[{"title":"8.7","href":"/versions/8.7.0/about/intro"}]},{"version":"8.6","pages":[{"title":"8.6","href":"/versions/8.6.0/about/intro"}]},{"version":"8.5","pages":[{"title":"8.5","href":"/versions/8.5.1/about/intro"}]},{"version":"8.4","pages":[{"title":"8.4","href":"/versions/8.4.2/about/intro"}]},{"version":"8.3","pages":[{"title":"8.3","href":"/versions/8.3.1/about/intro"}]},{"version":"8.2","pages":[{"title":"8.2","href":"/versions/8.2.1/about/intro"}]},{"version":"8.1","pages":[{"title":"8.1","href":"/versions/8.1.1/about/intro"}]},{"version":"8.0","pages":[{"title":"8.0","href":"/versions/8.0.1/about/intro"}]},{"version":"7.7","pages":[{"title":"7.7","href":"/versions/7.7.1/about/intro"}]}]},"title":"template_ctx - Bazel Documentation","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":["10e4515597"],"chunks":["BannerMarkdown-BVNUlwBc.js","dist-aeztFa9U.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-rL8ZCCw4.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}