canonical / rockcraft

Tool to create OCI Images using the language from Snapcraft and Charmcraft.
GNU General Public License v3.0
25 stars 33 forks source link

fork/exec error when building Go rock with the 24.04 build-base #579

Open gruyaume opened 1 month ago

gruyaume commented 1 month ago

Bug Description

I am getting errors when trying to build Go rocks with the 24.04 build-base. With the rockcraft.yaml file referenced below, the rock works fine with Ubuntu 22.04, but not with 24.04.

To Reproduce

  1. Pack the rock
  2. Convert to skopeo
  3. Docker run the rock
  4. Pebble exec bin/

Environment

rockcraft.yaml

name: sdcore-amf
base: bare
build-base: ubuntu@24.04
version: '1.4.1'
summary: SD-Core AMF
description: SD-Core AMF
license: Apache-2.0
platforms:
  amd64:
  arm64:

parts:
  amf:
    plugin: go
    source: https://github.com/gruyaume/amf.git
    source-type: git
    source-branch: dev-tls
    build-snaps:
      - go/1.21/stable
    stage-packages:
      - libc6_libs
    organize:
      bin/cmd: bin/amf

Relevant log output

guillaume@thinkpad:~$ docker exec eb04758477aa pebble exec /bin/amf
error: cannot perform the following tasks:
- Execute command "/bin/amf" (fork/exec /bin/amf: no such file or directory)
cjdcordeiro commented 1 month ago

Hi @gruyaume .

You might be missing the base-files_lib slice. Can you try that?

gruyaume commented 1 month ago

@cjdcordeiro thank you, indeed this does solve the issue. How could have I known this though? In general when building a rock for a given plugin it would be great to know what are the minimal package requirements for it

cjdcordeiro commented 1 month ago

@gruyaume this is an unfortunate upstream change introduced in 24.10. For chisel, there are no assumptions, so even though libc6 should now depend on base-files, the upstream deb has no such dependency.

As for your plugin suggestion, it is something worth considering (although risky, cause the plugin cannot know everything that is needed and thus end up adding more/less than what's actually required). I'll put this for internal discussion anyway.