Skip to content

bxl: get output artifacts for an Action#1227

Open
lf- wants to merge 1 commit intofacebook:mainfrom
MercuryTechnologies:jade/push-kvpoorkyzwku
Open

bxl: get output artifacts for an Action#1227
lf- wants to merge 1 commit intofacebook:mainfrom
MercuryTechnologies:jade/push-kvpoorkyzwku

Conversation

@lf-
Copy link
Contributor

@lf- lf- commented Feb 10, 2026

  • Rename action to bxl.Action so it is findable in docs (I don't know if that was what was preventing docs generation, but it's worth a try!)
  • Add a method to get the output artifacts for an action in bxl. This allows selectively rebuilding the action by ensuring those outputs.

I added a test, but I have no way to run those besides www.metacareers.com: #1027

This is part of making action graph debugging slightly easier, which I want to prototype by writing some rather nasty BXLs: #1217

Unfortunately I think there's no way to get the dependencies after the fact, since I just have a RegisteredAction. I believe that I can probably do something very bad with owner() then rerunning the analysis to get deps though.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 10, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Feb 10, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D92785802. (Because this pull request was imported automatically, there will not be any future comments.)

- Rename action to bxl.Action so it is findable in docs (I don't know if
  that was what was preventing docs generation, but it's worth a try!)
- Add a method to get the output artifacts for an action in bxl. This
  allows selectively rebuilding the action by ensuring those outputs.

I added a test, but I have no way to run those besides
www.metacareers.com: facebook#1027

This is part of making action graph debugging slightly easier, which I
want to prototype by writing some rather nasty BXLs:
facebook#1217

Unfortunately I *think* there's no way to get the dependencies after the
fact, since I *just* have a RegisteredAction. I believe that I can
probably do something very bad with owner() then rerunning the analysis
to get deps though.
@lf- lf- force-pushed the jade/push-kvpoorkyzwku branch from 2d859d2 to 958658b Compare February 18, 2026 20:59
josephsumabat added a commit to MercuryTechnologies/buck2 that referenced this pull request Mar 11, 2026
.action()
.outputs()
.iter()
.map(|a| StarlarkArtifact::new(Artifact::from(a.clone())))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can use a.dupe().

action = ctx.audit().output(buck_out)

asserts.equals(action.owner(), target.label)
asserts.equals(actions.outputs()[0].basename, "with_output.txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a typo, should be action not actions

@Nero5023
Copy link
Contributor

Hey, thank you for the PR!

Overall lgtm! Only twos nit I commented above, could you resolve those and do a rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants