From 3ca76b7f6096f00b01e71f0c4bcb283c9d65ab3a 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 f78236df..486194e9 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); }