{"id":20132543,"url":"https://github.com/aherrmann/bazel-configuration-rebuild","last_synced_at":"2026-03-04T23:01:57.674Z","repository":{"id":71967600,"uuid":"352950333","full_name":"aherrmann/bazel-configuration-rebuild","owner":"aherrmann","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-30T09:51:21.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T22:18:29.927Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aherrmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"bazel-rules-authors-sig"}},"created_at":"2021-03-30T09:50:48.000Z","updated_at":"2021-03-30T09:51:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"9408dd1a-a311-4e6f-b450-4c795011ea20","html_url":"https://github.com/aherrmann/bazel-configuration-rebuild","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aherrmann/bazel-configuration-rebuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fbazel-configuration-rebuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fbazel-configuration-rebuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fbazel-configuration-rebuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fbazel-configuration-rebuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aherrmann","download_url":"https://codeload.github.com/aherrmann/bazel-configuration-rebuild/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fbazel-configuration-rebuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30098088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T22:49:54.894Z","status":"ssl_error","status_checked_at":"2026-03-04T22:49:48.883Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T20:53:57.659Z","updated_at":"2026-03-04T23:01:57.657Z","avatar_url":"https://github.com/aherrmann.png","language":"Starlark","funding_links":["https://opencollective.com/bazel-rules-authors-sig"],"categories":[],"sub_categories":[],"readme":"# Duplicate Builds with Configuration Transitions\n\nThe target `//:cat` is independent of the user defined build flag `//:flag`.\nThe target `//:flag_cat` on the other hand depends on the value of the flag and\non `//:cat` as well.\n\nThe target `//:cat` is only built once, and cached under the same action cache\nkey, if the configuration is set via command-line flag.\n\n```\n$ bazel clean --expunge; bazel build //:flag_cat --disk_cache=.cache/default --build_event_publish_all_actions --build_event_json_file=default.json\n\n$ bazel clean --expunge; bazel build //:flag_cat --//:flag=different_flag --disk_cache=.cache/different --build_event_publish_all_actions --build_event_json_file=different.json\n\n$ jq 'select(.id.actionCompleted.label == \"//:cat\")' \u003cdefault.json | jq -s length\n1\n\n$ jq 'select(.id.actionCompleted.label == \"//:cat\")' \u003cdifferent.json | jq -s length\n1\n\n$ rg 'bin/cat.txt' .cache/*/ac\n.cache/default/ac/b9/b966d571c54c4aa37fc5ae7629f95caaa01ad79474fdc406c9e9a79341c950f6\n2:\"bazel-out/k8-fastbuild/bin/cat.txtD\n\n.cache/different/ac/b9/b966d571c54c4aa37fc5ae7629f95caaa01ad79474fdc406c9e9a79341c950f6\n2:\"bazel-out/k8-fastbuild/bin/cat.txtD\n```\n\nThe targets `//:transition_default` and `//:transition_different` use a\nconfiguration transition to set the value of the build setting `//:flag` to\n`\"default_flag\"` and `\"different_flag\"` respectively.\n\nThe target `//:cat` is built twice and cached under different action cache keys\nwhen building these transition targets, even though `//:cat` does not depend on\nthe build setting.\n\n```\n$ bazel clean --expunge; bazel build //:transition_default //:transition_different --disk_cache=.cache/transition --build_event_publish_all_actions --build_event_json_file=transition.json\n\n$ jq 'select(.id.actionCompleted.label == \"//:cat\")' \u003ctransition.json | jq -s length\n2\n\n$ rg 'bin/cat.txt' .cache/transition/ac\n.cache/transition/ac/b9/b966d571c54c4aa37fc5ae7629f95caaa01ad79474fdc406c9e9a79341c950f6\n2:\"bazel-out/k8-fastbuild/bin/cat.txtD\n\n.cache/transition/ac/8a/8a979615135482bd13afbdf6004d5c87c0a5f3427bcedc299f496eeff4946e29\n2:2bazel-out/k8-fastbuild-ST-1d73fa6ab729/bin/cat.txtD\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faherrmann%2Fbazel-configuration-rebuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faherrmann%2Fbazel-configuration-rebuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faherrmann%2Fbazel-configuration-rebuild/lists"}