mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
build: yolo some stuff
This commit is contained in:
6
.github/actions/build-electron/action.yml
vendored
6
.github/actions/build-electron/action.yml
vendored
@@ -8,7 +8,7 @@ inputs:
|
||||
description: 'Target platform'
|
||||
required: true
|
||||
artifact-platform:
|
||||
description: 'Artifact platform, should be linux, darwin or mas'
|
||||
description: 'Artifact platform, should be linux, windows, darwin or mas'
|
||||
required: true
|
||||
step-suffix:
|
||||
description: 'Suffix for build steps'
|
||||
@@ -71,7 +71,7 @@ runs:
|
||||
cd src
|
||||
e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||
if [ "${{ inputs.is-asan }}" != "true" ]; then
|
||||
target_os=${{ inputs.target-platform == 'linux' && 'linux' || 'mac'}}
|
||||
target_os=${{ inputs.target-platform == 'linux' && 'linux' || (inputs.target-platform == 'windows' && 'win' || 'mac') }}
|
||||
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
||||
target_os="${target_os}_mas"
|
||||
fi
|
||||
@@ -91,7 +91,7 @@ runs:
|
||||
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
||||
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||
|
||||
if [ "`uname`" = "Linux" ]; then
|
||||
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
||||
|
||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -146,7 +146,7 @@ jobs:
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
check-runs-on: electron-arc-windows-amd64-16core
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
test-runs-on: windows-latest
|
||||
target-platform: windows
|
||||
target-arch: x64
|
||||
|
||||
@@ -41,12 +41,15 @@ env:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
runs-on: ${{ inputs.test-runs-on }}
|
||||
container: ${{ fromJSON(inputs.test-container) }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
|
||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'windows' && fromJSON('["windows"]') || fromJSON('["linux"]')) }}
|
||||
shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1, 2]') || fromJSON('[1, 2, 3]') }}
|
||||
env:
|
||||
BUILD_TYPE: ${{ matrix.build-type }}
|
||||
@@ -155,13 +158,14 @@ jobs:
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
||||
DISPLAY: ':99.0'
|
||||
NPM_CONFIG_MSVS_VERSION: '2022'
|
||||
run: |
|
||||
cd src/electron
|
||||
# Get which tests are on this shard
|
||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 2 || 3 }})
|
||||
|
||||
# Run tests
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
if [ "${{ inputs.target-platform }}" != "linux" ]; then
|
||||
echo "About to start tests"
|
||||
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
||||
else
|
||||
|
||||
@@ -59,7 +59,7 @@ def skip_path(dep, dist_zip, target_cpu):
|
||||
and dep == "snapshot_blob.bin"
|
||||
)
|
||||
)
|
||||
if should_skip:
|
||||
if should_skip and os.environ.get('ELECTRON_DEBUG_ZIP_SKIP') == '1':
|
||||
print("Skipping {}".format(dep))
|
||||
return should_skip
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||
BUILD_TYPE="windows"
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
if [ -z "$MAS_BUILD" ]; then
|
||||
BUILD_TYPE="darwin"
|
||||
else
|
||||
@@ -46,23 +48,47 @@ cp_if_exist() {
|
||||
move_src_dirs_if_exist() {
|
||||
mkdir src_artifacts
|
||||
|
||||
for dir in \
|
||||
src/out/Default/gen/node_headers \
|
||||
src/out/Default/overlapped-checker \
|
||||
src/out/Default/ffmpeg \
|
||||
src/out/Default/hunspell_dictionaries \
|
||||
src/third_party/electron_node \
|
||||
src/third_party/nan \
|
||||
src/cross-arch-snapshots \
|
||||
src/third_party/llvm-build \
|
||||
src/build/linux \
|
||||
src/buildtools/mac \
|
||||
src/buildtools/third_party/libc++ \
|
||||
src/buildtools/third_party/libc++abi \
|
||||
src/third_party/libc++ \
|
||||
src/third_party/libc++abi \
|
||||
src/out/Default/obj/buildtools/third_party \
|
||||
src/v8/tools/builtins-pgo
|
||||
dirs=("src/out/Default/gen/node_headers" \
|
||||
"src/out/Default/overlapped-checker" \
|
||||
"src/out/Default/ffmpeg" \
|
||||
"src/out/Default/hunspell_dictionaries" \
|
||||
"src/third_party/electron_node" \
|
||||
"src/third_party/nan" \
|
||||
"src/cross-arch-snapshots" \
|
||||
"src/buildtools/mac" \
|
||||
"src/buildtools/third_party/libc++" \
|
||||
"src/buildtools/third_party/libc++abi" \
|
||||
"src/third_party/libc++" \
|
||||
"src/third_party/libc++abi" \
|
||||
"src/out/Default/obj/buildtools/third_party" \
|
||||
"src/v8/tools/builtins-pgo")
|
||||
|
||||
# Only do this for linux build type, this folder
|
||||
# exists for windows builds on linux hosts but we do
|
||||
# not need it
|
||||
if [ "$BUILD_TYPE" == "linux" ]; then
|
||||
dirs+=('src/build/linux')
|
||||
fi
|
||||
|
||||
# llvm-build is the host toolchain, for windows we need
|
||||
# a different toolchain so no point copying this one
|
||||
if [ "$BUILD_TYPE" != "windows" ]; then
|
||||
dirs+=('src/third_party/llvm-build')
|
||||
fi
|
||||
|
||||
# On windows we should clean up two symlinks that aren't
|
||||
# compatible with the windows test runner
|
||||
if [ "$BUILD_TYPE" == "windows" ]; then
|
||||
rm -f src/third_party/electron_node/tools/node_modules/eslint/node_modules/eslint
|
||||
rm -f src/third_party/electron_node/tools/node_modules/eslint/node_modules/.bin/eslint
|
||||
rm -f src/third_party/electron_node/out/tools/bin/python
|
||||
|
||||
# Also need to copy electron.lib to node.lib for native module testing purposes
|
||||
mkdir -p src/out/Default/gen/node_headers/Release
|
||||
cp src/out/Default/electron.lib src/out/Default/gen/node_headers/Release/node.lib
|
||||
fi
|
||||
|
||||
for dir in "${dirs[@]}"
|
||||
do
|
||||
if [ -d "$dir" ]; then
|
||||
mkdir -p src_artifacts/$(dirname $dir)
|
||||
|
||||
@@ -29,9 +29,9 @@ async function main () {
|
||||
const outDir = utils.getOutDir({ shouldLog: true });
|
||||
const nodeDir = path.resolve(BASE, 'out', outDir, 'gen', 'node_headers');
|
||||
const env = {
|
||||
npm_config_msvs_version: '2019',
|
||||
...process.env,
|
||||
npm_config_nodedir: nodeDir,
|
||||
npm_config_msvs_version: '2019',
|
||||
npm_config_arch: process.env.NPM_CONFIG_ARCH,
|
||||
npm_config_yes: 'true'
|
||||
};
|
||||
|
||||
@@ -187,9 +187,9 @@ async function runMainProcessElectronTests () {
|
||||
|
||||
async function installSpecModules (dir) {
|
||||
const env = {
|
||||
npm_config_msvs_version: '2019',
|
||||
...process.env,
|
||||
CXXFLAGS: process.env.CXXFLAGS,
|
||||
npm_config_msvs_version: '2019',
|
||||
npm_config_yes: 'true'
|
||||
};
|
||||
if (args.electronVersion) {
|
||||
|
||||
@@ -125,7 +125,7 @@ app.whenReady().then(async () => {
|
||||
const validTestPaths = argv.files && argv.files.map(file =>
|
||||
path.isAbsolute(file)
|
||||
? path.relative(baseElectronDir, file)
|
||||
: file);
|
||||
: path.normalize(file));
|
||||
const filter = (file) => {
|
||||
if (!/-spec\.[tj]s$/.test(file)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user