Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme for Nix #1929

Merged
merged 9 commits into from
Dec 12, 2024
Merged

Readme for Nix #1929

merged 9 commits into from
Dec 12, 2024

Conversation

querolita
Copy link
Member

This is a readme file specifically for the Nix building method. It is not meant to be a final version whatsoever, but to provide some initial guidelines for those who are facing issues when using Nix. It contains some basic instructions, followed by common errors that I have encountered myself, with proposals of how to fix them (at least on my M1). If it is not sufficiently generic to be merged, I will happily leave it as a draft PR or an internal Notion page for the onboarding process.

Special thanks to @dannywillems , @Trivo25 , @hattyhattington17 , @georgeee , @Geometer1729, and @mrmr1993, for your inputs and support.

@querolita querolita requested a review from a team as a code owner November 27, 2024 16:32
@querolita querolita requested a review from Trivo25 November 27, 2024 16:32
- [Dune](https://github.com/ocaml/dune) (only needed when compiling o1js from source)
- [Cargo](https://www.rust-lang.org/learn/get-started) (only needed when compiling o1js from source)
- [Dune, ocamlc, opam](https://github.com/ocaml/dune) (only needed when compiling o1js from source)
- [Cargo, rustup](https://www.rust-lang.org/learn/get-started) (only needed when compiling o1js from source)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't your diff, but what does "compiling o1js from source" mean? Is that building bindings? The phrasing seems weird.

README-nix.md Outdated Show resolved Hide resolved
> ```bash
> # avoid macOS updates to destroy nix
> if [ -e '/nix/var/nix/profiles/default/etc/profile.d/>nix-daemon.sh' ]; then
> source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kinds of updates break things, and why is this the fix?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why this is the fix, but I've seen online that OS updates will cause nix to break on macOS. I would like to try this installer in the future on a clean machine and see if it lets us avoid this step https://determinate.systems/posts/nix-survival-mode-on-macos/


```console
./pin.sh
nix develop o1js#default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this command is single-threaded, it takes forever. Recommend enabling max-jobs in nix.conf for parallel build

max-jobs = 20

README-nix.md Outdated Show resolved Hide resolved
README-nix.md Outdated Show resolved Hide resolved
README-nix.md Outdated

#### Fix

Create a new environment for Nix and start from scratch.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just rerunning ./pin.sh and nix develop o1js

Copy link
Member

@Geometer1729 Geometer1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, sorry I wasn't much help with the MacOS stuff

README-nix.md Outdated Show resolved Hide resolved
Co-authored-by: Danny Willems <[email protected]>
Copy link
Member

@Trivo25 Trivo25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with merging this. We could add a disclaimer that not all of these "solutions" might work universally and might vary depending on your environment, but I would rather provide hints than not talk about it at all - thanks! :)

@querolita querolita merged commit 45e1a89 into main Dec 12, 2024
28 checks passed
@querolita querolita deleted the readme/nix branch December 12, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants