[go: up one dir, main page]

Development Setup

Gitpod

You can contribute with just your web browser, directly from Gitpod

Open in Gitpod

Nix

The easiest way to get everything needed is to use Nix

This project is built with nix

  1. Install Nix

  2. Install DirEnv

  3. Get the source

    git clone https://gitlab.com/pinage404/git-gamble
    
  4. Switch to the directory

    cd ./git-gamble
    

    Note : if you only want to edit the documentation or slides, you can directly change the working directory to it, this will avoid downloading dependencies that you don't need yet in the next step

    cd ./docs
    # or
    # cd ./slides
    
  5. Let DirEnv automagically set up the environment by executing the following command in the project directory

    This will setup all required dependencies

    direnv allow
    

Cachix

To avoid rebuilding from scratch, Cachix can be used

cachix use git-gamble

Troubleshooting

If you get an error like this one when entering in the folder

direnv: loading ~/Project/git-gamble/.envrc
direnv: using nix
direnv: using cached derivation
direnv: eval /home/pinage404/Project/git-gamble/.direnv/cache-.336020.2128d0aa28e
direnv: loading ./script/setup_variables.sh
   Compiling git-gamble v2.4.0-alpha.0 (/home/pinage404/Project/git-gamble)
direnv: ([/nix/store/19arfqh2anf3cxzy8zsiqp08xv6iq6nl-direnv-2.29.0/bin/direnv export fish]) is taking a while to execute. Use CTRL-C to give up.
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: could not compile `git-gamble` due to previous error

Just run the following command to fix it

direnv reload

Help wanted to permanently fix this

Manual

Please reconsider using Nix because of the following advantages:

  • Ensure that the exact same versions will be installed, the versions that are known to work
  • Ensure the packages are installed in a way that works
  • All packages are installed, not only the rust toolchain, allowing you to work on any part

If you still want to avoid Nix, then follow these instructions:

  1. Install Rustup

  2. Start a new terminal to load the new configuration

  3. Clone and navigate to git-gamble

    git clone https://gitlab.com/pinage404/git-gamble.git
    cd git-gamble
    
  4. Install project-specific Rust toolchain and build the project

    Running a build for the first time will install the toolchain from rust-toolchain.toml:

    cargo build
    
  5. Configure the environment

    DirEnv is the recommended tool to setup the environment. If you don't want to use it, then install and configure everything that should normally be installed by .envrc

Next, read the other files in the development section.