Add RPM support to bashbrew-host-arch.sh (via querying RPM's own architecture)#96
Merged
yosifkit merged 1 commit intodocker-library:masterfrom May 29, 2024
Merged
Conversation
…chitecture) This should be more reliable/correct than `uname -m` (because we're almost always looking for the *userspace* architecture, not the kernel architecture).
Member
Author
|
A few example runs: $ docker run --rm --mount "type=bind,src=$PWD,dst=/foo,ro" -w /foo --platform linux/arm64/v8 oraclelinux:8-slim bash -x ./bashbrew-host-arch.sh
+ set -Eeuo pipefail
+ arch=
+ command -v apk
+ command -v dpkg
+ command -v rpm
++ rpm --query '--queryformat=%{ARCH}' rpm
+ tryArch=aarch64
+ arch=aarch64
+ case "$arch" in
+ found arm64v8
+ echo arm64v8
arm64v8
+ exit
$ docker run --rm --mount "type=bind,src=$PWD,dst=/foo,ro" -w /foo --platform linux/arm64/v8 redhat/ubi9-minimal bash -x ./bashbrew-host-arch.sh
+ set -Eeuo pipefail
+ arch=
+ command -v apk
+ command -v dpkg
+ command -v rpm
++ rpm --query '--queryformat=%{ARCH}' rpm
+ tryArch=aarch64
+ arch=aarch64
+ case "$arch" in
+ found arm64v8
+ echo arm64v8
arm64v8
+ exit
$ docker run --rm --mount "type=bind,src=$PWD,dst=/foo,ro" -w /foo --platform linux/ppc64le redhat/ubi9-minimal bash -x ./bashbrew-host-arch.sh
+ set -Eeuo pipefail
+ arch=
+ command -v apk
+ command -v dpkg
+ command -v rpm
++ rpm --query '--queryformat=%{ARCH}' rpm
+ tryArch=ppc64le
+ arch=ppc64le
+ case "$arch" in
+ found ppc64le
+ echo ppc64le
ppc64le
+ exit |
tianon
commented
May 29, 2024
| arm64 | aarch64) found 'arm64v8' ;; | ||
| armel) found 'arm32v5' ;; | ||
| armv7) found 'arm32v7' ;; | ||
| armv6*) found 'arm32v6' ;; |
Member
Author
There was a problem hiding this comment.
Technically, I could add arm32v5 here too, but I don't think we want to encourage arm32v5 users -- their time is just shy of completely up. 😅
Member
Author
|
(CI failure is the classic Codecov failure we haven't dealt with by excising Codecov in favor of something else yet 🙃) |
yosifkit
approved these changes
May 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should be more reliable/correct than
uname -m(because we're almost always looking for the userspace architecture, not the kernel architecture).(With special thanks to @grooverdan, who I imagine is getting tired of seeing GitHub notifications from my excitement about finally having a clean solution to this that feels so obvious in hindsight 😂 ❤️)