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

Bug: aarch64-unknown-linux-gnu does not match aarch64 architecture #337

Open
thebino opened this issue Aug 23, 2023 · 8 comments
Open

Bug: aarch64-unknown-linux-gnu does not match aarch64 architecture #337

thebino opened this issue Aug 23, 2023 · 8 comments

Comments

@thebino
Copy link

thebino commented Aug 23, 2023

Description
The binary release for aarch64-linux does not match the aarch64 architecture but the x86_64 architecture.

Steps to reproduce

  • Download the binary from the Release page
  • check the file type or the checksum and compare
~ > file comtrya-aarch64-unknown-linux-gnu
comtrya-aarch64-unknown-linux-gnu: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1841eef2df0ee3817004296c79f6ab917b72ca1b, for GNU/Linux 3.2.0, with debug_info,
not stripped
~ > file comtrya-x86_64-unknown-linux-gnu
comtrya-x86_64-unknown-linux-gnu: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1841eef2df0ee3817004296c79f6ab917b72ca1b, for GNU/Linux 3.2.0, with debug_info, n
ot stripped
~ > shasum comtrya-aarch64-unknown-linux-gnu
a16377afda3c6e13e5da59310f60e461e09734eb  comtrya-aarch64-unknown-linux-gnu
~ > shasum comtrya-x86_64-unknown-linux-gnu
a16377afda3c6e13e5da59310f60e461e09734eb  comtrya-x86_64-unknown-linux-gnu

Expected behaviour
What the expected behaviour in your opinion.

Environment

  • OS
  • Version: 0.8.5

Additional information
Add more context which didn't fit in the fields above.

@martintc
Copy link
Contributor

martintc commented Nov 2, 2023

Could you verify that v0.8.7 works just fine?

@thebino
Copy link
Author

thebino commented Nov 4, 2023

With v0.8.7 the issue still exists with all release artifacts:

➜ file *
apple-comtrya-aarch64-apple-darwin:         Mach-O 64-bit executable x86_64
apple-comtrya-x86_64-apple-darwin:          Mach-O 64-bit executable x86_64
linux-comtrya-aarch64-unknown-linux-gnu:    ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=af3f11dbb6f6a1b0a5dc96532227976a1ed967c9, for GNU/Linux 3.2.0, with debug_info, not stripped
linux-comtrya-x86_64-unknown-linux-gnu:     ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=af3f11dbb6f6a1b0a5dc96532227976a1ed967c9, for GNU/Linux 3.2.0, with debug_info, not stripped
linux-comtrya-x86_64-unknown-linux-musl:    ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=0107ad7cfff7df76d5141ea08270c8fa19957b71, with debug_info, not stripped
windows-comtrya-x86_64-pc-windows-msvc.exe: PE32+ executable (console) x86-64, for MS Windows
➜ shasum *
c6d4122a61df8d1d0a04ed2afb781965aa195177  apple-comtrya-aarch64-apple-darwin
c6d4122a61df8d1d0a04ed2afb781965aa195177  apple-comtrya-x86_64-apple-darwin
7e0485eb7210b32fd9deb97412fa78209a3a0732  linux-comtrya-aarch64-unknown-linux-gnu
7e0485eb7210b32fd9deb97412fa78209a3a0732  linux-comtrya-x86_64-unknown-linux-gnu
023c89cd1a596bcd01aef77e83ec9d1c9f4a18a7  linux-comtrya-x86_64-unknown-linux-musl
d81ce2dedc6aa237dd58e87de4221eb3128c6e4b  windows-comtrya-x86_64-pc-windows-msvc.exe

@martintc
Copy link
Contributor

martintc commented Nov 5, 2023

Alright, yes that is definitely still happening. I have a branch I am playing around with the pr github action to see if I can fix it. Looks like we don't force anywhere to instruct cargo to build for the aarch64 architecture when we are trying to do that, so it kicks out an x86_64 image, so it isnt actually cross compiling.

I have a branch that appears to cross compile it correctly, but having some issues with test failing.

@thebino
Copy link
Author

thebino commented Nov 5, 2023

In the action we only set the tool chain and the target.
But the underlying architecture where the build is running is still different, so we probably need to use cross-rs or something similar

@thebino
Copy link
Author

thebino commented Nov 5, 2023

@martintc have you checked your artifacts in that PR already?

@martintc
Copy link
Contributor

martintc commented Dec 17, 2023

I think I got it, I'll kick off the action again and have you verify, but it looks like we got it on our side. Sorry it took so long. Life got busy and I also needed to learn a lot more about github actions, but it looks like we got a solution. But the "unreleased" artifacts should all be correct now.

@martintc martintc mentioned this issue Dec 17, 2023
3 tasks
@thebino
Copy link
Author

thebino commented Dec 17, 2023

@martintc Looks good to me, but why aren't you using cross for all the builds? Looks like other applications always use cross.

@rawkode
Copy link
Member

rawkode commented Dec 17, 2023

We removed Cross in 2021 because it was abandoned. Specifically, we needed this fix:

cross-rs/cross#543

Cross is currently maintained and active again, so maybe it could be used.

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

3 participants