atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.4k stars 554 forks source link

Cannot build atuin successfully on macOS(aarch64, m1) #220

Closed ixnij closed 2 years ago

ixnij commented 2 years ago

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 .

ellie commented 2 years ago

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?

ixnij commented 2 years ago

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?

No. And it with a normal cargo build.

🎉 Congratulations, you are about to own a new computer ; -)

conradludgate commented 2 years ago

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

conradludgate commented 2 years ago
Screenshot 2021-12-08 at 12 07 44

So I installed it originally through brew, and it seems to be running on M1 and not through Rosetta.

I also just ran cargo install atuin to see if I got the same libsodium-sys failure. While I saw it hang there for a good minute, it did eventually build.

It's worth noting that sodiumoxide is now deprecated so it's probably worth trying to find and alternative for our E2E encryption sodiumoxide is only in a feature freeze, it will continue to receive any security patches

conradludgate commented 2 years ago

Looking at the error a bit more, is it common to see arm64-apple as a machine type, and not aarch64-apple-darwin?

ixnij commented 2 years ago
Screenshot 2021-12-08 at 12 07 44

So I installed it originally through brew, and it seems to be running on M1 and not through Rosetta.

I also just ran cargo install atuin to see if I got the same libsodium-sys failure. While I saw it hang there for a good minute, it did eventually build.

~It's worth noting that sodiumoxide is now deprecated so it's probably worth trying to find and alternative for our E2E encryption~ sodiumoxide is only in a feature freeze, it will continue to receive any security patches

Um, I ran cargo build -j8 again outside of nix, and got the same failure.

