build: update devcontainer and use latest codespaces features (#36422)

* build: update devcontainer to latest build image

* build: add update-content-command

* build: set good vscode config

* build: be less noisy in update command

* build: only run sync in prebuild environment

* build: list env vars

* build: run sync always
This commit is contained in:
Samuel Attard 2022-11-22 12:16:15 -08:00 коммит произвёл GitHub
Родитель c6d6af2551
Коммит 2751c2b07f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 42 добавлений и 10 удалений

Просмотреть файл

@ -4,14 +4,13 @@ Welcome to the Codespaces Electron Developer Environment.
## Quick Start ## Quick Start
Upon creation of your codespace you should have [build tools](https://github.com/electron/build-tools) installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following commands. Upon creation of your codespace you should have [build tools](https://github.com/electron/build-tools) installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following command.
```bash ```bash
e sync -vv
e build e build
``` ```
The initial sync will take approximately ~30 minutes and the build will take ~8 minutes. Incremental syncs and incremental builds are substantially quicker. The initial build will take ~8 minutes. Incremental builds are substantially quicker. If you pull changes from upstream that touch either the `patches` folder or the `DEPS` folder you will have to run `e sync` in order to keep your checkout up to date.
## Directory Structure ## Directory Structure

Просмотреть файл

@ -2,6 +2,7 @@
"dockerComposeFile": "docker-compose.yml", "dockerComposeFile": "docker-compose.yml",
"service": "buildtools", "service": "buildtools",
"onCreateCommand": ".devcontainer/on-create-command.sh", "onCreateCommand": ".devcontainer/on-create-command.sh",
"updateContentCommand": ".devcontainer/update-content-command.sh",
"workspaceFolder": "/workspaces/gclient/src/electron", "workspaceFolder": "/workspaces/gclient/src/electron",
"extensions": [ "extensions": [
"joeleinbinder.mojom-language", "joeleinbinder.mojom-language",
@ -11,14 +12,28 @@
"mutantdino.resourcemonitor", "mutantdino.resourcemonitor",
"dbaeumer.vscode-eslint", "dbaeumer.vscode-eslint",
"shakram02.bash-beautify", "shakram02.bash-beautify",
"marshallofsound.gnls-electron" "marshallofsound.gnls-electron",
"CircleCI.circleci"
], ],
"settings": { "settings": {
"editor.tabSize": 2,
"bashBeautify.tabSize": 2,
"typescript.tsdk": "node_modules/typescript/lib",
"[gn]": { "[gn]": {
"editor.formatOnSave": true "editor.formatOnSave": true
}, },
"editor.tabSize": 2, "[javascript]": {
"bashBeautify.tabSize": 2 "editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single"
}, },
"forwardPorts": [8088, 6080, 5901], "forwardPorts": [8088, 6080, 5901],
"portsAttributes": { "portsAttributes": {
@ -36,8 +51,15 @@
} }
}, },
"hostRequirements": { "hostRequirements": {
"storage": "32gb", "storage": "128gb",
"cpus": 8 "cpus": 16
}, },
"remoteUser": "builduser" "remoteUser": "builduser",
"customizations": {
"codespaces": {
"openFiles": [
".devcontainer/README.md"
]
}
}
} }

Просмотреть файл

@ -2,7 +2,7 @@ version: '3'
services: services:
buildtools: buildtools:
image: ghcr.io/electron/devcontainer:27db4a3e3512bfd2e47f58cea69922da0835f1d9 image: ghcr.io/electron/devcontainer:3d8d44d0f15b05bef6149e448f9cc522111847e9
volumes: volumes:
- ..:/workspaces/gclient/src/electron:cached - ..:/workspaces/gclient/src/electron:cached

Просмотреть файл

@ -10,6 +10,7 @@ export PATH="$PATH:$buildtools/src"
# Create the persisted buildtools config folder # Create the persisted buildtools config folder
mkdir -p $buildtools_configs mkdir -p $buildtools_configs
mkdir -p $gclient_root/.git-cache
rm -f $buildtools/configs rm -f $buildtools/configs
ln -s $buildtools_configs $buildtools/configs ln -s $buildtools_configs $buildtools/configs

Просмотреть файл

@ -0,0 +1,10 @@
#!/bin/bash
set -eo pipefail
buildtools=$HOME/.electron_build_tools
export PATH="$PATH:$buildtools/src"
# Sync latest
e d gclient sync --with_branch_heads --with_tags