From 004abe3ce8f7a4315b2fb2a6f989a6f8da87be58 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 11 Jul 2018 14:01:15 -0400 Subject: [PATCH 1/3] build: [ci] add GN linux CI build --- .circleci/config.yml | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6a7f7175c5..22be9f33cff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -313,6 +313,84 @@ jobs: xcode: "8.3.3" <<: *build-steps + electron-linux-gn: + environment: + DISPLAY: ':99.0' + docker: + - image: electronbuilds/electron:0.0.8 + resource_class: 2xlarge + steps: + - run: + name: Setup depot tools + command: | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git + echo 'export PATH=$PATH:`pwd`/depot_tools' >> $BASH_ENV + - checkout: + path: src/electron + - restore_cache: + paths: + - ~/.gclient-cache + keys: + - v1-gclient-cache-{{ checksum "src/electron/DEPS" }} + - v1-gclient-cache- + - run: + name: Gclient sync + command: | + echo $PATH + gclient config \ + --name "src/electron" \ + --unmanaged \ + --cache-dir "$HOME/.gclient-cache" \ + "$CIRCLE_REPOSITORY_URL" + + gclient sync --with_branch_heads --with_tags + - save_cache: + paths: + - ~/.gclient-cache + key: v1-gclient-cache-{{ checksum "src/electron/DEPS" }} + - run: + name: GN gen + command: | + cd src + echo 'export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools' >> $BASH_ENV + source $BASH_ENV + mkdir out/Default + cat > out/Default/args.gn <<-EOF + root_extra_deps = [ "//electron" ] + is_electron_build = true + is_component_build = true + use_jumbo_build = true + v8_promise_internal_field_count = 1 + v8_typed_array_max_size_in_heap = 0 + EOF + gn gen out/Default + - run: + name: Ninja build + command: | + cd src + ninja -C out/Default electron:electron_app + - run: + name: Setup for headless testing + command: | + sh -e /etc/init.d/xvfb start + - run: + name: Test + environment: + MOCHA_REPORTER: mocha-junit-reporter + MOCHA_FILE: junit/test-results.xml + ELECTRON_DISABLE_SECURITY_WARNINGS: 1 + command: | + cd src + ninja -C out/Default electron/build/node:headers + export npm_config_nodedir="$PWD/out/Default/gen/node_headers" + (cd electron/spec && npm install) + ./out/Default/electron electron/spec --ci --enable-logging + - store_test_results: + path: src/junit + - store_artifacts: + path: src/junit + - <<: *notify-slack-failure + - <<: *notify-slack-success workflows: version: 2 @@ -340,6 +418,9 @@ workflows: build-mas-x64: jobs: - electron-mas-x64 + build-gn-linux: + jobs: + - electron-linux-gn nightly-release-test: triggers: From 856483fe619b8d902914aae44581166deac15dd0 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Fri, 20 Jul 2018 16:29:57 -0400 Subject: [PATCH 2/3] Add sccache Also removed unneeded slack notifcations --- .circleci/config.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 22be9f33cff..116a1e5543e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -313,7 +313,7 @@ jobs: xcode: "8.3.3" <<: *build-steps - electron-linux-gn: + electron-linux-gn-fyi: environment: DISPLAY: ':99.0' docker: @@ -336,7 +336,6 @@ jobs: - run: name: Gclient sync command: | - echo $PATH gclient config \ --name "src/electron" \ --unmanaged \ @@ -352,10 +351,12 @@ jobs: name: GN gen command: | cd src + echo 'export SCCACHE_WRAPPER="'`pwd`'/libchromiumcontent/script/sccache"' >> $BASH_ENV echo 'export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools' >> $BASH_ENV source $BASH_ENV mkdir out/Default cat > out/Default/args.gn <<-EOF + cc_wrapper = "$SCCACHE_WRAPPER" root_extra_deps = [ "//electron" ] is_electron_build = true is_component_build = true @@ -369,6 +370,10 @@ jobs: command: | cd src ninja -C out/Default electron:electron_app + - run: + name: Check sccache stats after build + command: $SCCACHE_WRAPPER -s + - run: name: Setup for headless testing command: | @@ -389,8 +394,6 @@ jobs: path: src/junit - store_artifacts: path: src/junit - - <<: *notify-slack-failure - - <<: *notify-slack-success workflows: version: 2 @@ -420,7 +423,7 @@ workflows: - electron-mas-x64 build-gn-linux: jobs: - - electron-linux-gn + - electron-linux-gn-fyi nightly-release-test: triggers: From 6b3ee233ff67fd3013fc9d891164cf052c9142a2 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Fri, 20 Jul 2018 17:07:31 -0400 Subject: [PATCH 3/3] Use actual binary instead of python wrapper --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 116a1e5543e..cbc2faea763 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -351,7 +351,7 @@ jobs: name: GN gen command: | cd src - echo 'export SCCACHE_WRAPPER="'`pwd`'/libchromiumcontent/script/sccache"' >> $BASH_ENV + echo 'export SCCACHE_WRAPPER="'`pwd`'/libchromiumcontent/tools/sccache/aad2120/linux/sccache"' >> $BASH_ENV echo 'export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools' >> $BASH_ENV source $BASH_ENV mkdir out/Default