foundry-rs / foundry-toolchain

GitHub action to install Foundry
Apache License 2.0
225 stars 92 forks source link

ARM releases for action #42

Closed 0xAlcibiades closed 11 months ago

0xAlcibiades commented 11 months ago

This action assumes

function mapArch(arch) {
  const mappings = {
    x32: "386",
    x64: "amd64",
  };

  return mappings[arch] || arch;
}

However, many developers and much prod infra is now moving to ARM - and the foundry toolchain also exists for ARM. The toolchain check should additionally check for ARM - as it is broken there.

0xAlcibiades commented 11 months ago

https://github.com/0xAlcibiades/foundry-toolchain/commit/623f10ae808bf952efad0eca8992f5c8a1b8347d

Here is a very sloppy hotfix - but this could be done better.

onbjerg commented 11 months ago

Are you actually using an ARM runner? os.arch() in Node.js should not return x64 if you are on ARM, it should return arm or arm64. See here: https://nodejs.org/api/os.html#osarch

The current toolchain should work on ARM for that reason, since it will not see x64 or x32 in the mapping, and instead fall back to arm64, which is correct.