Skip to content

Commit 936535e

Browse files
committed
Add install instructions for Debian 12 (and trixie).
Signed-off-by: Daira-Emma Hopwood <[email protected]>
1 parent 3d2c041 commit 936535e

File tree

2 files changed

+279
-40
lines changed

2 files changed

+279
-40
lines changed

README.md

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ Install Dependencies
2424

2525
If you're using one of the following platforms, see the linked instructions for that platform:
2626

27-
- [Debian 9.x](dependency_install_steps_by_platform/Debian_9.x.md)
28-
- [Ubuntu 18.04.x](dependency_install_steps_by_platform/Ubuntu_18.04.x.md)
27+
- [Debian 12 (either bookworm or trixie)](dependency_install_steps_by_platform/Debian_12.md)
28+
- [Debian 9](dependency_install_steps_by_platform/Debian_9.x.md)
29+
- [Ubuntu 18.04](dependency_install_steps_by_platform/Ubuntu_18.04.x.md)
2930
- [macOS](dependency_install_steps_by_platform/macOS.md)
3031

3132

@@ -160,50 +161,40 @@ Project-specific environment settings will come in handy in the next step, when
160161
isolated python virtual environment specifically for use with this project.
161162

162163

163-
164164
## Create a python virtual environment for this project
165165

166166
Note: The main purpose of this part is to get a current version of ansible, and keep it locally
167167
within this project. If you already installed ansible (e.g. from an OS package manager like apt),
168168
you can skip this part and the following parts about pip and pip packages.
169169

170170
When creating a virtual environment, call the python executable you want the virtual environment to
171-
use. The location and version will depend on your specific setup -- your OS may provide a suitably
172-
current python interpreter, or you may have built and installed one yourself. If it's in your PATH,
173-
a command like `type python3` should tell you where it is installed on your system. For example:
174-
175-
```
176-
% type python3
177-
python3 is /usr/bin/python3
178-
% /usr/bin/python3 --version
179-
Python 3.9.7
180-
```
171+
use. Below we will assume this is ``python3.11``.
181172

182-
We can use python's built-in `venv` module to create a virtual environment:
173+
We can use Python's `virtualenv` module to create a virtual environment:
183174

184175
```
185-
zcash-gitian % /usr/bin/python3 -m venv ./local/python_v3.9.7_venv
176+
zcash-gitian$ python3.11 -m virtualenv ./local/python_venv
186177
```
187178

188-
Translation: "Create a virtual environment at ./local/python_v3.9.7_venv".
179+
Translation: "Create a virtual environment at ./local/python_venv".
189180

190181
The project subdirectory `local` is `.gitignored` to provide a convenient location for files we
191182
don't want to commit and track in version control.
192183

193-
You should now have a tree of directories and files in `local/python_v3.9.7_venv`:
184+
You should now have a tree of directories and files in `local/python_venv`:
194185

195186
```
196-
zcash-gitian % ls -F ./local/python_v3.9.7_venv
187+
zcash-gitian$ ls -F ./local/python_venv
197188
bin/ include/ lib/ pyvenv.cfg
198189
```
199190

200191
Inside the `bin` directory, among other things, are the entries `python` and `python3`, which are
201192
symlinks that point back to the `python3` executable we used to create this environment:
202193

203194
```
204-
zcash-gitian % ls -F ./local/python_v3.9.7_venv/bin/
205-
Activate.ps1 activate.csh pip* pip3.9* python3@
206-
activate activate.fish pip3* python@ python3.9@
195+
zcash-gitian$ ls -F ./local/python_venv/bin/
196+
Activate.ps1 activate.csh pip* pip3.11* python3@
197+
activate activate.fish pip3* python@ python3.11@
207198
```
208199

209200
A python virtual environment is 'active' if the python interpreter being executed is run from its
@@ -215,7 +206,7 @@ An `activate` script is provided, and you can use that, but if you're using `dir
215206
a simple automatic activation for the project directory by adding the following line to `.envrc`:
216207

217208
```
218-
load_prefix local/python_v3.9.7_venv
209+
load_prefix local/python_venv
219210
```
220211

221212
The command `load_prefix` is provided by `direnv` to modify a whole set of common "path" variables
@@ -224,7 +215,7 @@ The command `load_prefix` is provided by `direnv` to modify a whole set of commo
224215
Let's add that line now:
225216