wu@ThomasdeMacBook-Pro ~/Projects/Repositories/atuin (git)-[main] % cargo build -j8
    Updating crates.io index
  Downloaded byteorder v1.4.3
  Downloaded ansi_term v0.11.0
  Downloaded getrandom v0.1.16
  Downloaded crossbeam-queue v0.3.1
  Downloaded ryu v1.0.5
  Downloaded gcc v0.3.55
  Downloaded cfg-if v1.0.0
  Downloaded sha2 v0.9.3
  Downloaded signal-hook-registry v1.3.0
  Downloaded futures-channel v0.3.14
  Downloaded headers-core v0.2.0
  Downloaded slab v0.4.3
  Downloaded hex v0.4.3
  Downloaded socket2 v0.4.0
  Downloaded stringprep v0.1.2
  Downloaded whoami v1.1.2
  Downloaded tracing-core v0.1.17
  Downloaded opaque-debug v0.3.0
  Downloaded proc-macro-error v1.0.4
  Downloaded chrono v0.4.19
  Downloaded input_buffer v0.4.0
  Downloaded quote v1.0.9
  Downloaded rand_core v0.6.2
  Downloaded quick-error v1.2.3
  Downloaded rand v0.3.23
  Downloaded proc-macro2 v1.0.26
  Downloaded rmp-serde v0.15.5
  Downloaded tabwriter v1.2.1
  Downloaded mime v0.3.16
  Downloaded number_prefix v0.4.0
  Downloaded itertools v0.10.1
  Downloaded want v0.3.0
  Downloaded block-buffer v0.9.0
  Downloaded bitvec v0.19.5
  Downloaded wyz v0.2.0
  Downloaded webpki-roots v0.21.1
  Downloaded buf_redux v0.8.4
  Downloaded crossbeam-channel v0.5.1
  Downloaded hashlink v0.7.0
  Downloaded tinyvec_macros v0.1.0
  Downloaded static_assertions v1.1.0
  Downloaded tap v1.0.1
  Downloaded tempfile v3.2.0
  Downloaded pretty_env_logger v0.4.0
  Downloaded crossbeam-utils v0.8.3
  Downloaded colored v1.9.3
  Downloaded rand v0.4.6
  Downloaded vec_map v0.8.2
  Downloaded urlencoding v1.3.3
  Downloaded atty v0.2.14
  Downloaded bitflags v1.2.1
  Downloaded rmp v0.8.10
  Downloaded shellexpand v2.1.0
  Downloaded warp v0.3.1
  Downloaded futures-task v0.3.14
  Downloaded futures-sink v0.3.14
  Downloaded parking_lot v0.11.1
  Downloaded num-integer v0.1.44
  Downloaded indicatif v0.16.2
  Downloaded http-body v0.4.1
  Downloaded rand_chacha v0.3.0
  Downloaded once_cell v1.7.2
  Downloaded cc v1.0.67
  Downloaded dirs-sys v0.3.6
  Downloaded digest v0.9.0
  Downloaded webpki v0.21.4
  Downloaded rand_core v0.5.1
  Downloaded pin-project-lite v0.2.6
  Downloaded proc-macro-nested v0.1.7
  Downloaded regex-automata v0.1.9
  Downloaded clap v2.33.3
  Downloaded serde_derive v1.0.126
  Downloaded safemem v0.3.3
  Downloaded dirs v3.0.1
  Downloaded httpdate v0.3.2
  Downloaded eyre v0.6.5
  Downloaded regex v1.4.5
  Downloaded serde_json v1.0.64
  Downloaded funty v1.1.0
  Downloaded utf-8 v0.7.6
  Downloaded uuid v0.8.2
  Downloaded smallvec v1.6.1
  Downloaded sha-1 v0.9.4
  Downloaded instant v0.1.9
  Downloaded headers v0.3.4
  Downloaded version_check v0.9.3
  Downloaded lock_api v0.4.3
  Downloaded indexmap v1.6.2
  Downloaded yaml-rust v0.4.5
  Downloaded form_urlencoded v1.0.1
  Downloaded either v1.6.1
  Downloaded futures v0.3.14
  Downloaded crypto-mac v0.10.0
  Downloaded async-trait v0.1.50
  Downloaded atoi v0.4.0
  Downloaded pin-project-internal v1.0.7
  Downloaded sqlformat v0.1.6
  Downloaded crc v1.8.1
  Downloaded env_logger v0.7.1
  Downloaded cassowary v0.3.0
  Downloaded serde_urlencoded v0.7.0
  Downloaded http v0.2.4
  Downloaded humantime v1.3.0
  Downloaded generic-array v0.14.4
  Downloaded itoa v0.4.7
  Downloaded hashbrown v0.11.2
  Downloaded rustls v0.19.1
  Downloaded heck v0.3.2
  Downloaded indenter v0.3.3
  Downloaded ipnet v2.3.0
  Downloaded hyper-rustls v0.22.1
  Downloaded num-iter v0.1.42
  Downloaded hmac v0.10.1
  Downloaded num v0.2.1
  Downloaded num-bigint v0.2.6
  Downloaded ppv-lite86 v0.2.10
  Downloaded try-lock v0.2.3
  Downloaded rand_chacha v0.2.2
  Downloaded rand v0.7.3
  Downloaded remove_dir_all v0.5.3
  Downloaded radium v0.5.3
  Downloaded httparse v1.4.0
  Downloaded humantime v2.1.0
  Downloaded tui v0.15.0
  Downloaded futures-macro v0.3.14
  Downloaded futures-core v0.3.14
  Downloaded unicode_categories v0.1.1
  Downloaded futures-executor v0.3.14
  Downloaded nom v5.1.2
  Downloaded unicode-bidi v0.3.5
  Downloaded tokio-stream v0.1.5
  Downloaded untrusted v0.7.1
  Downloaded chrono-english v0.1.6
  Downloaded arrayvec v0.5.2
  Downloaded proc-macro-hack v0.5.19
  Downloaded pin-utils v0.1.0
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded percent-encoding v2.1.0
  Downloaded parking_lot_core v0.8.3
  Downloaded num_cpus v1.13.0
  Downloaded log v0.4.14
  Downloaded futures-util v0.3.14
  Downloaded num-traits v0.2.14
  Downloaded typenum v1.13.0
  Downloaded fork v0.1.18
  Downloaded pin-project v1.0.7
  Downloaded url v2.2.1
  Downloaded fnv v1.0.7
  Downloaded dirs-sys-next v0.1.2
  Downloaded unicode-normalization v0.1.17
  Downloaded unicode-width v0.1.8
  Downloaded memchr v2.3.4
  Downloaded scopeguard v1.1.0
  Downloaded csv-core v0.1.10
  Downloaded rand v0.8.4
  Downloaded md-5 v0.9.1
  Downloaded thiserror v1.0.24
  Downloaded textwrap v0.11.0
  Downloaded sct v0.6.1
  Downloaded hashbrown v0.9.1
  Downloaded idna v0.2.3
  Downloaded time v0.1.43
  Downloaded thiserror-impl v1.0.24
  Downloaded terminal_size v0.1.16
  Downloaded unicode-xid v0.2.1
  Downloaded tokio-rustls v0.22.0
  Downloaded tokio-util v0.6.6
  Downloaded maplit v1.0.2
  Downloaded parse_duration v2.1.1
  Downloaded linked-hash-map v0.5.4
  Downloaded build_const v0.2.2
  Downloaded twoway v0.1.8
  Downloaded unicase v2.6.0
  Downloaded mio v0.7.11
  Downloaded unicode-segmentation v1.7.1
  Downloaded termion v1.5.6
  Downloaded syn v1.0.69
  Downloaded rust-ini v0.13.0
  Downloaded sqlx-rt v0.5.5
  Downloaded hyper v0.14.5
  Downloaded nom v6.1.2
  Downloaded tokio-tungstenite v0.13.0
  Downloaded serde v0.8.23
  Downloaded sqlx-macros v0.5.5
  Downloaded rustc-serialize v0.3.24
  Downloaded matches v0.1.8
  Downloaded num-traits v0.1.43
  Downloaded h2 v0.3.2
  Downloaded sqlx v0.5.5
  Downloaded serde v1.0.126
  Downloaded pkg-config v0.3.19
  Downloaded dotenv v0.15.0
  Downloaded tinyvec v1.2.0
  Downloaded sqlx-core v0.5.5
  Downloaded numtoa v0.1.0
  Downloaded num-rational v0.2.4
  Downloaded dirs-next v2.0.0
  Downloaded console v0.14.1
  Downloaded csv v1.1.6
  Downloaded base64 v0.13.0
