diff --git a/buck2/rust/BUCK b/buck2/rust/BUCK index 7cf8e35b..dd3a91a2 100644 --- a/buck2/rust/BUCK +++ b/buck2/rust/BUCK @@ -74,4 +74,4 @@ rust_test( "//platforms:engflow": "//platforms:remote_execution_action_keys", "DEFAULT": None, }), -) \ No newline at end of file +) diff --git a/buck2/rust/README.md b/buck2/rust/README.md index 4c44c109..e03ea0c2 100644 --- a/buck2/rust/README.md +++ b/buck2/rust/README.md @@ -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. @@ -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 diff --git a/buck2/rust/platforms/BUCK b/buck2/rust/platforms/BUCK index 2c280830..67a4d912 100644 --- a/buck2/rust/platforms/BUCK +++ b/buck2/rust/platforms/BUCK @@ -39,4 +39,4 @@ action_keys( cell = "standard", mode = "standard", visibility = ["PUBLIC"], -) \ No newline at end of file +) diff --git a/buck2/rust/platforms/defs.bzl b/buck2/rust/platforms/defs.bzl index ed118466..7b4b352d 100644 --- a/buck2/rust/platforms/defs.bzl +++ b/buck2/rust/platforms/defs.bzl @@ -73,4 +73,4 @@ action_keys = rule( "mode": attrs.string(), }, impl = _action_keys -) \ No newline at end of file +)