226217
```
227-
zcash-gitian$ echo "load_prefix local/python_v3.9.7_venv" >> .envrc
218+
zcash-gitian$ echo "load_prefix local/python_venv" >> .envrc
228219
direnv: error .envrc is blocked. Run `direnv allow` to approve its content.
229220
zcash-gitian$ direnv allow
230221
direnv: loading .envrc
@@ -239,38 +230,42 @@ locations we default to:
239230

240231
```
241232
zcash-gitian$ echo $PATH
242-
/Users/harrypotter/Projects/zcash-gitian/local/python_v3.9.7_venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
233+
/Users/harrietporber/Projects/zcash-gitian/local/python_venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
243234
zcash-gitian$ type python
244-
python is /Users/harrypotter/Projects/zcash-gitian/local/python_v3.9.7_venv/bin/python
235+
python is /Users/harrietporber/Projects/zcash-gitian/local/python_venv/bin/python
245236
zcash-gitian$ type python3
246-
python3 is /Users/harrypotter/Projects/zcash-gitian/local/python_v3.9.7_venv/bin/python3
237+
python3 is /Users/harrietporber/Projects/zcash-gitian/local/python_venv/bin/python3
247238
```
248239

249240
Since the `python` and `python3` commands will now run from the locations we've installed into our
250241
project's virtual environment while we are in the project directory, we can consider the virtual
251242
environment active when using a shell at (or below) that location.
252243

244+
Alternatively, you can manually activate the virtualenv in the current shell:
245+
246+
```
247+
zcash-gitian$ source local/python3_venv/bin/activate
248+
```
253249

254250

255251
## Upgrade pip
256252

257-
`pip3` has a command to upgrade itself. Let's go ahead and run that:
253+
`pip` has a command to upgrade itself. Let's go ahead and run that:
258254

259255
```
260-
zcash-gitian % pip3 install --upgrade pip
261-
Requirement already satisfied: pip in ./local/python_v3.9.7_venv/lib/python3.9/site-packages (21.2.4)
256+
zcash-gitian$ python3.11 -m pip install --upgrade pip
257+
Requirement already satisfied: pip in ./local/python_venv/lib/python3.11/site-packages ([...])
262258
```
263259

264260

265-
266261
## Install pip packages
267262

268263
We have some dependencies to install as python packages, using the pip package manager installed
269264
above. The set we need, with version numbers managed via git, is in `requirements-pip.lock`; we can
270-
run `pip3 install` with that file as input:
265+
run `python3.11 -m pip install` with that file as input:
271266

272267
```
273-
zcash-gitian$ pip3 install --requirement requirements-pip.lock
268+
zcash-gitian$ python3.11 -m pip install --requirement requirements-pip.lock
274269
```
275270

276271
Check that you can run `ansible` from the command line:
@@ -445,28 +440,43 @@ vagrant@zcash-build:~$ ./gitian-build.sh
445440

446441
If you want to run a parallel build, invoke `./gitian-parallel-build.sh` instead.
447442

448-
The output from `gbuild` is informative. There are some common warnings which can be ignored, e.g. if you get an intermittent privileges error related to LXC then just execute the script again. The most important thing is that one reaches the step which says `Running build script (log in var/build.log)`. If not, then something else is wrong and you should let us know.
443+
The output from `gbuild` is informative. There are some common warnings which can be ignored,
444+
e.g. if you get an intermittent privileges error related to LXC then just execute the script again.
445+
The most important thing is that one reaches the step that says
446+
`Running build script (log in var/build.log)`. If not, then something else is wrong and you should
447+
let us know.
449448

450-
Take a look at the variables near the top of `~/gitian-build.sh` and get familiar with its functioning, as it can handle most tasks.
449+
Take a look at the variables near the top of `~/gitian-build.sh` and get familiar with its
450+
functioning, as it can handle most tasks.
451451

452-
It's also a good idea to regularly `git pull` on this repository to obtain updates and re-run the entire VM provisioning for each release, to ensure current and consistent state for your builder.
452+
It's also a good idea to regularly `git pull` on this repository to obtain updates and re-run the
453+
entire VM provisioning for each release, to ensure current and consistent state for your builder.
453454

454455

455456
Generating and uploading signatures
456457
-----------------------------------
457458

458-
The procedure used to be to import a GnuPG private key into the VM, and use it there in order to sign the manifests that get pushed to [zcash/gitian.sigs](https://github.com/zcash/gitian.sigs). We no longer do this; instead you will copy the manifests out of the VM and sign them outside. This is simpler because a developer will typically already have their GnuPG and ssh keys outside the VM.
459+
The procedure used to be to import a GnuPG private key into the VM, and use it there in order to
460+
sign the manifests that get pushed to [zcash/gitian.sigs](https://github.com/zcash/gitian.sigs).
461+
We no longer do this; instead you will copy the manifests out of the VM and sign them outside.
462+
This is simpler because a developer will typically already have their GnuPG and ssh keys outside
463+
the VM.
459464

460-
Manifests for the builds you have just completed will be left in the `/home/vagrant/gitian.sigs` directory inside the VM.
465+
Manifests for the builds you have just completed will be left in the `/home/vagrant/gitian.sigs`
466+
directory inside the VM.
461467

462-
Outside the VM, you should have a checkout of your fork of [zcash/gitian.sigs](https://github.com/zcash/gitian.sigs). Copy the manifests out of the VM and then sign them using the `gitian-sign.sh` script. For example, if the `zcash-gitian` and `gitian.sigs` checkouts are sibling directories, `cd` to the former and run:
468+
Outside the VM, you should have a checkout of your fork of
469+
[zcash/gitian.sigs](https://github.com/zcash/gitian.sigs). Copy the manifests out of the VM and
470+
then sign them using the `gitian-sign.sh` script. For example, if the `zcash-gitian` and
471+
`gitian.sigs` checkouts are sibling directories, `cd` to the former and run:
463472

464473
```
465474
vagrant scp 'zcash-build:gitian.sigs/*' ../gitian.sigs
466475
./gitian-sign.sh ../gitian.sigs
467476
```
468477

469-
To validate your own signatures and those of other developers, add the public keys from `contrib/gitian-downloader` in the Zcash source repository and mark them as trusted, then run:
478+
To validate your own signatures and those of other developers, add the public keys from
479+
`contrib/gitian-downloader` in the Zcash source repository and mark them as trusted, then run:
470480

471481
```
472482
./gitian-verify.sh ../gitian.sigs
@@ -490,4 +500,5 @@ Other notes
490500

491501
Port 2200 on the host machine should be forwarded to port 22 on the guest virtual machine.
492502

493-
The automation and configuration management assumes that VirtualBox will assign the IP address `10.0.2.15` to the Gitian host Vagrant VM.
503+
The automation and configuration management assumes that VirtualBox will assign the IP address
504+
`10.0.2.15` to the Gitian host Vagrant VM.

0 commit comments

Comments
 (0)