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