Skip to content

WIP: doc: give direnv instructions for making dependencies locally available to tezos

This MR aims at improving build reproducibility by minimizing dependencies to the global installation and making it easier to have multiple tezos clones - using different versions - working at the same time. This is done by using direnv that

augments existing shells with a new feature that can load and unload environment variables depending on the current directory.

These instructions are optional and do not replace the usual instructions. The aim is, however, to start going into this direction. This MR will wait for !1711 (merged) to be merged first, as this MR will then be augmented with instructions specific to the test framework.

Recommended reviewers: @arvidnl @mbouaziz @dannywillems

Note that this MR does NOT document how to install tools locally to the tezos directory (this is done already for opam because a local switch is used). It is desirable but it doesn't work at the moment for cargo and rustup.

Normally cargo and rustup support a local install by specifying CARGO_HOME and RUSTUP_HOME like this:

cd tezos
export CARGO_HOME=$(pwd)/.cargo
export RUSTUP_HOME=$(pwd)/.rustup
curl https://sh.rustup.rs -sSf | sh

So the following in .envrc should work:

PATH_add .cargo/bin

but unfortunately compilation fails as follows:

[ERROR] The compilation of conf-rust failed at "/home/churlin/.opam/opam-init/hooks/sandbox.sh build which cargo".
#=== ERROR while compiling conf-rust.0.1 ======================================#
# context     2.0.4 | linux/x86_64 | ocaml-base-compiler.4.09.1 | git+https://gitlab.com/tezos/opam-repository.git#f9f3b9f7cd60a54f06836cca466a19f562c9b833
# path        /media/crypt1/nomadic/tezos/_opam/.opam-switch/build/conf-rust.0.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build which cargo
# exit-code   1
# env-file    ~/.opam/log/conf-rust-28040-ccabea.env
# output-file ~/.opam/log/conf-rust-28040-ccabea.out
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build conf-rust 0.1

because opam must somehow escape direnv's sandbox (this is sad 😿).

Edited by Robin Bate Boerop

Merge request reports