warning: spurious network error (2 tries remaining): [28] Timeout was reached (download of `aho-corasick v0.7.15` failed to transfer more than 10 bytes in 30s)
warning: spurious network error (2 tries remaining): [28] Timeout was reached (failed to download any data for `ahash v0.7.2` within 30s)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 227 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 229 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 225 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 221 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 47 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 177 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 219 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 41 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 35 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 217 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 215 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 231 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 213 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 235 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 223 was not closed cleanly before end of the underlying stream)
warning: spurious network error (1 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 247 was not closed cleanly before end of the underlying stream)
warning: spurious network error (1 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 245 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 241 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 223 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 239 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 215 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 207 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 221 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 229 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 243 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 197 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 237 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 227 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 213 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 51 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 49 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 47 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 45 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 217 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 219 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 111 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 105 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 235 was not closed cleanly before end of the underlying stream)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (LibreSSL SSL_read: Connection reset by peer, errno 54)
warning: spurious network error (2 tries remaining): [92] Stream error in the HTTP/2 framing layer (HTTP/2 stream 231 was not closed cleanly before end of the underlying stream)
  Downloaded tower-service v0.3.1
  Downloaded subtle v2.4.0
  Downloaded scanlex v0.1.4
  Downloaded aho-corasick v0.7.15
  Downloaded tokio-macros v1.6.0
  Downloaded multipart v0.17.1
  Downloaded lazy_static v1.4.0
  Downloaded regex-syntax v0.6.23
  Downloaded cli-table-derive v0.4.4
  Downloaded tracing v0.1.25
  Downloaded encoding_rs v0.8.28
  Downloaded fern v0.6.0
  Downloaded bstr v0.2.15
  Downloaded lexical-core v0.7.5
  Downloaded scoped-tls v1.0.0
  Downloaded getrandom v0.2.2
  Downloaded directories v3.0.2
  Downloaded cli-table v0.4.6
  Downloaded bytes v1.0.1
  Downloaded ahash v0.7.2
  Downloaded toml v0.5.8
  Downloaded config v0.11.0
  Downloaded futures-io v0.3.14
  Downloaded autocfg v1.0.1
  Downloaded reqwest v0.11.6
  Downloaded mime_guess v2.0.3
  Downloaded minspan v0.1.1
  Downloaded structopt-derive v0.4.14
  Downloaded serde-hjson v0.9.1
  Downloaded num-complex v0.2.4
  Downloaded structopt v0.3.21
  Downloaded strsim v0.8.0
  Downloaded termcolor v1.1.2
  Downloaded tungstenite v0.12.0
  Downloaded libc v0.2.93
  Downloaded tokio v1.14.0
  Downloaded rust-crypto v0.2.36
  Downloaded libsqlite3-sys v0.22.1
  Downloaded sodiumoxide v0.2.6
  Downloaded ring v0.16.20
  Downloaded libsodium-sys v0.2.6
  Downloaded 241 crates (28.6 MB) in 1m 10s (largest was `ring` at 5.1 MB)
   Compiling libc v0.2.93
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.26
   Compiling version_check v0.9.3
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.69
   Compiling memchr v2.3.4
   Compiling lazy_static v1.4.0
   Compiling log v0.4.14
   Compiling cc v1.0.67
   Compiling bytes v1.0.1
   Compiling itoa v0.4.7
   Compiling serde_derive v1.0.126
   Compiling pin-project-lite v0.2.6
   Compiling once_cell v1.7.2
   Compiling serde v1.0.126
   Compiling getrandom v0.2.2
   Compiling typenum v1.13.0
   Compiling smallvec v1.6.1
   Compiling scopeguard v1.1.0
   Compiling ryu v1.0.5
   Compiling futures-core v0.3.14
   Compiling proc-macro-hack v0.5.19
   Compiling bitflags v1.2.1
   Compiling futures-sink v0.3.14
   Compiling proc-macro-nested v0.1.7
   Compiling matches v0.1.8
   Compiling byteorder v1.4.3
   Compiling ppv-lite86 v0.2.10
   Compiling futures-io v0.3.14
   Compiling tinyvec_macros v0.1.0
   Compiling pin-utils v0.1.0
   Compiling slab v0.4.3
   Compiling futures-task v0.3.14
   Compiling base64 v0.13.0
   Compiling fnv v1.0.7
   Compiling untrusted v0.7.1
   Compiling percent-encoding v2.1.0
   Compiling pkg-config v0.3.19
   Compiling regex-syntax v0.6.23
   Compiling opaque-debug v0.3.0
   Compiling httparse v1.4.0
   Compiling lexical-core v0.7.5
   Compiling serde_json v1.0.64
   Compiling arrayvec v0.5.2
   Compiling getrandom v0.1.16
   Compiling radium v0.5.3
   Compiling static_assertions v1.1.0
   Compiling hashbrown v0.9.1
   Compiling tap v1.0.1
   Compiling wyz v0.2.0
   Compiling unicode-segmentation v1.7.1
   Compiling quick-error v1.2.3
   Compiling funty v1.1.0
   Compiling try-lock v0.2.3
   Compiling mime v0.3.16
   Compiling build_const v0.2.2
   Compiling whoami v1.1.2
   Compiling httpdate v0.3.2
   Compiling subtle v2.4.0
   Compiling unicode-width v0.1.8
   Compiling tower-service v0.3.1
   Compiling remove_dir_all v0.5.3
   Compiling either v1.6.1
   Compiling gcc v0.3.55
   Compiling unicode_categories v0.1.1
   Compiling maplit v1.0.2
   Compiling utf-8 v0.7.6
   Compiling safemem v0.3.3
   Compiling hex v0.4.3
   Compiling eyre v0.6.5
   Compiling indenter v0.3.3
   Compiling linked-hash-map v0.5.4
   Compiling serde v0.8.23
   Compiling async-trait v0.1.50
   Compiling rustc-serialize v0.3.24
   Compiling scoped-tls v1.0.0
   Compiling dotenv v0.15.0
   Compiling encoding_rs v0.8.28
   Compiling termcolor v1.1.2
   Compiling number_prefix v0.4.0
   Compiling scanlex v0.1.4
   Compiling rust-ini v0.13.0
   Compiling urlencoding v1.3.3
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling numtoa v0.1.0
   Compiling ansi_term v0.11.0
   Compiling ipnet v2.3.0
   Compiling minspan v0.1.1
   Compiling humantime v2.1.0
   Compiling cassowary v0.3.0
   Compiling instant v0.1.9
   Compiling tracing-core v0.1.17
   Compiling generic-array v0.14.4
   Compiling unicase v2.6.0
   Compiling ahash v0.7.2
   Compiling nom v6.1.2
   Compiling nom v5.1.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling num-traits v0.2.14
   Compiling tokio v1.14.0
   Compiling num-integer v0.1.44
   Compiling indexmap v1.6.2
   Compiling crossbeam-utils v0.8.3
   Compiling num-bigint v0.2.6
   Compiling num-iter v0.1.42
   Compiling num-rational v0.2.4
   Compiling num-complex v0.2.4
   Compiling input_buffer v0.4.0
   Compiling lock_api v0.4.3
   Compiling futures-channel v0.3.14
   Compiling unicode-bidi v0.3.5
   Compiling tinyvec v1.2.0
   Compiling regex-automata v0.1.9
   Compiling ring v0.16.20
   Compiling http v0.2.4
   Compiling form_urlencoded v1.0.1
   Compiling humantime v1.3.0
   Compiling libsqlite3-sys v0.22.1
   Compiling libsodium-sys v0.2.6
   Compiling heck v0.3.2
   Compiling crc v1.8.1
   Compiling textwrap v0.11.0
   Compiling tabwriter v1.2.1
   Compiling itertools v0.10.1
   Compiling yaml-rust v0.4.5
   Compiling rust-crypto v0.2.36
   Compiling unicode-normalization v0.1.17
   Compiling http-body v0.4.1
   Compiling headers-core v0.2.0
   Compiling aho-corasick v0.7.15
   Compiling buf_redux v0.8.4
   Compiling twoway v0.1.8
   Compiling csv-core v0.1.10
   Compiling parking_lot_core v0.8.3
   Compiling signal-hook-registry v1.3.0
   Compiling num_cpus v1.13.0
   Compiling time v0.1.43
   Compiling atty v0.2.14
   Compiling socket2 v0.4.0
   Compiling dirs-sys v0.3.6
   Compiling rand v0.4.6
   Compiling terminal_size v0.1.16
   Compiling dirs-sys-next v0.1.2
   Compiling fork v0.1.18
   Compiling termion v1.5.6
   Compiling mio v0.7.11
   Compiling tracing v0.1.25
   Compiling want v0.3.0
error: failed to run custom build command for `libsodium-sys v0.2.6`

Caused by:
  process didn't exit successfully: `/Users/wu/Projects/Repositories/atuin/target/debug/build/libsodium-sys-1c508471b25113ee/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("0")
  TARGET = Some("aarch64-apple-darwin")
  HOST = Some("aarch64-apple-darwin")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = None
  checking build system type...
  --- stderr
  Invalid configuration `arm64-apple-darwin21.1.0': machine `arm64-apple' not recognized
  configure: error: /bin/sh build-aux/config.sub arm64-apple-darwin21.1.0 failed
  thread 'main' panicked at '
  Failed to configure libsodium using "/Users/wu/Projects/Repositories/atuin/target/debug/build/libsodium-sys-5ec4197a4527e18f/out/source/libsodium/configure" "--prefix=/Users/wu/Projects/Repositories/atuin/target/debug/build/libsodium-sys-5ec4197a4527e18f/out/installed" "--libdir=/Users/wu/Projects/Repositories/atuin/target/debug/build/libsodium-sys-5ec4197a4527e18f/out/installed/lib" "--host=aarch64-apple-darwin" "--enable-shared=no"
  CFLAGS=-O0 -ffunction-sections -fdata-sections -fPIC -g -fno-omit-frame-pointer -arch arm64 -Wall -Wextra
  CC=cc

  ', /Users/wu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsodium-sys-0.2.6/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
ixnij commented 2 years ago

Looking at the error a bit more, is it common to see arm64-apple as a machine type, and not aarch64-apple-darwin?

I think so. However, nix uses aarch64-darwin as a machine type.

conradludgate commented 2 years ago

Probably something strange about your environment then. It's worth noting that it looks like you're on Monterey, while I'm still running Big Sur.

Should maybe raise an issue on sodiumoxide about this

ixnij commented 2 years ago

Probably something strange about your environment then. It's worth noting that it looks like you're on Monterey, while I'm still running Big Sur.

Should maybe raise an issue on sodiumoxide about this

Yes! I'm using Monterey. I think that's the reason.

uhthomas commented 2 years ago

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
ellie commented 2 years ago

I'm going to close this issue, both @uhthomas and @conradludgate have built Atuin successfully on M1 chips, each running different versions of MacOS. And also with nix :)

@ixnij sorry for the unhelpful comment, but I suspect there is something wrong with your build environment

Totally happy to re-open if we can figure out some steps to reproduce this or otherwise figure out what's going on

shinzui commented 2 years ago

The issue should be reopened. I also can't build on Monterey 12.0.1.

error: failed to run custom build command for `libsodium-sys v0.2.6`

Caused by:
  process didn't exit successfully: `/private/tmp/atuin/target/debug/build/libsodium-sys-43ade199291641d6/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("0")
  TARGET = Some("aarch64-apple-darwin")
  HOST = Some("aarch64-apple-darwin")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = None
  checking build system type...
  --- stderr
  Invalid configuration `arm64-apple-darwin21.1.0': machine `arm64-apple' not recognized
  configure: error: /bin/sh build-aux/config.sub arm64-apple-darwin21.1.0 failed
  thread 'main' panicked at '
  Failed to configure libsodium using "/private/tmp/atuin/target/debug/build/libsodium-sys-8198f72f97e5b9a0/out/source/libsodium/configure" "--prefix=/private/tmp/atuin/target/debug/build/libsodium-sys-8198f72f97e5b9a0/out/installed" "--libdir=/private/tmp/atuin/target/debug/build/libsodium-sys-8198f72f97e5b9a0/out/installed/lib" "--host=aarch64-apple-darwin" "--enable-shared=no"
  CFLAGS=-O0 -ffunction-sections -fdata-sections -fPIC -g -fno-omit-frame-pointer -arch arm64 -Wall -Wextra
  CC=cc

  ', /Users/shinzui/.cargo/registry/src/github.com-1ecc6299db9ec823/libsodium-sys-0.2.6/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
panekj commented 2 years ago

Could you check https://github.com/vector-im/element-web/issues/19486#issuecomment-987072990 and see if that helps?

shinzui commented 2 years ago

The issue points me in the right direction, but it doesn't solve the problem since I don't use homebrew. I'll try to debug.

ellie commented 2 years ago

Hey @shinzui

Please could you confirm if coreutils is your issue or not? A few of us have successfully built and ran on a Monterey M1 machine, some of them from a totally clean OS. I don't see anything specific to the OS or chip that would be causing problems, so it may just be your environment

shinzui commented 2 years ago

@ellie I was finally able to build atuin by not using nix. I still can't get atuin to build from home-manager, so I guess I need to debug that and open an appropriate issue in the home-manager repo. I still think it would be a good idea to replace sodiumoxide since it's deprecated.