Skip to content

Build task fails on macOS with Apple silicon CPUs #52

@8bit-echo

Description

@8bit-echo

When cloning a repo based on this template, I am unable to start development because the build tasks fail on Macs with Apple Silicon CPUs. The failure is coming from the step where the decky cli spins up the Docker image in the backend folder. Here's the interesting line from the ouput:

- InvalidBaseImagePlatform: Base image ghcr.io/steamdeckhomebrew/holo-base:latest was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 6)

Full output of the build task below:

 *  Executing task: /Users/<USER>/Developer/decky-plugin/.vscode/setup.sh 

If you are using alpine linux, do not expect any support.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: which pnpm && pnpm i 

/opt/homebrew/bin/pnpm
Lockfile is up to date, resolution step is skipped
Already up to date

Done in 438ms
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: pnpm update @decky/ui --latest 

Progress: resolved 0, reused 1, downloaded 0, added 0
 WARN  3 deprecated subdependencies found: glob@7.2.3, inflight@1.0.6, rimraf@3.0.2
Already up to date
Progress: resolved 216, reused 201, downloaded 0, added 0, done

Done in 1s
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: /Users/<USER>/Developer/decky-plugin/.vscode/config.sh 

.vscode/settings.json does exist. Congrats.
Make sure to change settings.json to match your deck.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: /Users/<USER>/Developer/decky-plugin/.vscode/build.sh  

Building plugin in /Users/<USER>/Developer/decky-plugin
Please input sudo password to proceed.
Password:
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
INFO [decky::plugin] Looking for package.json...
INFO [decky::plugin] Looking for plugin.json...
INFO [decky::cli::plugin::build] Creating temporary build directory
INFO [decky::cli::plugin::build] Building plugin
INFO [decky::cli::plugin::build] Building backend
[+] Building 0.4s (5/5) FINISHED                                                                                                 docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                             0.0s
 => => transferring dockerfile: 480B                                                                                                             0.0s
 => [internal] load metadata for ghcr.io/steamdeckhomebrew/holo-base:latest                                                                      0.4s
 => [internal] load .dockerignore                                                                                                                0.0s
 => => transferring context: 2B                                                                                                                  0.0s
 => CACHED [1/1] FROM ghcr.io/steamdeckhomebrew/holo-base:latest@sha256:8da120a3e89c750abd0090c0aab86d543a55d667c3002c8d64960f7fd82ccdd6         0.0s
 => exporting to image                                                                                                                           0.0s
 => => exporting layers                                                                                                                          0.0s
 => => writing image sha256:7fa8ecd5af00c4ab2b533b4ed7e5da4afdd1ae8dbcdd3cd2130e984d36b600da                                                     0.0s
 => => naming to docker.io/library/example-plugin                                                                                                0.0s

 1 warning found (use docker --debug to expand):
 - InvalidBaseImagePlatform: Base image ghcr.io/steamdeckhomebrew/holo-base:latest was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 6)
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Line: Container's IP address: 172.17.0.2
Line: mkdir -p ./out
Line: gcc -o ./out/hello ./src/main.c 
INFO [decky::cli::plugin::build] Building frontend
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Line: ? The modules directory at "/plugin/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ‣ true
Line:    ╭───────────────────────────────────────────────────────────────────╮
Line:    │                                                                   │
Line:    │                Update available! 9.15.0 → 10.15.0.                │
Line:    │   Changelog: https://github.com/pnpm/pnpm/releases/tag/v10.15.0   │
Line:    │                 Run "pnpm add -g pnpm" to update.                 │
Line:    │                                                                   │
Line:    ╰───────────────────────────────────────────────────────────────────╯
Line: 
Line: 
Line: > decky-plugin-template@0.0.1 build /plugin
Line: > rollup -c
Line: 
/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js:59
                throw new Error(
                ^

Error: Cannot find module @rollup/rollup-linux-x64-musl. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js:68:76)
    ... 3 lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/shared/parseAst.js:12:19)
    at Module._compile (node:internal/modules/cjs/loader:1469:14) {
  [cause]: Error: Cannot find module '@rollup/rollup-linux-x64-musl'
  Require stack:
  - /plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js
  - /plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/shared/parseAst.js
  - /plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/shared/rollup.js
  - /plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/bin/rollup
      at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
      at Module._load (node:internal/modules/cjs/loader:1051:27)
      at Module.require (node:internal/modules/cjs/loader:1311:19)
      at require (node:internal/modules/helpers:179:18)
      at requireWithFriendlyError (/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js:41:10)
      at Object.<anonymous> (/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js:68:76)
      at Module._compile (node:internal/modules/cjs/loader:1469:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
      at Module.load (node:internal/modules/cjs/loader:1288:32)
      at Module._load (node:internal/modules/cjs/loader:1104:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/native.js',
      '/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/shared/parseAst.js',
      '/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/shared/rollup.js',
      '/plugin/node_modules/.pnpm/rollup@4.22.5/node_modules/rollup/dist/bin/rollup'
    ]
  }
}

Node.js v20.18.1
Line:  ELIFECYCLE  Command failed with exit code 1.
Line: error code: 0
Line: pnpm build failed, please report this issue to the CI maintainer and the plugin developer.
Error: Failed to build frontend. There might be more information in the output above.

Caused by:
    child status was: exit status: 1

 *  The terminal process "/Users/<USER>/Developer/decky-plugin/.vscode/build.sh" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions