atuin: Cannot build atuin successfully on macOS(aarch64, m1)

This is the build log:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/2ilz54wnn328i8a28gvs9c2hiz50dkah-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/a2jwx70ia8xckan3mpskrx97px72366s-atuin-0.7.1-vendor.tar.gz
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
Executing cargoSetupPostPatchHook
Validating consistency between /private/tmp/nix-build-atuin-0.7.1.drv-0/source//Cargo.lock and /private/tmp/nix-build-atuin-0.7.1.drv-0/atuin-0.7.1-vendor.tar.gz/Cargo.lock
Finished cargoSetupPostPatchHook
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Executing cargoBuildHook
++ env CC_aarch64-apple-darwin=/nix/store/hi81iavwbigd3gssp3mw0l90vap8p0ji-clang-wrapper-11.1.0/bin/cc CXX_aarch64-apple-darwin=/nix/store/hi81iavwbigd3gssp3mw0l90vap8p0ji-clang-wrapper-11.1.0/bin/c++ CC_aarch64-apple-darwin=/nix/store/hi81iavwbigd3gssp3mw0l90vap8p0ji-clang-wrapper-11.1.0/bin/cc CXX_aarch64-apple-darwin=/nix/store/hi81iavwbigd3gssp3mw0l90vap8p0ji-clang-wrapper-11.1.0/bin/c++ cargo build -j 8 --target aarch64-apple-darwin --frozen --release
   Compiling libc v0.2.93
   Compiling autocfg v1.0.1
   Compiling version_check v0.9.3
   Compiling proc-macro2 v1.0.26
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.69
   Compiling memchr v2.3.4
   Compiling cfg-if v1.0.0
   Compiling log v0.4.14
   Compiling cc v1.0.67
   Compiling typenum v1.13.0
   Compiling lazy_static v1.4.0
   Compiling serde_derive v1.0.125
   Compiling getrandom v0.2.2
   Compiling ryu v1.0.5
   Compiling serde v1.0.125
   Compiling bitflags v1.2.1
   Compiling proc-macro-nested v0.1.7
   Compiling bytes v1.0.1
   Compiling proc-macro-hack v0.5.19
   Compiling itoa v0.4.7
   Compiling pin-project-lite v0.2.6
   Compiling scopeguard v1.1.0
   Compiling smallvec v1.6.1
   Compiling once_cell v1.7.2
   Compiling futures-core v0.3.14
   Compiling futures-sink v0.3.14
   Compiling radium v0.5.3
   Compiling pkg-config v0.3.19
   Compiling lexical-core v0.7.5
   Compiling matches v0.1.8
   Compiling slab v0.4.3
   Compiling base64 v0.13.0
   Compiling ppv-lite86 v0.2.10
   Compiling serde_json v1.0.64
   Compiling futures-io v0.3.14
   Compiling tinyvec_macros v0.1.0
   Compiling pin-utils v0.1.0
   Compiling fnv v1.0.7
   Compiling byteorder v1.4.3
   Compiling futures-task v0.3.14
   Compiling untrusted v0.7.1
   Compiling ahash v0.4.7
   Compiling regex-syntax v0.6.23
   Compiling opaque-debug v0.3.0
   Compiling percent-encoding v2.1.0
   Compiling httparse v1.4.0
   Compiling build_const v0.2.2
   Compiling whoami v1.1.2
   Compiling unicode-width v0.1.8
   Compiling getrandom v0.1.16
   Compiling arrayvec v0.5.2
   Compiling static_assertions v1.1.0
   Compiling mime v0.3.16
   Compiling tap v1.0.1
   Compiling quick-error v1.2.3
   Compiling try-lock v0.2.3
   Compiling wyz v0.2.0
   Compiling funty v1.1.0
   Compiling httpdate v0.3.2
   Compiling subtle v2.4.0
   Compiling unicode-segmentation v1.7.1
   Compiling tower-service v0.3.1
   Compiling safemem v0.3.3
   Compiling remove_dir_all v0.5.3
   Compiling maplit v1.0.2
   Compiling gcc v0.3.55
   Compiling unicode_categories v0.1.1
   Compiling utf-8 v0.7.6
   Compiling hex v0.4.3
   Compiling eyre v0.6.5
   Compiling either v1.6.1
   Compiling rustc-serialize v0.3.24
   Compiling scoped-tls v1.0.0
   Compiling async-trait v0.1.50
   Compiling encoding_rs v0.8.28
   Compiling indenter v0.3.3
   Compiling linked-hash-map v0.5.4
   Compiling dotenv v0.15.0
   Compiling serde v0.8.23
   Compiling termcolor v1.1.2
   Compiling scanlex v0.1.4
   Compiling number_prefix v0.4.0
   Compiling rust-ini v0.13.0
   Compiling urlencoding v1.1.1
   Compiling ipnet v2.3.0
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.2
   Compiling numtoa v0.1.0
   Compiling strsim v0.8.0
   Compiling humantime v2.1.0
   Compiling cassowary v0.3.0
   Compiling instant v0.1.9
   Compiling generic-array v0.14.4
   Compiling nom v6.1.2
   Compiling unicase v2.6.0
   Compiling ahash v0.7.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling nom v5.1.2
   Compiling proc-macro-error v1.0.4
   Compiling num-traits v0.2.14
   Compiling tokio v1.5.0
   Compiling num-integer v0.1.44
   Compiling crossbeam-utils v0.8.3
   Compiling indexmap v1.6.2
   Compiling num-bigint v0.2.6
   Compiling num-iter v0.1.42
   Compiling num-complex v0.2.4
   Compiling num-rational v0.2.4
   Compiling tracing-core v0.1.17
   Compiling input_buffer v0.4.0
   Compiling ring v0.16.20
   Compiling lock_api v0.4.3
   Compiling futures-channel v0.3.14
   Compiling unicode-bidi v0.3.5
   Compiling tinyvec v1.2.0
   Compiling http v0.2.4
   Compiling libsqlite3-sys v0.22.1
   Compiling libsodium-sys v0.2.6
   Compiling hashbrown v0.9.1
   Compiling form_urlencoded v1.0.1
   Compiling regex-automata v0.1.9
   Compiling crc v1.8.1
   Compiling textwrap v0.11.0
   Compiling tabwriter v1.2.1
   Compiling humantime v1.3.0
   Compiling heck v0.3.2
   Compiling itertools v0.10.0
   Compiling rust-crypto v0.2.36
   Compiling yaml-rust v0.4.5
   Compiling unicode-normalization v0.1.17
   Compiling hashlink v0.6.0
   Compiling http-body v0.4.1
   Compiling headers-core v0.2.0
