Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

fix(buck2): declare build_deps on docker_image as dep type#2619

Merged
si-bors-ng[bot] merged 1 commit intomainfrom
fnichol/buck2-docker-deps
Aug 16, 2023
Merged

fix(buck2): declare build_deps on docker_image as dep type#2619
si-bors-ng[bot] merged 1 commit intomainfrom
fnichol/buck2-docker-deps

Conversation

@fnichol
Copy link
Copy Markdown
Contributor

@fnichol fnichol commented Aug 16, 2023

This change fixes an issue when our CI/CD system computes "work to do" in the si/merge-queue pipeline. Prior to this change the build_deps attribute on the docker_image Buck2 rule was type string, primarily as these values were being passed further down for more processing via a BXL and Python script.

The issue arises when we compute dependent work on source file changes, say bin/council/src/main.rs which should be pulled into //bin/council:image via the //bin/council:council target. As our attribute type here was string, Buck2 doesn't know we want to consider this as an input to the image. In this case we don't need the inputs built, only declared so that later when we ask the question "what are all reverse deps that are impacted with this source change", we get our Docker image builds as one of the targets. Changing the attribute type to dep allows Buck2 to track this in its graph.

This change fixes an issue when our CI/CD system computes "work to do"
in the `si/merge-queue` pipeline. Prior to this change the `build_deps`
attribute on the `docker_image` Buck2 rule was type `string`, primarily
as these values were being passed further down for more processing via a
BXL and Python script.

The issue arises when we compute dependent work on source file changes,
say `bin/council/src/main.rs` which should be pulled into
`//bin/council:image` via the `//bin/council:council` target. As our
attribute type here was `string`, Buck2 doesn't know we want to consider
this as an input to the image. In this case we don't need the inputs
*built*, only declared so that later when we ask the question "what are
all reverse deps that are impacted with this source change", we get our
Docker image builds as one of the targets. Changing the attribute type
to `dep` allows Buck2 to track this in its graph.

Signed-off-by: Fletcher Nichol <fletcher@systeminit.com>
@fnichol
Copy link
Copy Markdown
Contributor Author

fnichol commented Aug 16, 2023

bors try

si-bors-ng Bot added a commit that referenced this pull request Aug 16, 2023
@si-bors-ng
Copy link
Copy Markdown
Contributor

si-bors-ng Bot commented Aug 16, 2023

try

Build succeeded:

@fnichol
Copy link
Copy Markdown
Contributor Author

fnichol commented Aug 16, 2023

bors merge

@si-bors-ng
Copy link
Copy Markdown
Contributor

si-bors-ng Bot commented Aug 16, 2023

Build succeeded:

@si-bors-ng si-bors-ng Bot merged commit ba11ac6 into main Aug 16, 2023
@si-bors-ng si-bors-ng Bot deleted the fnichol/buck2-docker-deps branch August 16, 2023 20:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant