NixOS / ofborg

@ofborg tooling automation https://monitoring.ofborg.org/dashboard/db/ofborg
https://ofborg.org
MIT License
233 stars 166 forks source link

Support building x86_64 packages on aarch64-darwin #592

Closed cole-h closed 2 years ago

cole-h commented 2 years ago

Closes https://github.com/NixOS/ofborg/issues/591.


Needed to bump and add the unstable feature to async-std for access to the join method. Maybe there's a better way to do this, but I'm not well-versed (or really, versed at all) in Rust async.


Going to be testing on one of the M1 machines we have access to ~soon.

EDIT: Didn't work -- likely need to change the supportedSystems stuff in nix.rs. Probably also want to run the ofborg binaries manually, to see the logging output first-hand...

cole-h commented 2 years ago

I don't know if this will work in the end :( Needs more investigation, but one example failure is the following: https://logs.nix.ci/?key=nixos/nixpkgs.161527&attempt_id=8ca7bc24-b413-4b61-a406-ebae2834f506. It was processed on the M1 I was testing with, but it appears there was some issue with an emulated instruction.

Requires more investigation as I have time... But it appears Rosetta 2 isn't perfect. Also, the couple M1s we have appear to be running an older version of macOS (11.0.1 at time of writing). https://github.com/golang/go/issues/42700 appears to be the problem from that log, and it's claimed that this issue was fixed in a later version of macOS (11.2).

Relevant log details for posterity ``` building '/nix/store/rj5ywpiqg7hn8mmgflg8n6kyahrr598s-source.drv'... trying https://github.com/redhat-developer/odo/archive/v2.5.0.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 138 100 138 0 0 386 0 --:--:-- --:--:-- --:--:-- 386 100 27.8M 0 27.8M 0 0 6532k 0 --:--:-- 0:00:04 --:--:-- 7386k unpacking source archive /private/tmp/nix-build-source.drv-0/v2.5.0.tar.gz building '/nix/store/z3ymirw538bkdp2a2v8vjnn19grmq2zg-odo-2.5.0.drv'... unpacking sources unpacking source archive /nix/store/vk7njlsnaqmqjm7m5lvgi6dck6dd3diy-source source root is source patching sources configuring building go build -mod=vendor -ldflags="-X github.com/redhat-developer/odo/pkg/version.GITCOMMIT=" cmd/odo/odo.go assertion failed [abi_info.kind == AbiKind::TranslatedCode]: emulated forward to an arm pc that isn't in translated code. arm_pc=0x101cb44d8 abi_kind=6 emulation_interval=[0x101d2af28,0x101d2af3c) instruction_interval=[0x101d2af14, 0x101d2af3c) x86_rip=0x10d28e2 (ThreadContextRegisterState.cpp:677 move_to_instruction_boundary) error: building of '/nix/store/z3ymirw538bkdp2a2v8vjnn19grmq2zg-odo-2.5.0.drv!out' from .drv file timed out after 3600 seconds error: 1 dependencies of derivation '/nix/store/6ixl053g0bav4kdjjigi13p88n0gh4j1-odo-2.5.0-test-version.drv' failed to build error: build of '/nix/store/6ixl053g0bav4kdjjigi13p88n0gh4j1-odo-2.5.0-test-version.drv', '/nix/store/z3ymirw538bkdp2a2v8vjnn19grmq2zg-odo-2.5.0.drv' failed ```
cole-h commented 2 years ago

Note that this has only been deployed to 1 of our M1s -- the other still needs to be updated (both macOS and the config file).

cole-h commented 2 years ago

Both M1s are now running this change :tada: