From 48e5e7c7f3cff94ce44c5481664f7ff8abc95c6a Mon Sep 17 00:00:00 2001 From: joao <22820692+joaolago1113@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:23:49 +0000 Subject: [PATCH] chore: update alternative nargo installation methods from noirup (#4246) # Description This update addresses the need for alternative installation methods for Nargo, focusing on the use of `noirup` as the preferred approach. The existing documentation outlined outdated methods, which did not reflect the current recommendations for installing Nargo via `noirup`. This was documented in GitHub Issues #3196 and #4055, highlighting the need for documentation that accurately reflects the preferred binary fetching and source compiling options provided by `noirup`. ## Problem\* Resolves #4055 ## Summary\* This Pull Request updates the Alternative Install Methods documentation for Nargo to highlight noirup as the encouraged method for installation. It revises the guide to focus on using noirup for fetching binaries or compiling from source, offering detailed instructions for each scenario, including nightly builds, specific versions, branches, forks, pull requests, commits, and local directories. It also marks the previously recommended methods (manual binary downloads and Nix compilation) as no longer encouraged, directing users towards the more streamlined noirup approach. ## Additional Context The move to noirup simplifies installation process thus helping users better manage their nargo setup. This PR aims at ensuring users are pointed to most current and efficient installation procedures towards enhancing Noir development tools experience. ## Documentation\* Check one: - [ ] No documentation needed. - [ x ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ x ] I have tested the changes locally. - [ x ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: kevaundray --- .../installation/other_install_methods.md | 120 ++++++++++++++---- 1 file changed, 92 insertions(+), 28 deletions(-) diff --git a/docs/docs/getting_started/installation/other_install_methods.md b/docs/docs/getting_started/installation/other_install_methods.md index a532f83750e..489f1eda802 100644 --- a/docs/docs/getting_started/installation/other_install_methods.md +++ b/docs/docs/getting_started/installation/other_install_methods.md @@ -1,38 +1,102 @@ --- title: Alternative Install Methods -description: - There are different ways to install Nargo, the one-stop shop and command-line tool for developing Noir programs. This guide explains other methods that don't rely on noirup, such as compiling from source, installing from binaries, and using WSL for windows +description: There are different ways to install Nargo, the one-stop shop and command-line tool for developing Noir programs. This guide explains other methods that don't rely on noirup, such as compiling from source, installing from binaries, and using WSL for windows keywords: [ - Installation - Nargo - Noirup - Binaries - Compiling from Source - WSL for Windows - macOS - Linux - Nix - Direnv - Shell & editor experience - Building and testing - Uninstalling Nargo - Noir vs code extension -] + Installation + Nargo + Noirup + Binaries + Compiling from Source + WSL for Windows + macOS + Linux + Nix + Direnv + Shell & editor experience + Building and testing + Uninstalling Nargo + Noir vs code extension, + ] sidebar_position: 1 --- +## Encouraged Installation Method: Noirup -## Installation +Noirup is the endorsed method for installing Nargo, streamlining the process of fetching binaries or compiling from source. It supports a range of options to cater to your specific needs, from nightly builds and specific versions to compiling from various sources. -The most common method of installing Nargo is through [Noirup](./index.md) +### Installing Noirup + +First, ensure you have `noirup` installed: + +```sh +curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash +``` + +### Fetching Binaries + +With `noirup`, you can easily switch between different Nargo versions, including nightly builds: + +- **Nightly Version**: Install the latest nightly build. + + ```sh + noirup --version nightly + ``` + +- **Specific Version**: Install a specific version of Nargo. + ```sh + noirup --version + ``` + +### Compiling from Source + +`noirup` also enables compiling Nargo from various sources: + +- **From a Specific Branch**: Install from the latest commit on a branch. + + ```sh + noirup --branch + ``` + +- **From a Fork**: Install from the main branch of a fork. + + ```sh + noirup --repo + ``` + +- **From a Specific Branch in a Fork**: Install from a specific branch in a fork. + + ```sh + noirup --repo --branch + ``` + +- **From a Specific Pull Request**: Install from a specific PR. + + ```sh + noirup --pr + ``` + +- **From a Specific Commit**: Install from a specific commit. + + ```sh + noirup -C + ``` + +- **From Local Source**: Compile and install from a local directory. + ```sh + noirup --path ./path/to/local/source + ``` + +## Alternate Installation Methods (No Longer Recommended) + +While the following methods are available, they are no longer recommended. We advise using noirup for a more efficient and flexible installation experience. However, there are other methods for installing Nargo: -- [Binaries](#binaries) -- [Compiling from Source](#compile-from-source) -- [WSL for Windows](#wsl-for-windows) +- [Binaries](#option-1-installing-from-binaries) +- [Compiling from Source](#option-2-compile-from-source) +- [WSL for Windows](#option-3-wsl-for-windows) -### Binaries +### Option 1: Installing from Binaries See [GitHub Releases](https://github.com/noir-lang/noir/releases) for the latest and previous platform specific binaries. @@ -81,7 +145,7 @@ Check if the installation was successful by running `nargo --version`. You shoul > **macOS:** If you are prompted with an OS alert, right-click and open the _nargo_ executable from > Finder. Close the new terminal popped up and `nargo` should now be accessible. -### Option 3: Compile from Source +### Option 2: Compile from Source Due to the large number of native dependencies, Noir projects uses [Nix](https://nixos.org/) and [direnv](https://direnv.net/) to streamline the development experience. It helps mitigating issues commonly associated with dependency management, such as conflicts between required package versions for different projects (often referred to as "dependency hell"). @@ -161,19 +225,19 @@ If you have hesitations with using direnv, you can launch a subshell with `nix d Advanced: If you aren't using direnv nor launching your editor within the subshell, you can try to install Barretenberg and other global dependencies the package needs. This is an advanced workflow and likely won't receive support! -### Option 4: WSL (for Windows) +### Option 3: WSL (for Windows) The default backend for Noir (Barretenberg) doesn't provide Windows binaries at this time. For that reason, Noir cannot be installed natively. However, it is available by using Windows Subsystem for Linux (WSL). Step 1: Follow the instructions [here](https://learn.microsoft.com/en-us/windows/wsl/install) to install and run WSL. -step 2: Follow the [Noirup instructions](./index.md). +step 2: Follow the [Noirup instructions](#encouraged-installation-method-noirup). ## Uninstalling Nargo ### Noirup -If you installed Noir with `noirup`, you can uninstall Noir by removing the files in `~/.nargo`, `~/nargo` and `~/noir_cache`. +If you installed Nargo with `noirup` or through directly downloading binaries, you can uninstall Nargo by removing the files in `~/.nargo`, `~/nargo`, and `~/noir_cache`. This ensures that all installed binaries, configurations, and cache related to Nargo are fully removed from your system. ```bash rm -r ~/.nargo @@ -183,7 +247,7 @@ rm -r ~/noir_cache ### Nix -If you installed Noir with Nix or from source, you can remove the binary located at `~/.nix-profile/bin/nargo`. +If you installed Nargo with Nix or compiled it from source, you can remove the binary located at `~/.nix-profile/bin/nargo`. ```bash rm ~/.nix-profile/bin/nargo