Nix on MacOS Catalina

@thedavidmeister @guillemcordoba @carolyn I am having trouble on Big Sur

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

error: refusing to create Nix store volume because the boot volume is
FileVault encrypted, but encryption-at-rest is not available.
Manually create a volume for the store and re-run this script.
See https://nixos.org/nix/manual/#sect-macos-installation

please help! :pray:

I just want to start writing Happs so bad… maybe I should just get Linux?
I’m a new developer and totally lost, I dont want to lose my data, would downloading a different OS screw things up? I don’t have parallels nor want to get it, so should I just go buy a PC?

ready to give up :sleepy: :cry:

don’t give up :slight_smile:

in my experience mac have a long history of breaking linux-ey things with their OS upgrades and nix does not escape

their mantra of ‘Just Works’ only extends as far as native applications and their vetted app store :confused: - after playing around with M1 for a few days i’m already seeing a lot of things crashing or bugging, even through rosetta…

anyway… to be constructive rather than just complaining

yes, if you just want to get stuck into happ development, use linux/docker until the nix scripts catch up

alternatively, you can use rust/cargo directly to install holochain and build your happs if you’re more comfortable with that approach - you can cargo install what you need from the holochain repository, it all uses stable rust for the binaries and wasm builds (not nightly)

cc: @steveeJ

1 Like

thank you! @thedavidmeister where can I find instructions to use the cargo method?

1 Like

install cargo - https://doc.rust-lang.org/cargo/getting-started/installation.html

building holochain and hc with cargo - https://github.com/holochain/holochain#building-with-cargo-if-you-already-have-rust-installed

~ % cargo install --path crates/holochain

error: /Users/ownername/crates/holochain is not a directory. --path must point to a directory containing a Cargo.toml file.

Nix will not install bc of something about read-only (MacOS Big Sur) – but youre saying I dont need Nix right? –

it says in this doc that Mac is not supported… perhaps this is the problem?
my friend got Elemental working on Catalina tho so im so confused :man_facepalming:

@thedavidmeister thank you so much for the help!! :pray: :pray: :pray:

I did alot of code work for engineering classes in University…

also written a bunch of smart contracts. I’m an algo, cryptography, game theory, probability/statistics, data analytics, type of guy. know very little about standard developer stuff :upside_down_face: :blush:

I’ve taken the devcamps, had got redux working fine but now I’m stuck with RSM changes and my OS update

the problem is that you’re not running the command from inside the holochain repo

you need to clone it locally first

holochain % cargo install --path crates/holochain

Installing holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain)

error: failed to compile holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain), intermediate artifacts can be found at /Users/Zeek/holochain/target

Caused by:

failed to parse lock file at: /Users/Zeek/holochain/Cargo.lock

Caused by:

invalid serialized PackageId for key package.dependencies

@thedavidmeister sorry im such noob

very weird, just delete the lock file and try again

that did more, but still:

error : linking with cc failed: exit code: 1

error: Could not compile syn.

warning: build failed, waiting for other jobs to finish…

error : linking with cc failed: exit code: 1

error: failed to compile holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain), intermediate artifacts can be found at /Users/Zeek/holochain/target

Caused by:

Could not compile proc-macro2.

To learn more, run the command again with --verbose.

proc-macro2 is part of rust itself not something we wrote :thinking:

is this the only output you get? i would expect more information

Installing holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain)

error: failed to compile holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain), intermediate artifacts can be found at /Users/Zeek/holochain/target

Caused by:

failed to parse lock file at: /Users/Zeek/holochain/Cargo.lock

Caused by:

invalid serialized PackageId for key package.dependencies

this is what happens each time on new install

the other errors was after I deleted lock file and tried again

cargo install --path crates/holochain

Installing holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain)

Updating git repository https://github.com/holochain/lmdb-rs.git

Updating git repository https://github.com/holochain/rkv.git

Updating git repository https://github.com/neonphog/tokio_safe_block_on.git

Updating crates.io index

Compiling proc-macro2 v1.0.24

Compiling syn v1.0.60

Compiling proc-macro-hack v0.5.19

Compiling libc v0.2.86

error : linking with cc failed: exit code: 1

|

= note : xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

error : aborting due to previous error

error: Could not compile proc-macro-hack.

warning: build failed, waiting for other jobs to finish…

error : linking with cc failed: exit code: 1

|

= note : “cc” “-m64” “-L” “/Users/Zeek/.rustup/toolchains/nightly-2019-01-24-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib” “/Users/Zeek/holochain/target/release/build/syn-8bd4dd5f89975531/build_script_build-8bd4dd5f89975531.build_script_build.6gd4s2hw-cgu.0.rcgu.o” “/Users/Zeek/.rustup/toolchains/nightly-2019-01-24-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-91da867d5d0289af.rlib” “-lSystem” “-lresolv” “-lc” “-lm”

= note : xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

error : aborting due to previous error

error: Could not compile syn.

warning: build failed, waiting for other jobs to finish…

error : linking with cc failed: exit code: 1

|

= note : xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

error : aborting due to previous error

error: Could not compile libc.

warning: build failed, waiting for other jobs to finish…

error : linking with cc failed: exit code: 1

|

= note : xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

error : aborting due to previous error

