diff --git a/evm-config.schema.json b/evm-config.schema.json index 3f4cefd6..ede2bebc 100644 --- a/evm-config.schema.json +++ b/evm-config.schema.json @@ -26,6 +26,7 @@ "minLength": 1 }, "goma": { + "$comment": "Deprecated, use reclient instead", "description": "Goma mode to use", "type": "string", "enum": [ diff --git a/example-configs/evm.base.yml b/example-configs/evm.base.yml index 2b649549..696f823e 100644 --- a/example-configs/evm.base.yml +++ b/example-configs/evm.base.yml @@ -1,4 +1,5 @@ root: /path/to/your/developer/folder +reclient: remote_exec remotes: electron: # SSH or HTTPS url @@ -7,8 +8,8 @@ remotes: origin: git@github.com:electron/electron.git gen: args: - # path to goma for faster builds (https://notgoma.com) - - import("/Users/user_name/.electron_build_tools/third_party/goma.gn") + # Enable reclient + - use_remoteexec = true out: Testing env: GIT_CACHE_PATH: /Users/user_name/.git_cache diff --git a/example-configs/evm.chromium.yml b/example-configs/evm.chromium.yml index b45e71cf..5c9ace7c 100644 --- a/example-configs/evm.chromium.yml +++ b/example-configs/evm.chromium.yml @@ -1,9 +1,9 @@ root: /path/to/chromium/ +reclient: remote_exec defaultTarget: chrome gen: args: - # path to goma for faster builds (https://notgoma.com) - - import("/Users/user_name/.electron_build_tools/third_party/goma.gn") + - use_remoteexec = true - is_debug = false out: Default env: diff --git a/src/e-init.js b/src/e-init.js index 1d7a012d..7834c87a 100644 --- a/src/e-init.js +++ b/src/e-init.js @@ -10,7 +10,7 @@ const { URI } = require('vscode-uri'); const evmConfig = require('./evm-config'); const { color, fatal } = require('./utils/logging'); const { resolvePath, ensureDir } = require('./utils/paths'); -const goma = require('./utils/goma'); +const reclient = require('./utils/reclient'); const depot = require('./utils/depot-tools'); const { checkGlobalGitConfig } = require('./utils/git'); @@ -27,8 +27,8 @@ function createConfig(options) { // build the `gn gen` args const gn_args = [`import("//electron/build/args/${options.import}.gn")`]; - if (options.goma !== 'none') { - gn_args.push(`import("${goma.gnFilePath}")`); + if (options.reclient !== 'none') { + gn_args.push(`use_remoteexec = true`); } if (options.asan) gn_args.push('is_asan=true'); @@ -51,7 +51,8 @@ function createConfig(options) { return { $schema: URI.file(path.resolve(__dirname, '..', 'evm-config.schema.json')).toString(), - goma: options.goma, + goma: 'none', + reclient: options.reclient, root, remotes: { electron, @@ -65,11 +66,6 @@ function createConfig(options) { GIT_CACHE_PATH: process.env.GIT_CACHE_PATH ? resolvePath(process.env.GIT_CACHE_PATH) : path.resolve(homedir, '.git_cache'), - GOMA_CACHE_DIR: path.resolve(homedir, '.goma_cache'), - GOMA_DEPS_CACHE_FILE: 'deps-cache', - GOMA_COMPILER_INFO_CACHE_FILE: 'compiler-info-cache', - GOMA_LOCAL_OUTPUT_CACHE_DIR: path.resolve(homedir, '.goma_output_cache'), - ...(options.goma !== 'cluster' && { GOMACTL_SKIP_AUTH: 'true' }), }, }; } @@ -133,11 +129,11 @@ program .option('--bootstrap', 'Run `e sync` and `e build` after creating the build config.') .addOption( new Option( - '--goma ', - `Use Electron's custom deployment of Goma. The "cluster" mode is only available to maintainers`, + '--reclient ', + `Use Electron's RBE backend. The "remote_exec" mode will fall back to cache-only depending on the auth provided`, ) - .choices(['cache-only', 'cluster', 'none']) - .default('cache-only'), + .choices(['remote_exec', 'none']) + .default('remote_exec'), ) .option( '--use-https', @@ -190,9 +186,9 @@ program childProcess.execFileSync(process.execPath, [e, 'sync', '-v'], opts); } - // maybe authenticate with Goma - if (config.goma === 'cluster') { - goma.auth(config); + // maybe authenticate with RBE + if (process.env.NODE_ENV !== 'test' && config.reclient === 'remote_exec') { + childProcess.execFileSync(process.execPath, [e, 'd', 'rbe', 'login'], opts); } // (maybe) build Electron diff --git a/tests/e-init-spec.js b/tests/e-init-spec.js index 539b714c..311275ee 100644 --- a/tests/e-init-spec.js +++ b/tests/e-init-spec.js @@ -57,7 +57,7 @@ describe('e-init', () => { const config = require(configPath); expect(config).toHaveProperty('$schema'); - expect(config.goma).toStrictEqual('cache-only'); + expect(config.reclient).toStrictEqual('remote_exec'); expect(config.remotes).toHaveProperty('electron'); expect(config.remotes).not.toHaveProperty('node'); diff --git a/tests/sandbox.js b/tests/sandbox.js index 2e9fcb9e..f96bffaa 100644 --- a/tests/sandbox.js +++ b/tests/sandbox.js @@ -231,6 +231,7 @@ function createSandbox() { const execOptions = { encoding: 'utf8', env: { + NODE_ENV: process.env.NODE_ENV, // have `e` use our test sandbox's build-tools config dir EVM_CONFIG: evm_config_dir,