Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Ubuntu Focal images are missing some armhf packages #1203

Closed
4 of 11 tasks
DASPRiD opened this issue Feb 4, 2023 · 10 comments
Closed
4 of 11 tasks

New Ubuntu Focal images are missing some armhf packages #1203

DASPRiD opened this issue Feb 4, 2023 · 10 comments

Comments

@DASPRiD
Copy link

DASPRiD commented Feb 4, 2023

Checklist

Describe your issue

When building my custom docker image based on the main tag (Ubuntu Focal) instead of the latest tag, my image fails to install libasound2-dev:armhf. This was working fine in Ubuntu Bionic, but for some reason the package seems to be missing, even though it is listed in Ubuntu's package repository with that architecture:

https://packages.ubuntu.com/focal/libasound2-dev

What target(s) are you cross-compiling for?

arm-unknown-linux-gnueabihf

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

0.2.4

Example

Here's the code used to install the package in a custom docker image which fails in Ubuntu Focal:

RUN dpkg --add-architecture armhf && \
    apt-get update && \
    apt-get install --assume-yes libasound2-dev:armhf

Additional information / notes

No response

@Emilgardis
Copy link
Member

can you post the exact error message you get from apt?

I'll try this myself later but just incase

@DASPRiD
Copy link
Author

DASPRiD commented Feb 5, 2023

Sure, here's the raw output from our build server:

    'Package libasound2-dev:armhf is not available, but is referred to by another package.\n' +
    'This may mean that the package is missing, has been obsoleted, or\n' +
    'is only available from another source\n' +
    'However the following packages replace it:\n' +
    '  libasound2-dev libatopology-dev:armhf libasound2-dev:i386\n' +
    '  libatopology-dev:i386 libatopology-dev\n' +
    '\n' +
    "\x1B[91mE\x1B[0m\x1B[91m: Package 'libasound2-dev:armhf' has no installation candidate\n" +

@Emilgardis
Copy link
Member

See this link to the wiki. The armhf debian/ubuntu target is for ARMv7-a, the rust target arm-unknown-linux-gnueabihf is for ARMv6, so they are not compatible.

If you want to produce a binary for armv7-a, use the rust target armv7-unknown-linux-gnueabihf instead, if you want alsa/asound for armv6, you'll need to compile from source or use another debian based repository which hosts armv6. See https://github.com/cross-rs/cross/wiki/FAQ#using-debian-repositories for how to do that

I'm not 100% sure how to solve this.

@DASPRiD
Copy link
Author

DASPRiD commented Feb 5, 2023

Sorry, I just woke up and wrote the other comment half asleep, my bad. I just read through the Wiki entry, that's quite interesting.

So if I read the Debian wiki and yours correctly, I should use your install_deb.sh script together with the armel architecture, which supports ARM v5T and 6?

@DASPRiD
Copy link
Author

DASPRiD commented Feb 5, 2023

Hm, that seems to fail though:

#0 11.92 The following packages have unmet dependencies:
#0 11.94  libasound2-dev:armel : Depends: libasound2:armel (= 1.1.8-1) but it is not going to be installed

Using:

COPY install_deb.sh /
RUN /install_deb.sh armel libasound2-dev

@Emilgardis
Copy link
Member

WHat happens if you install that too?

also if you're absolutely sure that the armhf package you're installing does not have arm specifics, you could undo what we do in https://github.com/cross-rs/cross/blob/main/docker/deny-debian-packages.sh by rm /etc/apt/preferences.d/all-packages

@DASPRiD
Copy link
Author

DASPRiD commented Feb 5, 2023

Well, I'm not 100% certain. I do know that my binary runs in general, but I can't be certain that there aren't any edge conditions.

On the other hand, this seems to go down a rabbit hole:

#0 10.57 The following packages have unmet dependencies:
#0 10.60  libasound2:armel : Depends: libc6:armel (>= 2.28) but it is not going to be installed

@DASPRiD
Copy link
Author

DASPRiD commented Feb 5, 2023

Oh, and trying to also install libc6 actually fails:

#0 10.67 The following packages have unmet dependencies:
#0 10.69  libasound2:armel : Depends: libc6:armel (>= 2.28) but it is not going to be installed
#0 10.70 E: Unable to correct problems, you have held broken packages.

@DASPRiD
Copy link
Author

DASPRiD commented Feb 16, 2023

Alright, I got it working. I changed the install_deb.sh from buster to bullseye (also had to remove the security.debian.net source, as that one does not exist in bullseye.

After that I was able to install libasound2-dev from the armel architecture without issues and build my package. Thanks!

Would be nice to have that documented :)

@DASPRiD DASPRiD closed this as completed Feb 16, 2023
@DASPRiD
Copy link
Author

DASPRiD commented Feb 16, 2023

Actually nevermind, linking completely fails with that. But looking at librespot, their cross compilation actually also uses the armhf package of libasound2-dev. So I assume that is battle tested and I go with your previous recommendation of just undoing the unpinning.

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

No branches or pull requests

2 participants