canonical / core18

The core18 base snap
14 stars 26 forks source link

Multiarch isn't working #129

Closed xordspar0 closed 2 years ago

xordspar0 commented 5 years ago

I'm trying to build a snap for a 32 bit binary on a 64 bit dev machine. As of https://github.com/snapcore/core18/commit/f87a2341f1059c844a88b38f11d39b2546260820 it should be possible to install 32 bit libraries such as libstdc++6:i386, however, i386 doesn't seem to be enabled. If I add a :i386 packages to stage-packages in my snapcraft.yaml, the build step fails and apt recommends that I run dpkg --add-architecture i386.

I'm using the current stable core18 snap: 20190409 2019-04-12 (941)

Here is a minimal snapcraft.yaml that will reproduce it:

name: test
version: 0.0.1
summary: test
description: |
  test
grade: devel
confinement: devmode
base: core18
architectures:
  - build-on: amd64
    run-on: [i386, amd64]
parts:
  test-i386:
    plugin: nil
    stage-packages:
      - libstdc++6:i386
xordspar0 commented 5 years ago

Since I reported this, the candidate release was promoted to stable. Everything works fine in 20190508 2019-05-21 (970)!

xordspar0 commented 5 years ago

After I did a snapcraft clean I realized that nothing has actually changed. By default core18 still does not have the i386 architecture enabled on amd64 builds. I was able to do dpkg --add-architecture i386 in one of my parts though.

Meulengracht commented 2 years ago

This is currently not supported by snapcraft, and we do not know when such support will come. Right now we can only recommend to use a VM for the target architecture that you want to build for and build natively in that VM. So if you would like a 32 bit build, we would recommend to use qemu-user in 32 bit and build there.