Skip to content

Commit

Permalink
chore: update to electron 17 (#143223)
Browse files Browse the repository at this point in the history
* chore: bump [email protected]

* Revert "chore: revert to electron@13 (#143851)"

This reverts commit df645f1.

* chore: bump [email protected]

* Revert "ci: fix build with latest node-gyp"

This reverts commit c3e948a.

* chore: revert ci changes for node v16

* chore: update yarn.lock

* chore: bump [email protected]
  • Loading branch information
deepak1556 authored Mar 10, 2022
1 parent 9109c65 commit 32d40cf
Show file tree
Hide file tree
Showing 113 changed files with 501 additions and 445 deletions.
33 changes: 11 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -57,18 +57,7 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: |
# update node-gyp to latest for support in detecting VS 2022 toolchain
npm install -g node-gyp@latest
# Resolve to node-gyp.js
# Remove this once node-version > 17.4.x or > 16.14.0,
# which ships with npm > 8.4.0 that has support for VS 2022 toolchain.
$env:npm_config_node_gyp=$(Join-Path $(Get-Command node-gyp.cmd).Path "..\node_modules\node-gyp\bin\node-gyp.js" -Resolve)
# Electron <= 13 does not ship with correct config.gypi headers,
# remove this once we update to newer versions.
# Refs https://github.com/nodejs/node-gyp/pull/2497
$env:npm_config_force_process_config="true"
yarn --frozen-lockfile --network-timeout 180000
run: yarn --frozen-lockfile --network-timeout 180000
- name: Create node_modules archive
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: |
Expand Down Expand Up @@ -124,7 +113,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- name: Compute node modules cache key
id: nodeModulesCacheKey
Expand All @@ -134,8 +123,8 @@ jobs:
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-cacheNodeModules20-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules20-
key: ${{ runner.os }}-cacheNodeModules21-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules21-
- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
Expand Down Expand Up @@ -196,7 +185,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- name: Compute node modules cache key
id: nodeModulesCacheKey
Expand All @@ -206,8 +195,8 @@ jobs:
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-cacheNodeModules20-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules20-
key: ${{ runner.os }}-cacheNodeModules21-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules21-
- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
Expand Down Expand Up @@ -270,7 +259,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- name: Compute node modules cache key
id: nodeModulesCacheKey
Expand All @@ -280,8 +269,8 @@ jobs:
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-cacheNodeModules20-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules20-
key: ${{ runner.os }}-cacheNodeModules21-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules21-
- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/rich-navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,11 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- name: Install dependencies
if: steps.caching-stage.outputs.cache-hit != 'true'
run: |
# update node-gyp to latest for support in detecting VS 2022 toolchain
npm install -g node-gyp@latest
# Resolve to node-gyp.js
# Remove this once node-version > 17.4.x or > 16.14.0,
# which ships with npm > 8.4.0 that has support for VS 2022 toolchain.
$env:npm_config_node_gyp=$(Join-Path $(Get-Command node-gyp.cmd).Path "..\node_modules\node-gyp\bin\node-gyp.js" -Resolve)
# Electron <= 13 does not ship with correct config.gypi headers,
# remove this once we update to newer versions.
# Refs https://github.com/nodejs/node-gyp/pull/2497
$env:npm_config_force_process_config="true"
yarn --frozen-lockfile
run: yarn --frozen-lockfile
env:
CHILD_CONCURRENCY: 1

Expand Down
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
disturl "https://electronjs.org/headers"
target "13.5.2"
target "17.1.1"
runtime "electron"
build_from_source "true"
2 changes: 1 addition & 1 deletion build/.cachesalt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-02-28T10:04:13.972Z
2022-03-02T05:48:19.264Z
2 changes: 1 addition & 1 deletion build/azure-pipelines/darwin/product-build-darwin-sign.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
6 changes: 1 addition & 5 deletions build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down Expand Up @@ -79,10 +79,6 @@ steps:
set -e
export npm_config_arch=$(VSCODE_ARCH)
export npm_config_node_gyp=$(which node-gyp)
# Electron <= 13 does not ship with correct config.gypi headers,
# remove this once we update to newer versions.
# Refs https://github.com/nodejs/node-gyp/pull/2497
export npm_config_force_process_config=true
for i in {1..3}; do # try 3 times, for Terrapin
yarn --frozen-lockfile && break
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/distro-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pr:
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/exploration-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pr: none
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/product-build-alpine.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
12 changes: 6 additions & 6 deletions build/azure-pipelines/linux/product-build-linux-client.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down Expand Up @@ -99,7 +99,7 @@ steps:
if [ -z "$CC" ] || [ -z "$CXX" ]; then
# Download clang based on chromium revision used by vscode
curl -s https://raw.githubusercontent.com/chromium/chromium/91.0.4472.164/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux
curl -s https://raw.githubusercontent.com/chromium/chromium/98.0.4758.109/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux
# Download libcxx headers and objects from upstream electron releases
DEBUG=libcxx-fetcher \
VSCODE_LIBCXX_OBJECTS_DIR=$PWD/.build/libcxx-objects \
Expand All @@ -109,12 +109,12 @@ steps:
node build/linux/libcxx-fetcher.js
# Set compiler toolchain
# Flags for the client build are based on
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/91.0.4472.164:build/config/arm.gni
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/91.0.4472.164:build/config/compiler/BUILD.gn
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/91.0.4472.164:build/config/c++/BUILD.gn
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/arm.gni
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/compiler/BUILD.gn
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/c++/BUILD.gn
export CC=$PWD/.build/CR_Clang/bin/clang
export CXX=$PWD/.build/CR_Clang/bin/clang++
export CXXFLAGS="-nostdinc++ -D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS -D__NO_INLINE__ -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit"
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -isystem$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit"
export LDFLAGS="-stdlib=libc++ -fuse-ld=lld -flto=thin -L$PWD/.build/libcxx-objects -lc++abi -Wl,--lto-O0"
export VSCODE_REMOTE_CC=$(which gcc)
export VSCODE_REMOTE_CXX=$(which g++)
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/product-build-linux-server.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/snap-build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: DownloadPipelineArtifact@0
displayName: "Download Pipeline Artifact"
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/product-compile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/product-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureCLI@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/publish-types/publish-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pool:
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
Expand Down
8 changes: 4 additions & 4 deletions build/azure-pipelines/sdl-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ stages:
outputFormat: "pre"
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down Expand Up @@ -139,7 +139,7 @@ stages:
toolMajorVersion: "V2"
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down Expand Up @@ -191,7 +191,7 @@ stages:
if [ -z "$CC" ] || [ -z "$CXX" ]; then
# Download clang based on chromium revision used by vscode
curl -s https://raw.githubusercontent.com/chromium/chromium/91.0.4472.164/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux
curl -s https://raw.githubusercontent.com/chromium/chromium/96.0.4664.110/tools/clang/scripts/update.py | python - --output-dir=$PWD/.build/CR_Clang --host-os=linux
# Download libcxx headers and objects from upstream electron releases
DEBUG=libcxx-fetcher \
VSCODE_LIBCXX_OBJECTS_DIR=$PWD/.build/libcxx-objects \
Expand All @@ -202,7 +202,7 @@ stages:
# Set compiler toolchain
export CC=$PWD/.build/CR_Clang/bin/clang
export CXX=$PWD/.build/CR_Clang/bin/clang++
export CXXFLAGS="-nostdinc++ -D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit"
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -isystem$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit"
export LDFLAGS="-stdlib=libc++ -fuse-ld=lld -flto=thin -fsplit-lto-unit -L$PWD/.build/libcxx-objects -lc++abi"
export VSCODE_REMOTE_CC=$(which gcc)
export VSCODE_REMOTE_CXX=$(which g++)
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/web/product-build-web.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/win32/product-build-win32.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
versionSpec: "16.x"

- task: UsePythonVersion@0
inputs:
Expand Down
18 changes: 18 additions & 0 deletions build/lib/layersChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ const CORE_TYPES = [
'trimLeft',
'trimRight',
'queueMicrotask',
'Array',
'Uint8Array',
'Uint16Array',
'Uint32Array',
'Int8Array',
'Int16Array',
'Int32Array',
'Float32Array',
'Float64Array',
'Uint8ClampedArray',
'BigUint64Array',
'BigInt64Array',
'btoa',
'atob',
'AbortSignal',
'MessageChannel',
'MessagePort'
];
Expand Down Expand Up @@ -145,6 +160,9 @@ const RULES = [
target: '**/vs/**/browser/**',
allowedTypes: CORE_TYPES,
disallowedTypes: NATIVE_TYPES,
allowedDefinitions: [
'@types/node/stream/consumers.d.ts' // node.js started to duplicate types from lib.dom.d.ts so we have to account for that
],
disallowedDefinitions: [
'@types/node' // no node.js
]
Expand Down
18 changes: 18 additions & 0 deletions build/lib/layersChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ const CORE_TYPES = [
'trimLeft',
'trimRight',
'queueMicrotask',
'Array',
'Uint8Array',
'Uint16Array',
'Uint32Array',
'Int8Array',
'Int16Array',
'Int32Array',
'Float32Array',
'Float64Array',
'Uint8ClampedArray',
'BigUint64Array',
'BigInt64Array',
'btoa',
'atob',
'AbortSignal',
'MessageChannel',
'MessagePort'
];
Expand Down Expand Up @@ -158,6 +173,9 @@ const RULES = [
target: '**/vs/**/browser/**',
allowedTypes: CORE_TYPES,
disallowedTypes: NATIVE_TYPES,
allowedDefinitions: [
'@types/node/stream/consumers.d.ts' // node.js started to duplicate types from lib.dom.d.ts so we have to account for that
],
disallowedDefinitions: [
'@types/node' // no node.js
]
Expand Down
1 change: 1 addition & 0 deletions build/npm/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ for (let dir of dirs) {
if (process.env['VSCODE_REMOTE_CC']) { env['CC'] = process.env['VSCODE_REMOTE_CC']; }
if (process.env['VSCODE_REMOTE_CXX']) { env['CXX'] = process.env['VSCODE_REMOTE_CXX']; }
if (process.env['CXXFLAGS']) { delete env['CXXFLAGS']; }
if (process.env['CFLAGS']) { delete env['CFLAGS']; }
if (process.env['LDFLAGS']) { delete env['LDFLAGS']; }
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; }

Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/minimist": "^1.2.1",
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^8.2.0",
"@types/node": "14.x",
"@types/node": "16.x",
"@types/p-limit": "^2.2.0",
"@types/plist": "^3.0.2",
"@types/pump": "^1.0.1",
Expand Down
Loading

0 comments on commit 32d40cf

Please sign in to comment.