Skip to content

Use 'cfg=target' for pusher binary - #2203

Merged
uhthomas merged 1 commit into
bazelbuild:masterfrom
anguslees:gus/revup/master/pusha-t-arget
Jan 18, 2023
Merged

Use 'cfg=target' for pusher binary#2203
uhthomas merged 1 commit into
bazelbuild:masterfrom
anguslees:gus/revup/master/pusha-t-arget

Conversation

@anguslees

Copy link
Copy Markdown
Contributor

In container_push rule, _pusher executable is copied into the output
runfiles, but not directly invoked by the container_push rule. This
binary could potentially be cross-compiled by other remote executors,
and should use the 'target' config in this action.

In container_push rule, `_pusher` executable is copied into the output
runfiles, but not directly invoked _by_ the container_push rule.  This
binary could potentially be cross-compiled by other remote executors,
and should use the 'target' config in this action.
@uhthomas

Copy link
Copy Markdown
Collaborator

Maybe I'm misunderstanding but shouldn't this be exec?

@anguslees

anguslees commented Jan 16, 2023

Copy link
Copy Markdown
Contributor Author

Maybe I'm misunderstanding but shouldn't this be exec?

It's very possible that I'm misunderstanding too - so please double-check 😅

As an executable rule, I think the container_push rule expands a template to produce a shell script - which is usually later executed locally by bazel run. This template/shell script references the _pusher executable, but does not actually execute (ctx.actions.run) _pusher itself - unlike _digester, for comparison.

This means that (hypothetically), the container_push rule can run on one executor, and the _pusher binary can be built on another executor. The only thing that is important, is that the _pusher binary (and runfiles) works on the target platform of the container_push rule.

@uhthomas

Copy link
Copy Markdown
Collaborator

Wow.

@uhthomas uhthomas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you :)

@uhthomas
uhthomas merged commit e48c7cc into bazelbuild:master Jan 18, 2023
@anguslees
anguslees deleted the gus/revup/master/pusha-t-arget branch January 25, 2023 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants