circuitpython/.devcontainer
2024-03-21 11:24:44 +01:00
..
atmel-samd add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
cxd56 add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
espressif add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
mimxrt10xx add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
raspberrypi add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
silabs add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
stm add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
codespace_options.png added screenshot 2024-03-21 10:38:08 +01:00
common_tools.sh add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
cortex-m-toolchain.sh add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
esp-idf-toolchain.sh removed some trailing whitespace 2024-03-21 11:13:33 +01:00
fetch-port-submodules.sh add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
install_build_env.sh add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
make-mpy-cross.sh add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
post_create.sh add devcontainter-configurations per port for CP 9.x.x 2024-03-21 10:20:09 +01:00
Readme.md another trailing whitespace. Note that trailing whitespace is valid markdown for a line-break 2024-03-21 11:24:44 +01:00

Build CircuitPython in a Github-Codespace

To build CircuitPython within a Github codespace, you need to perform the following steps.

  1. checkout the code to a codespace
  • click on the green "<> Code"-button
  • select the Codespaces-tab
  • choose "+ new with options..." from the "..."-menu
  • in the following screen select the branch and then
  • select the port instead of "Default project configuration" (unsupported: ports not using cortex-m or esp-idf)
  • update region as necessary
  • finally, click on the green "Create codespace" button
  1. Your codespace is created. Cloning the image and the repo is quite fast, but preparing it for CircuitPython-development takes about 10 minutes. But this is a one-time task: once created, your codespace exists until you explicitly delete it or until it times out (default: 30 days).
    (Technical note: due to a bug in codespace creation, the setup is triggered from $HOME/.bashrc and runs in the background).

  2. During creation, you can run the command tail -f /workspaces/install_build_env.log.active to see what is going on. Once finished the log file is available as /workspaces/install_build_env.log.

  3. To actually build CircuitPython, open a new terminal and run e.g.

    cd ports/raspberrypi
    make -j $(nproc) BOARD=whatever TRANSLATION=xx_XX
    

    This takes about 2m40s. The new terminal is necessary since the setup of the build environment also changes $HOME/.bashrc and sets important environment variables in that file.

As a normal user, you have 120 CPU-hours and 15GB per month free. Since the smallest machine has two CPUs, you effectively have 60 hours active time available.

All scripts are in circuitpython/.devcontainer and can also be executed manually which should usually not be necessary. With small changes, they should also work on a Linux-PC or laptop.