From ca0299628a0a0d0fbd6af2ba8ea91c05e9c0b1c9 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Tue, 2 Apr 2019 09:03:31 -0400 Subject: [PATCH 1/6] Insert linter violation (for testing purposes) --- src/main-process/atom-application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index 899b7bfc3..d6496e2c4 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -1,4 +1,4 @@ -const AtomWindow = require('./atom-window') +const AtomWindow = require('./atom-window'); const ApplicationMenu = require('./application-menu') const AtomProtocolHandler = require('./atom-protocol-handler') const AutoUpdateManager = require('./auto-update-manager') From 5f52a8e0b0e92979909ecf401421dcf4b6978506 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Mon, 1 Apr 2019 16:37:20 -0400 Subject: [PATCH 2/6] Lint earlier in the build process --- .travis.yml | 3 ++- script/build | 10 +++++++--- script/vsts/platforms/linux.yml | 11 +++++++---- script/vsts/platforms/macos.yml | 13 ++++++++----- script/vsts/platforms/windows.yml | 20 ++++++++++++-------- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0232b652..52879559c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,10 +28,11 @@ install: - nvm install $NODE_VERSION - nvm use --delete-prefix $NODE_VERSION - npm install --global npm@6.2.0 - - script/build --create-debian-package --create-rpm-package --compress-artifacts + - script/bootstrap script: - script/lint + - script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts - script/test cache: diff --git a/script/build b/script/build index eb595c13c..c70c27754 100755 --- a/script/build +++ b/script/build @@ -2,9 +2,13 @@ 'use strict' -// Run bootstrap first to ensure all the dependencies used later in this script -// are installed. -require('./bootstrap') +if (process.argv.includes('--no-bootstrap')) { + console.log('Skipping bootstrap') +} else { + // Bootstrap first to ensure all the dependencies used later in this script + // are installed. + require('./bootstrap') +} // Needed so we can require src/module-cache.coffee during generateModuleCache require('coffee-script/register') diff --git a/script/vsts/platforms/linux.yml b/script/vsts/platforms/linux.yml index 66fe73856..0839f89a5 100644 --- a/script/vsts/platforms/linux.yml +++ b/script/vsts/platforms/linux.yml @@ -12,15 +12,18 @@ jobs: container: atom-linux-ci steps: - - script: script/build --create-debian-package --create-rpm-package --compress-artifacts + - script: script/bootstrap + displayName: Bootstrap build environment + + - script: script/lint + displayName: Run linter + + - script: script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts env: GITHUB_TOKEN: $(GITHUB_TOKEN) ATOM_RELEASE_VERSION: $(ReleaseVersion) displayName: Build Atom - - script: script/lint - displayName: Run linter - - script: script/test env: CI: true diff --git a/script/vsts/platforms/macos.yml b/script/vsts/platforms/macos.yml index f613bf15a..8dd72f6f2 100644 --- a/script/vsts/platforms/macos.yml +++ b/script/vsts/platforms/macos.yml @@ -19,11 +19,17 @@ jobs: - script: npm install --global npm@6.2.0 displayName: Update npm + - script: script/bootstrap + displayName: Bootstrap build environment + + - script: script/lint + displayName: Run linter + - script: | if [ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]; then - script/build --code-sign --compress-artifacts + script/build --no-bootstrap --code-sign --compress-artifacts else - script/build --compress-artifacts + script/build --no-bootstrap --compress-artifacts fi displayName: Build Atom env: @@ -36,9 +42,6 @@ jobs: ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN) ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD) - - script: script/lint - displayName: Run linter - - script: | osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver caffeinate -s script/test # Run with caffeinate to prevent screen saver diff --git a/script/vsts/platforms/windows.yml b/script/vsts/platforms/windows.yml index af8c8dc64..af7ef8cc4 100644 --- a/script/vsts/platforms/windows.yml +++ b/script/vsts/platforms/windows.yml @@ -36,19 +36,28 @@ jobs: npm install displayName: Install Windows build dependencies + - script: | + node script\vsts\windows-run.js script\bootstrap.cmd + displayName: Bootstrap build environment + + - script: node script\vsts\windows-run.js script\lint.cmd + env: + BUILD_ARCH: $(buildArch) + displayName: Run linter + - script: | IF NOT EXIST C:\tmp MKDIR C:\tmp SET SQUIRREL_TEMP=C:\tmp IF [%IS_RELEASE_BRANCH%]==[true] ( ECHO Creating production artifacts for release branch %BUILD_SOURCEBRANCHNAME% - node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts --create-windows-installer + node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts --create-windows-installer ) ELSE ( IF [%IS_SIGNED_ZIP_BRANCH%]==[true] ( ECHO Creating signed CI artifacts for branch %BUILD_SOURCEBRANCHNAME% - node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts + node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts ) ELSE ( ECHO Pull request build, no code signing will be performed - node script\vsts\windows-run.js script\build.cmd --compress-artifacts + node script\vsts\windows-run.js script\build.cmd --no-bootstrap --compress-artifacts ) ) env: @@ -61,11 +70,6 @@ jobs: IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch) displayName: Build Atom - - script: node script\vsts\windows-run.js script\lint.cmd - env: - BUILD_ARCH: $(buildArch) - displayName: Run linter - - script: node script\vsts\windows-run.js script\test.cmd env: CI: true From 8c0455189e6d33416d9edfaf45e0414488402011 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Tue, 2 Apr 2019 09:25:15 -0400 Subject: [PATCH 3/6] Teach linting to fail fast on Travis CI --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52879559c..223ecb16c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,10 +30,10 @@ install: - npm install --global npm@6.2.0 - script/bootstrap -script: - - script/lint - - script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts - - script/test +script: > + script/lint && + script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts && + script/test cache: directories: From 6a88937739c3d5926add85ed1cfdc29a919c9552 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Tue, 2 Apr 2019 12:46:35 -0400 Subject: [PATCH 4/6] Revert "Insert linter violation (for testing purposes)" This reverts commit 2717815762823d2d9bc75d2a9e2712845739c587. --- src/main-process/atom-application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index d6496e2c4..899b7bfc3 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -1,4 +1,4 @@ -const AtomWindow = require('./atom-window'); +const AtomWindow = require('./atom-window') const ApplicationMenu = require('./application-menu') const AtomProtocolHandler = require('./atom-protocol-handler') const AutoUpdateManager = require('./auto-update-manager') From 166658f588fffc901a07b053e778dd8b8d872df9 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Mon, 1 Apr 2019 16:37:20 -0400 Subject: [PATCH 5/6] Add back bootstrapping to script/build on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hopefully this will resolve the error we're seeing here: https://github.visualstudio.com/Atom/_build/results?buildId=37021&view=logs&jobId=97a617bf-bcbd-5dfa-bba2-cfba2747b693&taskId=1e1369e9-1c56-59b0-830c-f1606a680c8a&lineStart=13&lineEnd=19&colStart=1&colEnd=1 🤞 --- script/vsts/platforms/windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/vsts/platforms/windows.yml b/script/vsts/platforms/windows.yml index af7ef8cc4..36ffea3c3 100644 --- a/script/vsts/platforms/windows.yml +++ b/script/vsts/platforms/windows.yml @@ -50,14 +50,14 @@ jobs: SET SQUIRREL_TEMP=C:\tmp IF [%IS_RELEASE_BRANCH%]==[true] ( ECHO Creating production artifacts for release branch %BUILD_SOURCEBRANCHNAME% - node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts --create-windows-installer + node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts --create-windows-installer ) ELSE ( IF [%IS_SIGNED_ZIP_BRANCH%]==[true] ( ECHO Creating signed CI artifacts for branch %BUILD_SOURCEBRANCHNAME% - node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts + node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts ) ELSE ( ECHO Pull request build, no code signing will be performed - node script\vsts\windows-run.js script\build.cmd --no-bootstrap --compress-artifacts + node script\vsts\windows-run.js script\build.cmd --compress-artifacts ) ) env: From 9e03795c207bb0277c3b4b300faebb6e4766e126 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Wed, 3 Apr 2019 13:11:24 -0400 Subject: [PATCH 6/6] Provide the BUILD_ARCH env var for bootstrapping Windows env on VSTS `script/vsts/windows-run.js` checks the BUILD_ARCH env var, so let's make sure it's populated. --- script/vsts/platforms/windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/vsts/platforms/windows.yml b/script/vsts/platforms/windows.yml index 36ffea3c3..e84592788 100644 --- a/script/vsts/platforms/windows.yml +++ b/script/vsts/platforms/windows.yml @@ -38,6 +38,8 @@ jobs: - script: | node script\vsts\windows-run.js script\bootstrap.cmd + env: + BUILD_ARCH: $(buildArch) displayName: Bootstrap build environment - script: node script\vsts\windows-run.js script\lint.cmd