|
1 |
| -Build CircuitPython in a Github-Devcontainer |
2 |
| -============================================ |
| 1 | +Build CircuitPython in a Github-Codespace |
| 2 | +========================================= |
3 | 3 |
|
4 |
| -To build CircuitPython within a Github-Devcontainer, you need to perform |
| 4 | +To build CircuitPython within a Github codespace, you need to perform |
5 | 5 | the following steps.
|
6 | 6 |
|
7 |
| - 1. checkout the code to a devcontainer |
8 |
| - |
9 |
| - - click on the green "<> Code"-button |
10 |
| - - select the Codespaces-tab |
11 |
| - - choose "+ new with options..." from the "..."-menu |
12 |
| - - in the following screen select the branch and then |
13 |
| - - select ".devcontainer/cortex-m/devcontainer.json" instead |
14 |
| - of "Default Codespaces configuration" |
15 |
| - - update region as necessary |
16 |
| - - finally, click on the green "Create codespace" button |
17 |
| - |
18 |
| - 2. Your codespace is created. Cloning the images is quite fast, but |
19 |
| - preparing it for CircuitPython-development takes about 10 minutes. |
20 |
| - Note that this is a one-time task. |
| 7 | + 1. checkout the code to a codespace |
| 8 | + |
| 9 | + - click on the green "<> Code"-button |
| 10 | + - select the Codespaces-tab |
| 11 | + - choose "+ new with options..." from the "..."-menu |
| 12 | + - in the following screen select the branch and then |
| 13 | + - select the port instead of "Default project configuration" |
| 14 | + (unsupported: ports not using cortex-m or esp-idf)\ |
| 15 | +  |
| 16 | + - update region as necessary |
| 17 | + - finally, click on the green "Create codespace" button |
| 18 | + |
| 19 | + 2. Your codespace is created. Cloning the image and the repo is quite fast, |
| 20 | + but preparing it for CircuitPython-development takes about 10 minutes. |
| 21 | + But this is a one-time task: once created, your codespace exists |
| 22 | + until you explicitly delete it or until it times out (default: 30 days).\ |
| 23 | + (Technical note: due to a bug in codespace creation, the setup is |
| 24 | + triggered from `$HOME/.bashrc` and runs in the background). |
21 | 25 |
|
22 | 26 | 3. During creation, you can run the command
|
23 |
| - `tail -f /workspaces/.codespaces/.persistedshare/creation.log` |
24 |
| - to see what is going on. |
| 27 | + `tail -f /workspaces/install_build_env.log.active` |
| 28 | + to see what is going on. Once finished the log file is available |
| 29 | + as `/workspaces/install_build_env.log`. |
25 | 30 |
|
26 |
| - 4. To actually build CircuitPython, run |
| 31 | + 4. To actually build CircuitPython, open a new terminal and run e.g. |
27 | 32 |
|
28 | 33 | cd ports/raspberrypi
|
29 | 34 | make -j $(nproc) BOARD=whatever TRANSLATION=xx_XX
|
30 | 35 |
|
31 |
| - This takes about 2m40s. |
| 36 | + This takes about 2m40s. The new terminal is necessary since the |
| 37 | + setup of the build environment also changes `$HOME/.bashrc` and |
| 38 | + sets important environment variables in that file. |
| 39 | + |
| 40 | +As a normal user, you have 120 CPU-hours and 15GB per month free. Since |
| 41 | +the smallest machine has two CPUs, you effectively have 60 hours active |
| 42 | +time available. |
| 43 | + |
| 44 | +All scripts are in `circuitpython/.devcontainer` and can also be executed |
| 45 | +manually which should usually not be necessary. With small changes, they |
| 46 | +should also work on a Linux-PC or laptop. |
0 commit comments