Skip to content

Commit

Permalink
more review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nlopezgi committed Jan 8, 2025
1 parent 7a217d5 commit 47d3291
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions buck2/rust/.buckconfig
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[cells]
root = .
prelude = prelude
toolchains = toolchains
none = none
root = .
prelude = prelude
toolchains = toolchains
none = none

[cell_aliases]
config = prelude
fbcode = none
fbsource = none
buck = none
config = prelude
fbcode = none
fbsource = none
buck = none

[external_cells]
prelude = bundled
prelude = bundled

[parser]
target_platform_detector_spec = target:root//...->root//platforms:remote_platform
target_platform_detector_spec = target:root//...->root//platforms:remote_platform

[buck2]
digest_algorithms = SHA256
Expand All @@ -26,7 +26,7 @@ cas_address = <CLUSTER_NAME>.cluster.engflow.com
http_headers = <AUTH_HTTP_HEADERS>

[build]
execution_platforms = root//platforms:remote_platform
execution_platforms = root//platforms:remote_platform

[project]
ignore = .git
ignore = .git
8 changes: 4 additions & 4 deletions 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 `--target-platforms` flag.
* 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`.
* 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. We use a bookworm image with rust pre-installed. Image details can be found in https://gallery.ecr.aws/docker/library/rust. The Dockerfile can be found in https://github.com/rust-lang/docker-rust/blob/700c4f146427808cfb1e07a646e4afabbe99da4f/stable/bullseye/Dockerfile. If a different version of `rust` or other tools is needed you should create your own image and publish it to a repo that is accessible from the cluster.

Expand All @@ -31,16 +31,16 @@ The `src`, `bin` and `test` cells:
To test the project with RE run (after setting up `.buckconfig` as indicated below):

```
buck2 test --target-platforms //platforms:remote_platform //:test
buck2 test --remote-only //:test
```

You can also build the `main` for this sample by running:

```
buck2 build --target-platforms //platforms:remote_platform //:main
buck2 build --remote-only //:main
```

Note the use of `--target-platforms` to select the remote platform as part of the build / test command.
Note the use of `--remote-only` to indicate remote execution should be used for the build / test command.

### Relevant configs in `.buckconfig`

Expand Down

0 comments on commit 47d3291

Please sign in to comment.