Skip to content

Commit e2e2405

Browse files
committed
docs(suite): bcrypto build troubleshooting
1 parent cdde4fd commit e2e2405

File tree

5 files changed

+48
-1
lines changed

5 files changed

+48
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,6 @@ packages/suite-data/files/translations/master.json
158158
# cypress download folder
159159

160160
packages/suite-web/e2e/downloads
161+
162+
# python virtualenv, some Linux users may need it for workaround
163+
.venv

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Welcome to the Trezor Suite repository! This repository contains the source code
1010

1111
# Development
1212

13-
Development is not possible on Windows. This can be circumvented by tools such as [WSL](https://learn.microsoft.com/en-us/windows/wsl/install), see our [guide](https://docs.trezor.io/trezor-suite/misc/WSL.html).
13+
Development is not possible on Windows. This can be circumvented by tools such as [WSL](https://learn.microsoft.com/en-us/windows/wsl/install), see our [guide](https://docs.trezor.io/trezor-suite/misc/development-on-windows.html).
1414

1515
### Prerequisities
1616

@@ -28,6 +28,8 @@ Development is not possible on Windows. This can be circumvented by tools such a
2828
- `yarn`
2929
- `yarn build:libs`
3030

31+
For troubleshooting of common issues, [see guide](https://docs.trezor.io/trezor-suite/misc/suite-setup-troubleshooting.html).
32+
3133
It's recommended to enable `git config --global submodule.recurse true` so you don't need to run `git submodule update --init --recursive` every time when submodules are updated.
3234

3335
> You don't need a Trezor device to get into the app, you can use emulator. There is a [Trezor User Env](https://github.com/trezor/trezor-user-env) to help you set it up and run emulator for any Trezor model 🎉

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,5 @@
8888
- [development on Windows](./misc/development-on-windows.md)
8989
- [device naming](./misc/device-naming.md)
9090
- [review](./misc/review.md)
91+
- [suite setup troubleshooting](./misc/suite-setup-troubleshooting)
9192
- [videos](./misc/videos.md)

docs/misc/development-on-windows.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ In WSL:
1919

2020
Proceed with the [general readme instructions](../../README.md#trezor-suite-trezorsuite).
2121

22+
See general [setup troubleshooting docs](./suite-setup-troubleshooting.md) if necessary.
23+
2224
## Connecting USB device
2325

2426
On Windows, run `usbipd list`, find the bus id of the Trezor device, e.g. `2-1`.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Suite setup troubleshooting
2+
3+
This document is a guide to overcome common issues with Trezor Suite local dev environment setup.
4+
5+
The setup happy path is described in the main [Suite README](https://github.com/trezor/trezor-suite).
6+
7+
### bcrypto fails yarn install
8+
9+
#### Issue
10+
11+
On Linux, comamnd `yarn` fails with a similar error:
12+
13+
```
14+
bcrypto@npm:5.4.0 couldn't be built successfully (exit code 1, logs can be found here: /tmp/something.log
15+
```
16+
17+
And the mentioned logfile contains: `ModuleNotFoundError: No module named 'distutils'`
18+
19+
#### Solution
20+
21+
In trezor-suite root directory, run:
22+
23+
```
24+
python3 -m venv .venv
25+
source .venv/bin/activate
26+
pip install setuptools
27+
yarn
28+
deactivate
29+
```
30+
31+
When you need it next time in future, repeat the same, but **without** the first command (`python3 -m venv .venv`), because virtualenv has already been created.
32+
33+
#### Explanation
34+
35+
`bcrypto` is a native module that requires `node-gyp` to build, which in turn requires python `gyp`.
36+
However, `bcrypto` relies on the deprecated Python2 build method, and the built-in `distutils` package, which has been removed in Python 3.12.
37+
Installing `setuptools` via pip solves this, as it also provides legacy `distutils`...
38+
but on Linux Ubuntu you can't pip install globally, as it's managed by apt, and there is no apt package anymore which would solve it.
39+
Though you can install `setuptools` in a virtual environment (a.k.a. venv), and yarn then uses it.

0 commit comments

Comments
 (0)