Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
nlopezgi committed Dec 10, 2024
1 parent 1a0ccba commit 86e0d6d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion buck2/rust/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ rust_test(
"//platforms:engflow": "//platforms:remote_execution_action_keys",
"DEFAULT": None,
}),
)
)
4 changes: 3 additions & 1 deletion buck2/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is based on two existing samples in the Buck2 upstream repo:

In the `platforms` cell we specify:
In the `platforms` cell we specify:
* The platform used for remote execution in this project `root//platforms:remote_platform`, which includes the definition of the Docker image used for remote execution, and that defines constraints for targets to run in the remote execution environment. This platform provides an `ExecutionPlatformRegistrationInfo` a `ConfigurationInfo` and a `PlatformInfo` to be able to be used in the `.buckconfig`, and in the `exec_compatible_with` and `default_target_platform` of `rust_*` rules. Note since rust rules depend on C++ linking this is needed similarly to the Buck2 cpp example in this repo.
* The platform used for remote execution in this project `root//platforms:remote_platform`, which includes the definition of the Docker image used for remote execution, and that defines constraints for targets to run in the remote execution environment. This platform provides an `ExecutionPlatformRegistrationInfo` a `ConfigurationInfo` and a `PlatformInfo` to be able to be used in the `.buckconfig`, in the `--target-platforms` flag, and in the `exec_compatible_with` of `rust_*` rules. Note since rust rules depend on C++ linking this is needed similarly to the Buck2 cpp example in this repo.
* The action keys `root//platforms:remote_execution_action_keys`, which provides a default `BuildModeInfo` that is needed for RE of tests to function properly.
* The platform `image` configured in `platforms/defs.bzl`, notably, uses a different image than other Buck2 samples in this repo. Specifically, it uses a public AWS image that has `rust` preinstalled. This is because Buck2 rust rules do not include a hermetic rust toolchain.

Expand Down Expand Up @@ -40,6 +40,8 @@ You can also build the `main` for this sample by running:
buck2 build --target-platforms //platforms:remote_platform //:main
```

Note the use of `--target-platforms` to select the remote platform as part of the build / test command.

### Relevant configs in `.buckconfig`

The EngFlow endpoint and certificate should be configured as the
Expand Down
2 changes: 1 addition & 1 deletion buck2/rust/platforms/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ action_keys(
cell = "standard",
mode = "standard",
visibility = ["PUBLIC"],
)
)
2 changes: 1 addition & 1 deletion buck2/rust/platforms/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ action_keys = rule(
"mode": attrs.string(),
},
impl = _action_keys
)
)

0 comments on commit 86e0d6d

Please sign in to comment.