chainguard-dev / melange

build APKs from source code
Apache License 2.0
382 stars 83 forks source link

WARNING: target-architecture and --arch do not overlap, nothing to build #1050

Open TimKnight-DWP opened 4 months ago

TimKnight-DWP commented 4 months ago

YAML file

# SPDX-FileCopyrightText: 2023 Chainguard, Inc
# SPDX-License-Identifier: Apache-2.0
#
# This is a sample configuration file to demonstrate how to build a software
# project using melange
package:
  name: minimal
  version: 0.0.1
  epoch: 0
  description: a very basic melange example
  target-architecture:
    - amd64
    - arm64

environment:
  contents:
    repositories:
      - https://packages.wolfi.dev/os
    keyring:
      - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
    packages:
      - busybox=1.36.1

pipeline:
  - runs: |
      mkdir "world"
      echo "hello" > "world/hello"

Command

melange build example.melange.yaml

or

docker run --privileged --rm -v "${PWD}":/work \
  cgr.dev/chainguard/melange build example.melange.yaml  

Logs in console:

2024/02/27 12:57:53 WARN skipping arch 386
2024/02/27 12:57:53 WARN skipping arch amd64
2024/02/27 12:57:53 WARN skipping arch arm64
2024/02/27 12:57:53 WARN skipping arch arm/v6
2024/02/27 12:57:53 WARN skipping arch arm/v7
2024/02/27 12:57:53 WARN skipping arch ppc64le
2024/02/27 12:57:53 WARN skipping arch riscv64
2024/02/27 12:57:53 WARN skipping arch s390x
2024/02/27 12:57:53 WARN WARNING: target-architecture and --arch do not overlap, nothing to build

Please can someone advise, from looking at the documentation, that feels like a command which should work?

willswire commented 4 months ago

Try using the following in your YAML file:

  target-architecture:
    - x86_64
    - aarch64
TimKnight-DWP commented 4 months ago

@willswire I'm able to build x86_64 but no other arches, I feel like if the warning is related to underlying CPU architecture of the build machine (i.e. selected arches it can't build), then the warning should state that explicitly?

siennathesane commented 2 months ago

If you're building on a Mac using kind/{Docker,Rancher} Desktop, add the cloud.google.com/compute-class: Scale-Out label to your node. I submitted #1163 to fix this