Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

become compatible with incompatible_disable_starlark_host_transitions #118

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions snapshots/snapshots.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SNAPSHOTS_ATTRS = {
"_snapshots": attr.label(
executable = True,
default = Label("@snapshots-bin//:snapshots"),
cfg = "host",
cfg = "exec",
),
}

Expand Down Expand Up @@ -145,7 +145,7 @@ _snapshots_runner = rule(
attrs = {
"snapshots": attr.label(
default = "@snapshots-bin//:snapshots",
cfg = "host",
cfg = "target",
Copy link
Collaborator

Choose a reason for hiding this comment

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

WHy is this one target while the other one is exec? Aren't both refering to the same binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are the same binary, however the way both binaries are used is different.
I could be wrong about this but:
In the case of _snapshots_runner, we are not running the executable during build phase, but at runtime.
Because we want the binary that snapshots_runner produces to use a binary that the machine runs the script will use.

Some documentation on the subject: https://bazel.build/extending/rules#configurations

executable = True,
allow_single_file = True,
),
Expand Down