Hello there,
I’m running arm64 NixOS (22.11beta167.8690906c4d8) inside a Parallels Desktop VM on a MacBook Pro M1.
My goal is to get a local nix builder that can build x86_64-linux derivations. So far I’ve only tried using box64 to do this (see below) but it doesn’t work. I’d prefer using something like box64, since it has decent performance when emulating x86_64 on an arm64 CPU, as opposed to e.g. qemu which can be quite slow (in my experience at least).
How can I get this working?
[rune@nixos:/media/psf/nixos]$ box64 $(nix-build --argstr system "x86_64-linux" -A nix '<nixpkgs>')/bin/nix-build nix/test/manual-build.nix
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan 1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 82 Env var
Looking for /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/bin/nix-build
argv[1]="nix/test/manual-build.nix"
Using emulated /nix/store/b7ac47isdc4z1ajln6adz3ppcjs1708b-libsodium-1.0.18/lib/libsodium.so.23
Using emulated /nix/store/il7dydwf1wfn9b4p4cii8q99b93i106n-editline-1.17.1/lib/libeditline.so.1
Using emulated /nix/store/zr68vx7x4bnksz4i53608d597z77kmz1-lowdown-1.0.0-lib/lib/liblowdown.so.1
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixexpr.so
Using emulated /nix/store/ibg22x7pqqp4lc1dpfyb7xb7p8xybgmg-boehm-gc-8.2.2/lib/libgc.so.1
Using native(wrapped) libpthread.so.0
Using native(wrapped) libdl.so.2
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixmain.so
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixfetchers.so
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixstore.so
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixutil.so
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixcmd.so
Using emulated /nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib/lib/libstdc++.so.6
Using native(wrapped) libm.so.6
Using emulated /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libgcc_s.so.1
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) librt.so.1
Using emulated /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libboost_context.so.1.79.0
Using emulated /nix/store/4mxnw95jcm5a27qk60z7yc0gvxp42b9a-openssl-3.0.7/lib/libcrypto.so.3
Using emulated /nix/store/9iy1ng7h1l6jdmjk157jra8n4hkrfdj1-brotli-1.0.9-lib/lib/libbrotlienc.so.1
Using emulated /nix/store/9iy1ng7h1l6jdmjk157jra8n4hkrfdj1-brotli-1.0.9-lib/lib/libbrotlidec.so.1
Using emulated /nix/store/3n9vwzn9wkq7cj93jp0s6gqpx1zbhvlj-libarchive-3.6.1-lib/lib/libarchive.so.13
Using emulated /nix/store/20d2d0jap81kxp5ng1igl7kkgnd077f3-libcpuid-0.6.2/lib/libcpuid.so.16
Using emulated /nix/store/9iy1ng7h1l6jdmjk157jra8n4hkrfdj1-brotli-1.0.9-lib/lib/libbrotlicommon.so.1
Using emulated /nix/store/7q41sbf04qcwv75j5bxis6pfjnmshy44-acl-2.3.1/lib/libacl.so.1
Error initializing native liblzma.so.5 (last dlerror is liblzma.so.5: cannot open shared object file: No such file or directory)
Using emulated /nix/store/w3sdhqiazzp4iy40wc2g85mv0grg1cx0-xz-5.2.7/lib/liblzma.so.5
Using emulated /nix/store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2/lib/libzstd.so.1
Error initializing native libbz2.so.1 (last dlerror is libbz2.so.1: cannot open shared object file: No such file or directory)
Using emulated /nix/store/ysl6qj5r7nn63b16954dhk7x47r5yq7i-bzip2-1.0.8/lib/libbz2.so.1
Error initializing native libz.so.1 (last dlerror is libz.so.1: cannot open shared object file: No such file or directory)
Using emulated /nix/store/026hln0aq1hyshaxsdvhg0kmcm6yf45r-zlib-1.2.13/lib/libz.so.1
Error initializing native libxml2.so.2 (last dlerror is libxml2.so.2: cannot open shared object file: No such file or directory)
Using emulated /nix/store/h5slhj7gqpqh5q4jb00xdbcwbl8vqqa7-libxml2-2.10.3/lib/libxml2.so.2
Using emulated /nix/store/cr5fmwri3601s7724ayjvckhsg6cz4rv-attr-2.5.1/lib/libattr.so.1
Warning: Global Symbol ZSTD_trace_decompress_end not found, cannot apply R_X86_64_GLOB_DAT @0xffff8eedbfa8 ((nil)) in /nix/store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2/lib/libzstd.so.1
Warning: Global Symbol ZSTD_trace_compress_begin not found, cannot apply R_X86_64_GLOB_DAT @0xffff8eedbfb0 ((nil)) in /nix/store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2/lib/libzstd.so.1
Warning: Global Symbol ZSTD_trace_compress_end not found, cannot apply R_X86_64_GLOB_DAT @0xffff8eedbfb8 ((nil)) in /nix/store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2/lib/libzstd.so.1
Warning: Global Symbol ZSTD_trace_decompress_begin not found, cannot apply R_X86_64_GLOB_DAT @0xffff8eedbfd0 ((nil)) in /nix/store/w10in9diaqrcqqxi5lg20n3q2jfpk6pq-zstd-1.5.2/lib/libzstd.so.1
Using emulated /nix/store/jpj9lx0p2h1vs3gkzj8jh350113bsm84-sqlite-3.39.4/lib/libsqlite3.so.0
Error initializing native libcurl.so.4 (last dlerror is libcurl-gnutls.so.4: cannot open shared object file: No such file or directory)
Using emulated /nix/store/rirzp6ijbcwnxlf0b2n286n587r3z9jw-curl-7.86.0/lib/libcurl.so.4
Using emulated /nix/store/9l3226p4p0i03whclxyp5lzps4w76hk8-aws-sdk-cpp-1.9.294/lib/libaws-cpp-sdk-transfer.so
Using emulated /nix/store/9l3226p4p0i03whclxyp5lzps4w76hk8-aws-sdk-cpp-1.9.294/lib/libaws-cpp-sdk-s3.so
Using emulated /nix/store/9l3226p4p0i03whclxyp5lzps4w76hk8-aws-sdk-cpp-1.9.294/lib/libaws-cpp-sdk-core.so
Using emulated /nix/store/c8byvs0rj8vg5cpm5mswcg5dvp7d5ir7-libseccomp-2.5.4-lib/lib/libseccomp.so.2
Error: Symbol stat64 not found, cannot apply R_X86_64_64 @0xffff8ec3e668 ((nil)) in /nix/store/jpj9lx0p2h1vs3gkzj8jh350113bsm84-sqlite-3.39.4/lib/libsqlite3.so.0
Error: Symbol fstat64 not found, cannot apply R_X86_64_64 @0xffff8ec3e680 ((nil)) in /nix/store/jpj9lx0p2h1vs3gkzj8jh350113bsm84-sqlite-3.39.4/lib/libsqlite3.so.0
Error: Symbol lstat64 not found, cannot apply R_X86_64_64 @0xffff8ec3e890 ((nil)) in /nix/store/jpj9lx0p2h1vs3gkzj8jh350113bsm84-sqlite-3.39.4/lib/libsqlite3.so.0
Using emulated /nix/store/qz400bwshaqikj5s2qyvh0c9qffgmqik-nghttp2-1.49.0-lib/lib/libnghttp2.so.14
Using emulated /nix/store/5mh5019jigj0k14rdnjam1xwk5avn1id-libidn2-2.3.2/lib/libidn2.so.0
Using emulated /nix/store/vqq9s0d6fw6kqf3sr5nrzqbys9rhygqd-libssh2-1.10.0/lib/libssh2.so.1
Using emulated /nix/store/4mxnw95jcm5a27qk60z7yc0gvxp42b9a-openssl-3.0.7/lib/libssl.so.3
Error initializing native libgssapi_krb5.so.2 (last dlerror is libgssapi_krb5.so.2: cannot open shared object file: No such file or directory)
Using emulated /nix/store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20/lib/libgssapi_krb5.so.2
Using emulated /nix/store/34xlpp3j3vy7ksn09zh44f1c04w77khf-libunistring-1.0/lib/libunistring.so.2
Error initializing native libkrb5.so.3 (last dlerror is libkrb5.so.3: cannot open shared object file: No such file or directory)
Using emulated /nix/store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20/lib/libkrb5.so.3
Using emulated /nix/store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20/lib/libk5crypto.so.3
Using emulated /nix/store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20/lib/libcom_err.so.3
Using emulated /nix/store/r7gl900my2fw6k33nxh2r7rzv8nv0s25-libkrb5-1.20/lib/libkrb5support.so.0
Using emulated /nix/store/816qwr4xy058451rbxr0ccyh1v1akhb6-keyutils-1.6.3-lib/lib/libkeyutils.so.1
Using native(wrapped) libresolv.so.2
Using emulated /nix/store/5q73izqsdasz81gma1nz6870b6220vkh-aws-crt-cpp-0.18.9/lib/libaws-crt-cpp.so
Using emulated /nix/store/1f3pdcihv4mmgfsyw4jxqjvn7j5sc2xy-aws-c-mqtt-0.7.13/lib/libaws-c-mqtt.so.1.0.0
Using emulated /nix/store/50si0kkawnfkgs8m7d8iv2zmkq0fdbm7-aws-c-event-stream-0.2.15/lib/libaws-c-event-stream.so.1.0.0
Using emulated /nix/store/84px25a6dsmdg7ni7186rmkybq1k2vrf-aws-c-s3-0.1.51/lib/libaws-c-s3.so.0unstable
Using emulated /nix/store/bwsyv47ri47ppr4ga34wd2khk89ch4n4-aws-c-auth-0.6.21/lib/libaws-c-auth.so.1.0.0
Using emulated /nix/store/a6q74vrxbsrmmw1z0fdzd0qrcm6dc0ll-aws-c-http-0.6.27/lib/libaws-c-http.so.1.0.0
Using emulated /nix/store/f116ly4fl72zc5ynb03qrwdk2bp8y61p-aws-c-io-0.13.11/lib/libaws-c-io.so.1.0.0
Using emulated /nix/store/4rkhsf7sig2lh303bygqr3ph5mfwz0ah-s2n-tls-1.3.28/lib/libs2n.so.1
Using emulated /nix/store/wnxn8173p8gj888wwgv2l9czp7zf4jl3-aws-c-compression-0.2.16/lib/libaws-c-compression.so.1.0.0
Using emulated /nix/store/6qqybxxz6636jymz8x7l2sxj4np9yzsy-aws-c-cal-0.5.20/lib/libaws-c-cal.so.1.0.0
Using emulated /nix/store/fph0r1qjhsygrb420y2zsfhjh3rssq0z-aws-c-sdkutils-0.1.7/lib/libaws-c-sdkutils.so.1.0.0
Using emulated /nix/store/3z091ijyij0mmgi3iv0mp945lm2bx4wy-aws-checksums-0.1.13/lib/libaws-checksums.so.1.0.0
Using emulated /nix/store/3j1h6psl4pzn6b3yck6rk33bpwrmihb1-aws-c-common-0.8.5/lib/libaws-c-common.so.1
Warning: Global Symbol EVP_MD_CTX_destroy not found, cannot apply R_X86_64_GLOB_DAT @0xffff8da50f88 ((nil)) in /nix/store/6qqybxxz6636jymz8x7l2sxj4np9yzsy-aws-c-cal-0.5.20/lib/libaws-c-cal.so.1.0.0
Warning: Global Symbol HMAC_CTX_init not found, cannot apply R_X86_64_GLOB_DAT @0xffff8da50fb0 ((nil)) in /nix/store/6qqybxxz6636jymz8x7l2sxj4np9yzsy-aws-c-cal-0.5.20/lib/libaws-c-cal.so.1.0.0
Warning: Global Symbol HMAC_CTX_cleanup not found, cannot apply R_X86_64_GLOB_DAT @0xffff8da50fb8 ((nil)) in /nix/store/6qqybxxz6636jymz8x7l2sxj4np9yzsy-aws-c-cal-0.5.20/lib/libaws-c-cal.so.1.0.0
Warning: Global Symbol EVP_MD_CTX_create not found, cannot apply R_X86_64_GLOB_DAT @0xffff8da50fc0 ((nil)) in /nix/store/6qqybxxz6636jymz8x7l2sxj4np9yzsy-aws-c-cal-0.5.20/lib/libaws-c-cal.so.1.0.0
Error: PltResolver: Symbol stat(ver 12: stat@GLIBC_2.33) not found, cannot apply R_X86_64_JUMP_SLOT 0xffff90cc1810 (0xffff90c00196) in /nix/store/81yi66w1q1spb27vp7blwbgb5myhwgjw-nix-2.11.0/lib/libnixutil.so
^C