aftman icon indicating copy to clipboard operation
aftman copied to clipboard

Arm64/aarch64 binaries don't get prioritized over x86

Open filiptibell opened this issue 2 years ago • 1 comments

Just noticed that aftman chose the wrong binary when installing one of our internal tools:

CleanShot 2022-09-13 at 18 29 28@2x

In the screenshot you can see that the files downloaded are definitely x86 while the architecture I'm using is arm. If I delete the x86_64 binary from the release aftman correctly picks the aarch64 one.

I'm thinking something might be going wrong during artifact selection / ordering

filiptibell avatar Sep 13 '22 17:09 filiptibell

I think we're relying on the Ord implementation of Architecture for this. The hope is that on systems that support AArch64 AND x86-64, we should pick AArch64. The opposite might be happening?

This is obviously not a great way solution as it makes this code very hard to debug.

At some point we should pull this code out so we can write better tests for it.

LPGhatguy avatar Sep 13 '22 23:09 LPGhatguy

I think we're relying on the Ord implementation of Architecture for this. The hope is that on systems that support AArch64 AND x86-64, we should pick AArch64. The opposite might be happening?

Did some diagnosing of this issue and when running locally it actually picked up the correct artifacts, the issue seems to be a missing --target flag during the release build. Basically, std::env::consts::ARCH was set to x86_64 even for aarch64 builds since that's what github's hosted runner is using, and rosetta magic made aftman still work for macOS. I'll make a quick PR to fix it.

filiptibell avatar Oct 01 '22 09:10 filiptibell