Skip to content

Commit a2512fc

Browse files
committed
Merge branch 'master' into upstream_master
2 parents 0628ba5 + d7bc814 commit a2512fc

29 files changed

+1229
-935
lines changed

.github/pull.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: "1"
2+
rules: # Array of rules
3+
- base: upstream_master # Required. Target branch
4+
upstream: atom:master # Required. Must be in the same fork network.
5+
mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
6+
mergeUnstable: true # Optional, merge pull request even when the mergeable_state is not clean. Default: false
7+
label: ":arrow_heading_down: pull upstream" # Optional

apm/package-lock.json

Lines changed: 474 additions & 548 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"url": "https://github.com/atom/atom.git"
77
},
88
"dependencies": {
9-
"atom-package-manager": "2.5.2"
9+
"atom-package-manager": "npm:@atom-ide-community/atom-package-manager@2.5.2-atomic.3.1"
1010
}
1111
}

script/bootstrap

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const childProcess = require('child_process')
88
const cleanDependencies = require('./lib/clean-dependencies')
99
const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path')
1010
const dependenciesFingerprint = require('./lib/dependencies-fingerprint')
11-
const installApm = require('./lib/install-apm')
12-
const runApmInstall = require('./lib/run-apm-install')
13-
const installScriptDependencies = require('./lib/install-script-dependencies')
11+
const installScriptRunnerDependencies = require('./lib/install-script-runner-dependencies')
1412
const verifyMachineRequirements = require('./lib/verify-machine-requirements')
1513

1614
process.on('unhandledRejection', function (e) {
@@ -34,13 +32,26 @@ if (dependenciesFingerprint.isOutdated()) {
3432

3533
if (process.platform === 'win32') deleteMsbuildFromPath()
3634

37-
installScriptDependencies(ci)
38-
installApm(ci)
39-
childProcess.execFileSync(
40-
CONFIG.getApmBinPath(),
41-
['--version'],
42-
{stdio: 'inherit'}
43-
)
44-
runApmInstall(CONFIG.repositoryRootPath, ci)
35+
async function bootstrap() {
4536

46-
dependenciesFingerprint.write()
37+
installScriptRunnerDependencies()
38+
39+
const { spawn, Thread, Worker } = require(`${CONFIG.scriptRunnerModulesPath}/threads`)
40+
41+
const installScriptDependencies = await spawn(new Worker('./lib/install-script-dependencies'))
42+
const installScriptDependenciesPromise = installScriptDependencies(ci)
43+
44+
const installApm = await spawn(new Worker('./lib/install-apm'))
45+
await installApm(ci);
46+
await Thread.terminate(installApm)
47+
48+
const runApmInstall = require('./lib/run-apm-install')
49+
runApmInstall(CONFIG.repositoryRootPath, ci)
50+
51+
await installScriptDependenciesPromise;
52+
await Thread.terminate(installScriptDependencies)
53+
54+
dependenciesFingerprint.write()
55+
}
56+
57+
bootstrap().then(() => {process.exit(0)}).catch((e) => {throw e;})

script/build

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
'use strict'
44

5+
const CONFIG = require('./config')
6+
57
if (process.argv.includes('--no-bootstrap')) {
68
console.log('Skipping bootstrap')
79
} else {
810
// Bootstrap first to ensure all the dependencies used later in this script
911
// are installed.
10-
require('./bootstrap')
12+
const path = require('path')
13+
const childProcess = require('child_process')
14+
childProcess.execFileSync(process.execPath, [path.join(CONFIG.scriptRootPath, 'bootstrap')], { env: process.env, cwd: CONFIG.repositoryRootPath, stdio: 'inherit' });
1115
}
1216

1317
// Required to load CS files in this build script, such as those in `donna`
@@ -63,7 +67,6 @@ process.on('unhandledRejection', function (e) {
6367
process.exit(1)
6468
})
6569

66-
const CONFIG = require('./config')
6770
process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion
6871

6972
let binariesPromise = Promise.resolve()

script/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const spawnSync = require('./lib/spawn-sync');
1010
const repositoryRootPath = path.resolve(__dirname, '..');
1111
const apmRootPath = path.join(repositoryRootPath, 'apm');
1212
const scriptRootPath = path.join(repositoryRootPath, 'script');
13+
const scriptRunnerRootPath = path.join(scriptRootPath, 'script-runner');
14+
const scriptRunnerModulesPath = path.join(scriptRunnerRootPath, 'node_modules');
1315
const buildOutputPath = path.join(repositoryRootPath, 'out');
1416
const docsOutputPath = path.join(repositoryRootPath, 'docs', 'output');
1517
const intermediateAppPath = path.join(buildOutputPath, 'app');
@@ -40,6 +42,8 @@ module.exports = {
4042
repositoryRootPath,
4143
apmRootPath,
4244
scriptRootPath,
45+
scriptRunnerRootPath,
46+
scriptRunnerModulesPath,
4347
buildOutputPath,
4448
docsOutputPath,
4549
intermediateAppPath,
@@ -121,3 +125,5 @@ function getNpmBinPath(external = false) {
121125
? localNpmBinPath
122126
: npmBinName;
123127
}
128+
129+
process.env.JOBS = 'max'; // parallel build in node-gyp

script/lib/install-apm.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ const childProcess = require('child_process');
44

55
const CONFIG = require('../config');
66

7-
module.exports = function(ci) {
7+
function installApm(ci) {
88
console.log('Installing apm');
99
// npm ci leaves apm with a bunch of unmet dependencies
1010
childProcess.execFileSync(
1111
CONFIG.getNpmBinPath(),
1212
['--global-style', '--loglevel=error', 'install'],
1313
{ env: process.env, cwd: CONFIG.apmRootPath }
1414
);
15-
};
15+
childProcess.execFileSync(CONFIG.getApmBinPath(), ['--version'], {
16+
stdio: 'inherit'
17+
});
18+
}
19+
20+
const { expose } = require(`${CONFIG.scriptRunnerModulesPath}/threads/worker`);
21+
expose(installApm);
22+
module.exports = installApm;

script/lib/install-script-dependencies.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ const CONFIG = require('../config');
66

77
process.env.ELECTRON_CUSTOM_VERSION = CONFIG.appMetadata.electronVersion;
88

9-
module.exports = function(ci) {
9+
function installScriptDependencies(ci) {
1010
console.log('Installing script dependencies');
1111
childProcess.execFileSync(
1212
CONFIG.getNpmBinPath(ci),
1313
['--loglevel=error', ci ? 'ci' : 'install'],
1414
{ env: process.env, cwd: CONFIG.scriptRootPath }
1515
);
16-
};
16+
}
17+
18+
const { expose } = require(`${CONFIG.scriptRunnerModulesPath}/threads/worker`);
19+
expose(installScriptDependencies);
20+
module.exports = installScriptDependencies;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
const childProcess = require('child_process');
4+
5+
const CONFIG = require('../config');
6+
7+
process.env.ELECTRON_CUSTOM_VERSION = CONFIG.appMetadata.electronVersion;
8+
9+
function installScriptRunnerDependencies(ci) {
10+
console.log('Installing script runner dependencies');
11+
childProcess.execFileSync(
12+
CONFIG.getNpmBinPath(ci),
13+
['--loglevel=error', ci ? 'ci' : 'install'],
14+
{ env: process.env, cwd: CONFIG.scriptRunnerRootPath }
15+
);
16+
}
17+
18+
module.exports = installScriptRunnerDependencies;

0 commit comments

Comments
 (0)