Skip to content

packager: fetch glibc corresponding to the host architecture on debian multiarch #126

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

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

nlewycky
Copy link
Contributor

@nlewycky nlewycky commented Oct 1, 2021

Description of changes:
This is a Debian version of PR #120. Many Debian machines have both amd64 and i386 (64 and 32 bit x86-64) installed. When "dpkg-query --listfiles libc6" is run, dpkg doesn't know which package it's referring to:

dpkg-query: error: --listfiles needs a valid package name but 'libc6' is not: ambiguous package name 'libc6' with more than one installed instance

Use --help for help about querying packages.

The main page for more information on MultiArch is https://wiki.debian.org/Multiarch .

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -66,14 +65,16 @@ function package_libc_via_pacman {

function package_libc_via_dpkg() {
if type dpkg-query > /dev/null 2>&1; then
if [[ $(dpkg-query --listfiles libc6 | wc -l) -gt 0 ]]; then
dpkg-query --listfiles libc6 | sed -E '/\.so$|\.so\.[0-9]+$/!d'
architecture=$(dpkg --print-architecture)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added Arch Linux support in the packager the other day, and I switched to using uname -m for checking the system architecture for rpm-based distros.

Copy link
Contributor Author

@nlewycky nlewycky Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work on Debian though:

$ uname -m
x86_64
$ dpkg --print-architecture
amd64

Using x86_64 as the architecture does not work with dpkg.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting.

And I just took a look with a fedora image from docker hub, and it turns out arch comes with coreutils on some distros:

$ arch --help
Usage: arch [OPTION]...
Print machine architecture.

      --help     display this help and exit
      --version  output version information and exit

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>
Full documentation <https://www.gnu.org/software/coreutils/arch>
or available locally via: info '(coreutils) arch invocation'

And the docs say:

arch prints the machine hardware name, and is equivalent to uname -m

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to give you a heads up, I just opened PR #136, which has some simplifications in the same area as this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cherry-picked your changes from here into #136: d63870c

Copy link
Collaborator

@bmoffatt bmoffatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bmoffatt bmoffatt merged commit b3cc261 into awslabs:master Nov 30, 2021
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

Successfully merging this pull request may close these issues.

3 participants