From 226427220299f596e2c71965f98efb2d7962e4cd Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Mon, 9 Sep 2024 11:42:09 -0300 Subject: [PATCH] feat(cli): enforce build for linux/riscv64 platform since the target is always a Cartesi Machine (riscv64), cartesi build should enforce the docker build environment via --platform argument --- .changeset/big-ghosts-rescue.md | 5 +++++ apps/cli/src/commands/build.ts | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/big-ghosts-rescue.md diff --git a/.changeset/big-ghosts-rescue.md b/.changeset/big-ghosts-rescue.md new file mode 100644 index 00000000..4794ee5b --- /dev/null +++ b/.changeset/big-ghosts-rescue.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +enforce build for linux/riscv64 platform diff --git a/apps/cli/src/commands/build.ts b/apps/cli/src/commands/build.ts index 47a85dcd..cd5d4e0c 100644 --- a/apps/cli/src/commands/build.ts +++ b/apps/cli/src/commands/build.ts @@ -69,7 +69,15 @@ export default class BuildApplication extends BaseCommand< this.debug( `building docker image and writing result to ${buildResult}`, ); - const args = ["buildx", "build", "--load", "--iidfile", buildResult]; + const args = [ + "buildx", + "build", + "--load", + "--iidfile", + buildResult, + "--platform", + "linux/riscv64", + ]; if (options.target) { args.push("--target", options.target); }