This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Codespaces

Setting up Development Environment in GitHub Codespaces

Install the GitHub Codespaces Extension

Note: When using our DevContainer, the GitHub Codespaces extension is pre-installed.

  • Start VSCode
  • Go to Extensions
  • Search for “GitHub Codespaces”
  • Click Install

Alternatively, create a new codespace via the GitHub web interface:

Select a big enough machine type for Yocto/BitBake, e.g. 16 CPU. You need at leasst 50GB disk space.

Building Leda in a Github Codespace

After successfully obtaining and connecting to a codespace you can build Leda either with kas or manually:

Private Repositories

When using GitHub Codespaces with submodules and private repositories, a separate tool for git authentication is required (see VSCode issue #109050), as the authentication token provided to the GitHub Codespaces virtual machine only allows access to the main repository.

Git Credential Manager: https://aka.ms/gcm

Installation:

curl -LO https://raw.githubusercontent.com/GitCredentialManager/git-credential-manager/main/src/linux/Packaging.Linux/install-from-source.sh &&
sh ./install-from-source.sh &&
git-credential-manager-core configure

1 - Advanced topics

Git Authentication

For private repositories, we need to separately authenticate against the submodule repositories, as GitHub Codespaces will only inject a token with access rights to the current repository.

  1. Change to the users home directory

    cd ~
    
  2. Install Git Credential Manager

    curl -LO https://raw.githubusercontent.com/GitCredentialManager/git-credential-manager/main/src/linux/Packaging.Linux/install-from-source.sh &&
    sh ./install-from-source.sh &&
    git-credential-manager-core configure
    
  3. Configure a credential store typ, e.g. git config --global credential.credentialStore plaintext

  4. Verify with git config --global -l, it should show git-credential-manager-core as the credential helper.

Update the submodules

Run git submodule update --recursive

See VSCode Issue #109050 for details.

Setup skopeo

Skopeo is needed to download various files during the build:

sudo mkdir -p /run/containers/1000
sudo chmod a+w /run/containers/1000
skopeo login ghcr.io --authfile ~/auth.json --username <your GitHub User> 

Enter your token when asked for the password.