error: failed to run custom build command for `libsodium-sys v0.2.6`

Caused by:
  process didn't exit successfully: `/private/tmp/nix-build-atuin-0.7.1.drv-0/source/target/release/build/libsodium-sys-b7383f7622bb42cd/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=SODIUM_LIB_DIR
  cargo:rerun-if-env-changed=SODIUM_SHARED
  cargo:rerun-if-env-changed=SODIUM_USE_PKG_CONFIG
  cargo:rerun-if-env-changed=SODIUM_DISABLE_PIE
  OPT_LEVEL = Some("3")
  TARGET = Some("aarch64-apple-darwin")
  HOST = Some("aarch64-apple-darwin")
  CC_aarch64-apple-darwin = Some("/nix/store/hi81iavwbigd3gssp3mw0l90vap8p0ji-clang-wrapper-11.1.0/bin/cc")
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = None
  checking build system type...
  --- stderr
  Invalid configuration `arm64-apple-darwin21.1.0': machine `arm64-apple' not recognized
  configure: error: /nix/store/ppzr8yab3s3883skd0da5i4ylzpksk9l-bash-5.1-p8/bin/bash build-aux/config.sub arm64-apple-darwin21.1.0 failed
  thread 'main' panicked at '
  Failed to configure libsodium using "/private/tmp/nix-build-atuin-0.7.1.drv-0/source/target/aarch64-apple-darwin/release/build/libsodium-sys-dbf4f2a09dddc759/out/source/libsodium/configure" "--prefix=/private/tmp/nix-build-atuin-0.7.1.drv-0/source/target/aarch64-apple-darwin/release/build/libsodium-sys-dbf4f2a09dddc759/out/installed" "--libdir=/private/tmp/nix-build-atuin-0.7.1.drv-0/source/target/aarch64-apple-darwin/release/build/libsodium-sys-dbf4f2a09dddc759/out/installed/lib" "--host=aarch64-apple-darwin" "--enable-shared=no"
  CFLAGS=-O3 -ffunction-sections -fdata-sections -fPIC -arch arm64 -Wall -Wextra
  CC=/nix/store/hi81iavwbigd3gssp3mw0l90vap8p0ji-clang-wrapper-11.1.0/bin/cc

  ', /private/tmp/nix-build-atuin-0.7.1.drv-0/atuin-0.7.1-vendor.tar.gz/libsodium-sys/build.rs:240:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

The reason for the failure of the build seems to be libsodium-sys v0.2.6 .

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

fwiw, I don’t seem to have any problem installing atuin on an M1 machine with macOS Monterey.

❯ uname -r
21.1.0
❯ cargo install atuin
    Updating crates.io index
  Downloaded atuin v0.7.2
  Downloaded 1 crate (411.6 KB) in 0.52s
  Installing atuin v0.7.2
...
   Compiling atuin v0.7.2
    Finished release [optimized] target(s) in 3m 28s
  Installing /Users/thomas/.cargo/bin/atuin
   Installed package `atuin v0.7.2` (executable `atuin`)

~ 3m 29s
❯

I can also build with Nix fine.

❯ nix-store --gc
...
❯ nix-shell --pure -p atuin
...
[nix-shell:~]$ atuin --version
atuin 0.7.1

It built fine my my M1 fwiw. I’ll see if it actually built the arm version and not fallback to rosetta

Hey! I don’t have an M1 machine at the moment so can’t replicate - although I should be getting one this week 😃

Does the build complete on M1 outside of nix? As in, with a normal cargo build?