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

Find a better way to detect the build environment architecture #55

Open
TheAssassin opened this issue Aug 5, 2024 · 4 comments
Open

Comments

@TheAssassin
Copy link
Member

TheAssassin commented Aug 5, 2024

The architecture check introduced in #49 breaks the detection on OSes other than Alpine because of them using busybox. On Ubuntu 22.04, file returns the following:

> file -L /bin/bash 
/bin/bash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=7a6408ba82a2d86dd98f1f75ac8edcb695f6fd60, for GNU/Linux 3.2.0, stripped

The output does not match x86_64, the string probed by the bash script. Edit: to clarify: the issue here is that it probes against the loader path, not the architecture reported by file.

Please note that this is not an imminent problem since I need to use the Alpine containerized build environment anyway due to the very simplistic build scripts. However, the chosen solution is not portable in any way.

By the way, x86-64 would be working on both systems. However, I'd rather use a dedicated tool like uname. Unfortunately, busybox's implementation doesn't support -p properly in containers, it returns unknown there.

@probonopd
Copy link
Member

So this can be closed now?

@TheAssassin
Copy link
Member Author

I'd still prefer to use an alternative solution. Let's please keep this open. It's really low priority, but maybe I'll come across a nicer solution than using file on the shell.

@probonopd
Copy link
Member

probonopd commented Aug 5, 2024

Use the value from the env matrix in the GitHub Actions yml file?

@TheAssassin
Copy link
Member Author

That's one option. But as said, this has got no priority at the moment.

@TheAssassin TheAssassin changed the title Architecture check hard-depends on Alpine build environment Find a better way to detect the build environment architecture Aug 5, 2024
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