error: failed to compile holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain), intermediate artifacts can be found at /Users/Zeek/holochain/target

Caused by:

Could not compile proc-macro2.

To learn more, run the command again with --verbose.

install xcode https://ma.ttias.be/mac-os-xcrun-error-invalid-active-developer-path-missing-xcrun/

ah ok I had to sudo reset via CLI. now I get:

holochain % cargo install --path crates/holochain

**Installing** holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain)

**Updating** git repository `https://github.com/holochain/lmdb-rs.git`

**Updating** git repository `https://github.com/holochain/rkv.git`

**Updating** git repository `https://github.com/neonphog/tokio_safe_block_on.git`

**Updating** crates.io index

**Compiling** proc-macro2 v1.0.24

**Compiling** syn v1.0.60

**Compiling** crunchy v0.2.2

**Compiling** proc-macro-hack v0.5.19

**Compiling** libc v0.2.86

**Compiling** serde_derive v1.0.123

**Compiling** memchr v2.3.4

**Compiling** proc-macro-nested v0.1.7

**Compiling** getrandom v0.1.16

**Compiling** version_check v0.9.2

**Compiling** tiny-keccak v2.0.2

**Compiling** autocfg v1.0.1

**Compiling** getrandom v0.2.2

**Compiling** serde v1.0.123

**Compiling** cfg-if v1.0.0

**Compiling** futures-sink v0.3.13

**Compiling** futures-core v0.3.13

**Compiling** pin-project-lite v0.2.4

**error[E0432]** **: unresolved import `core::task::Context`**

**-->** /Users/Zeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.13/src/future.rs:5:18

**|**

**5** **|** use core::task::{Context, Poll};

**|** **^^^^^^^** **no `Context` in `task`**
error[E0432]: unresolved imports `core::task::Context`, `core::task::RawWaker`, `core::task::RawWakerVTable`
  --> /Users/Zeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.13/src/task/mod.rs:10:22
   |
10 | pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
   |                      ^^^^^^^               ^^^^^^^^  ^^^^^^^^^^^^^^ no `RawWakerVTable` in `task`
   |                      |                     |
   |                      |                     no `RawWaker` in `task`
   |                      no `Context` in `task`
**Compiling** slab v0.4.2

**error[E0658]** **: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)**

**-->** /Users/Zeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-sink-0.3.13/src/lib.rs:14:1

**|**

**14** **|** extern crate alloc;

**|** **^^^^^^^^^^^^^^^^^^^**

**|**

**=** **help** : add #![feature(alloc)] to the crate attributes to enable

**error[E0658]** **: use of unstable library feature 'futures_api': futures in libcore are unstable (see issue #50547)**

**-->** /Users/Zeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-sink-0.3.13/src/lib.rs:18:27

**|**

**18** **|** use core::task::{Context, Poll};

**|** **^^^^**

**|**

**=** **help** : add #![feature(futures_api)] to the crate attributes to enable

**error[E0658]** **: use of unstable library feature 'futures_api': futures in libcore are unstable (see issue #50547)**

**-->** /Users/Zeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-sink-0.3.13/src/lib.rs:63:66

**|**

**63** **|** fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>;

**|** **^^^^^^^^^^^^^^^^^^^^^^^^^^^^^**

**|**

**=** **help** : add #![feature(futures_api)] to the crate attributes to enable
**error[E0658]** **: use of unstable library feature 'futures_api': futures in libcore are unstable (see issue #50547)**

**-->** /Users/Zeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.13/src/future.rs:53:57

**|**

**53** **|** impl<F, T, E> Sealed for F where F: ?Sized + Future<Output = Result<T, E>> {}

**|** **^^^^^^^^^^^^^^^^^^^^^**

**|**

**=** **help** : add #![feature(futures_api)] to the crate attributes to enable

**error** **: aborting due to 37 previous errors**

**Some errors occurred: E0432, E0658.**

**For more information about an error, try `rustc --explain E0432`.**

**error:** Could not compile `futures-core`.

**warning:** build failed, waiting for other jobs to finish...

**error** **: aborting due to 28 previous errors**

**Some errors occurred: E0432, E0658.**

**For more information about an error, try `rustc --explain E0432`.**

**error:** Could not compile `futures-sink`.

**warning:** build failed, waiting for other jobs to finish...

**error:** failed to compile `holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain)`, intermediate artifacts can be found at `/Users/Zeek/holochain/target`

Caused by:

build failed

Well that sounds like a previous version of cargo, which version are you on?

I wouldn’t advise to delete the Cargo.lock file. It’ll get you into untested territory as the dependencies in the Cargo.toml aren’t all pinned.

@pqcdev if you go the cargo route I suggest you use the main branch on the holochain repository because we (for now manually) ensure that it builds on macOS in our Nix infrastructure that feeds HoloPortOS.

@steveeJ i suggested deleting the lock because it seemed to me like whatever was there is corrupt somehow

cargo 1.33.0-nightly (907c0febe 2019-01-20)

I followed cargo installation link that David gave me (altho I already had it from redux, perhaps its not updating properly?)

sounds like I should just get Linux… any suggestions on a good PC laptop to buy? or maybe how best I can go about this? unfortunately cant get a desktop bc I dont have a permanent home

I can use my Macbook for everyday stuff and the other comp for Happ building

many thanks to all of you!! :pray: