Skip to content

Add --arch flag to build and publish commands for single-arch builds#476

Open
hcastc00 wants to merge 2 commits intomasterfrom
hcastc00/add-arch-flag
Open

Add --arch flag to build and publish commands for single-arch builds#476
hcastc00 wants to merge 2 commits intomasterfrom
hcastc00/add-arch-flag

Conversation

@hcastc00
Copy link

@hcastc00 hcastc00 commented Mar 6, 2026

Summary

  • Add --arch flag to build and publish commands to allow building for a single architecture instead of all architectures defined in the manifest
  • Accepts both full names (linux/arm64, linux/amd64) and shorthands (arm, arm64, amd64, x64, etc.)
  • Validates that the requested architecture is supported by the package manifest before building

Usage

# Build only for arm64
dappnodesdk build --arch arm64

# Build only for amd64
dappnodesdk build --arch amd64

# Full architecture names also work
dappnodesdk build --arch linux/arm64

# Works with publish too
dappnodesdk publish patch --arch arm64

Changed files

  • src/commands/build/index.ts - Register --arch CLI option
  • src/commands/build/types.ts - Add arch to BuildCommandOptions
  • src/commands/build/handler.ts - Filter architectures + normalizeArchitecture helper
  • src/commands/publish/index.ts - Register --arch CLI option
  • src/commands/publish/types.ts - Add arch to PublishCommandOptions
  • src/commands/publish/handler.ts - Filter architectures using shared helper

Test plan

  • Build a multi-arch package with --arch arm64 and verify only arm64 image is built
  • Build with --arch amd64 and verify only amd64 image is built
  • Verify shorthands (arm, arm64, amd64, x64) resolve correctly
  • Verify error when using --arch with an unsupported architecture for the package
  • Verify builds without --arch still build all architectures as before

@hcastc00 hcastc00 requested a review from a team as a code owner March 6, 2026 10:44
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 34828b3

This is a development version and should only be installed for testing purposes.

  1. Package dappnodesdk.public.dappnode.eth

Install link

Hash: /ipfs/QmPJW3pa45L4ryC1dnyztYkJPGgQVB6VDgB5nUvsqVyBkg

(by dappnodebot/build-action)

@Marketen
Copy link
Contributor

Marketen commented Mar 6, 2026

I wouldnt let the sdk publish something with only 1 arch if 2 are present in the manifest. This may provoke that we stop supporting an arch unintentionally in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants