Skip to content

Build is including x86 libraries in the arm build #60

@stevendborrelli

Description

@stevendborrelli
Collaborator

Bug Report

What happened?

For some reason the arm64 build is including x86 images in the build:

How can we reproduce it?

Run a recent build on an arm Mac system, for example. https://github.com/crossplane-contrib/function-shell/actions/runs/15601376815/job/43941818507

$ docker run  ghcr.io/crossplane-contrib/function-shell@sha256:36b7ccd7124c762f7ee377e213390f38b7323a676f4307ffd017eb2bd2fb7725 --insecure

Verify the architecture as arm64:

$ docker inspect ghcr.io/crossplane-contrib/function-shell@sha256:36b7ccd7124c762f7ee377e213390f38b7323a676f4307ffd017eb2bd2fb7725 | jq '.[0].Architecture'
"arm64"

Run the function image:

$ docker run  ghcr.io/crossplane-contrib/function-shell@sha256:36b7ccd7124c762f7ee377e213390f38b7323a676f4307ffd017eb2bd2fb7725 --insecure

Exec to a shell and examine the shell and other binaries, they will be x86.

$ file /usr/bin/dash
/usr/bin/dash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=be6397ddffc3e384c505d7deab3bed190c884df9, for GNU/Linux 3.2.0, stripped

What environment did it happen in?

Function version:

Activity

stevendborrelli

stevendborrelli commented on Jun 12, 2025

@stevendborrelli
CollaboratorAuthor

Buildx seems to support arm:

https://github.com/crossplane-contrib/function-shell/actions/runs/15601376815/job/43941818507#step:3:216

"nodes": [
      {
        "name": "builder-31a22ea7-b26d-4cc6-9814-874438a9b2f50",
        "endpoint": "unix:///var/run/docker.sock",
        "status": "running",
        "buildkitd-flags": "--debug --allow-insecure-entitlement=network.host",
        "buildkit": "v0.22.0",
        "platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/loong64,linux/arm/v7,linux/arm/v6",
        "features": {
          "Automatically load images to the Docker Engine image store": true,
          "Cache export": true,
          "Direct push": true,
          "Docker exporter": true,
          "Multi-platform build": true,
          "OCI exporter": true
        },
stevendborrelli

stevendborrelli commented on Jun 12, 2025

@stevendborrelli
CollaboratorAuthor

Testing PR #61

$ file usr/bin/dash
/usr/bin/dash: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=203461ab74495108600eb023c46b7e8413529eea, for GNU/Linux 3.7.0, stripped
$ aws --version
aws-cli/2.27.34 Python/3.13.3 Linux/6.10.14-linuxkit exe/aarch64.debian.12
stevendborrelli

stevendborrelli commented on Jun 13, 2025

@stevendborrelli
CollaboratorAuthor

I'm waiting for more testing before cutting a new release using this build, but in my initial testing the correct binaries are included now.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @stevendborrelli

        Issue actions

          Build is including x86 libraries in the arm build · Issue #60 · crossplane-contrib/function-shell