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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packaging/packager
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ function package_libc_pacman() {

function package_libc_dpkg() {
if type dpkg-query > /dev/null 2>&1; then
if [[ $(dpkg-query --listfiles libc6 | wc -l) -gt 0 ]]; then
dpkg-query --listfiles libc6 | pluck_so_files
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

if [[ $(dpkg-query --listfiles libc6:$architecture | wc -l) -gt 0 ]]; then
dpkg-query --listfiles libc6:$architecture | pluck_so_files
fi
fi
}
Expand Down