build-tools icon indicating copy to clipboard operation
build-tools copied to clipboard

Any documentation for use of (or disabling of) reclient?

Open alexciarlillo opened this issue 1 year ago • 23 comments

It's been a few months since I did an electron build and I just pulled down the latest build-tools this evening. I am now getting an authentication error related to RBE. According to this it seems like even Cache-Only access is limited to Electron maintainers? If this is not actually the case I would love to know how to properly configure Cache-Only access, or otherwise how to correctly disable use of reclient.

Thanks

alexciarlillo avatar Jan 17 '24 00:01 alexciarlillo

So I was able disable reclient by setting "reclient": "none" in my config but I'm still a little confused on the issue of if Cache-Only access should be working or not. What is the recommended configuration for non-maintainers?

alexciarlillo avatar Jan 17 '24 14:01 alexciarlillo

@alexciarlillo it's only within the last few weeks been enabled upstream, and we've only just gotten our deployment rolled out to maintainers courtesy of @MarshallOfSound. We'll let you know when it's more available for external contributrs but for now you should continue to use the goma cache. reclient usage also defaults to none as of https://github.com/electron/build-tools/commit/cc4f6c3dc8a107a827509b957e10e83ccf8c35ec - you can run e sanitize-config to make this permanent.

codebytere avatar Jan 17 '24 15:01 codebytere

Thanks I may be reading this incorrectly but it looks as of #537 merged yesterday, specifically this change it may no longer be defaulting to none? Unfortunately I cannot remember the exact steps - if I had init'd a new config or sanitized an existing one, but I definitely hit this without any manual opt-in to use reclient.

alexciarlillo avatar Jan 17 '24 15:01 alexciarlillo

I'm also looking for "What is the recommended configuration for non-maintainers?".

Running e init --fork nikitakot/electron develop was hanging for me on reclient auth request, even after I entered credentials in the browser (I don't have access). Running e init --fork nikitakot/electron --reclient none develop did work, but it produces the following config with goma disabled:

{
  "$schema": "file:///c%3A/Users/Administrator/.electron_build_tools/evm-config.schema.json",
  "goma": "none",
  "reclient": "none",
  "root": "C:\\Users\\Administrator\\.electron_build_tools\\electron",
  "remotes": {
    "electron": {
      "origin": "[email protected]:electron/electron.git",
      "fork": "[email protected]:nikitakot/electron.git"
    }
  },
  "gen": {
    "args": [
      "import(\"//electron/build/args/testing.gn\")"
    ],
    "out": "Testing"
  },
  "env": {
    "CHROMIUM_BUILDTOOLS_PATH": "C:\\Users\\Administrator\\.electron_build_tools\\electron\\src\\buildtools",
    "GIT_CACHE_PATH": "C:\\Users\\Administrator\\.git_cache"
  }
}

nikitakot avatar Jan 18 '24 09:01 nikitakot

@MarshallOfSound what are your thoughts here?

codebytere avatar Jan 18 '24 11:01 codebytere

So I was able disable reclient by setting "reclient": "none"

@alexciarlillo Hi there, sorry if this is a dumb question but where exactly did you change this config? I am a newbie to electron development and whenever I run e build, I see the following:

Authentication Status: Not Authenticated

ERROR You do not have valid auth for Reclient, please run "e d rbe login"

I am just trying to get a local build working, not even sure what reclient is.

SheikhSajid avatar Jan 20 '24 08:01 SheikhSajid

@SheikhSajid configs are in ~/.electron_build_tools/configs

nikitakot avatar Jan 22 '24 09:01 nikitakot

It's supposed to work for external users as well, in cache-only mode.

Can someone provide details on what happens if you run the suggested e d rbe login? Are there any errors?

dsanders11 avatar Jan 23 '24 04:01 dsanders11

@dsanders11 I don't get an "exception", but something akin to a 403 Forbidden after I login with my GitHub account: grafik grafik

BurningEnlightenment avatar Jan 23 '24 08:01 BurningEnlightenment

@dsanders11 I don't get an "exception", but something akin to a 403 Forbidden after I login with my GitHub account: grafik grafik

same experience

nikitakot avatar Jan 23 '24 08:01 nikitakot

@dsanders11 I don't get an "exception", but something akin to a 403 Forbidden after I login with my GitHub account: grafik grafik

This is what I am getting as well

SheikhSajid avatar Jan 25 '24 01:01 SheikhSajid

@dsanders11

any updates? should/can non maintainers continue to use goma? during the recent builds the cache-hit dropped significantly

or switch to reclient is preferred? if reclient is preferred is there a way to authenticate in scripting environment without opening a browser window? thanks.

nikitakot avatar Feb 08 '24 15:02 nikitakot

Hi all - we think this may be resolved now, can you try authenticating again? Non-maintainers should get cache-only access.

dsanders11 avatar Feb 14 '24 23:02 dsanders11

@dsanders11 it seems to work fine now.

BurningEnlightenment avatar Feb 15 '24 10:02 BurningEnlightenment

@BurningEnlightenment were you able to build? the rbe login indeed works, but build fails for me with

Running "C:\Users\Administrator\.electron_build_tools\third_party\depot_tools\gn.bat gen out/Release --args=import("//electron/build/args/release.gn") use_remoteexec = true target_cpu="x86"" in C:\Users\Administrator\electron-reclient\src

  reclient config file "../../buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_windows.cfg" doesn't exist, you may need to set
  "download_remoteexec_cfg" in .gclient like
  `\``
  solutions = [
    {
      "name"        : "src",
      # ...
      "custom_vars" : {
        "download_remoteexec_cfg": True,
      },
    },
  ]
  `\``
  and re-run `gclient sync`.

  Or you may not set appropriate `rbe_cfg_dir` value in args.gn.

  See
  https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#use-reclient
  for more details.

ERROR at //build/toolchain/rbe.gni:58:3: Script returned non-zero exit code.
  exec_script(rebase_path("//build/toolchain/check_rewrapper_cfg.py"),
  ^----------
Current dir: C:/Users/Administrator/electron-reclient/src/out/Release/
Command: C:/Users/Administrator/.electron_build_tools/third_party/depot_tools/bootstrap-2@3_11_6_chromium_30_bin/python3/bin/python3.exe C:/Users/Administrator/electron-reclient/src/build/toolchain/check_rewrapper_cfg.py ../../buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_windows.cfg
Returned 1.
See //build/config/BUILDCONFIG.gn:676:1: whence it was imported.
import("//build/toolchain/rbe.gni")
^---------------------------------
ERROR Error: Command failed: C:\Users\Administrator\.electron_build_tools\third_party\depot_tools\gn.bat gen out/Release --args=import("//electron/build/args/release.gn") use_remoteexec = true target_cpu="x86"
    at checkExecSyncError (node:child_process:890:11)
    at Object.execFileSync (node:child_process:926:15)
    at Object.depotExecFileSync [as execFileSync] (C:\Users\Administrator\.electron_build_tools\src\utils\depot-tools.js:144:23)
    at runGNGen (C:\Users\Administrator\.electron_build_tools\src\e-build.js:21:9)
    at ensureGNGen (C:\Users\Administrator\.electron_build_tools\src\e-build.js:26:41)
    at runNinja (C:\Users\Administrator\.electron_build_tools\src\e-build.js:61:3)
    at Command.<anonymous> (C:\Users\Administrator\.electron_build_tools\src\e-build.js:139:9)
    at Command.listener [as _actionHandler] (C:\Users\Administrator\.electron_build_tools\node_modules\commander\lib\command.js:480:17)
    at C:\Users\Administrator\.electron_build_tools\node_modules\commander\lib\command.js:1234:65
node:internal/errors:865
  const err = new Error(message);
              ^

Error: Command failed: e build electron:dist
    at __node_internal_genericNodeError (node:internal/errors:865:15)
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at build (c:\Users\Administrator\code\electron-build-tools\src\shared\build_tools.ts:88:6)
    at <anonymous> (c:\Users\Administrator\code\electron-build-tools\src\build-electron.ts:45:1)
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 16164,
  stdout: null,
  stderr: null
}

Node.js v18.19.0

nikitakot avatar Feb 15 '24 19:02 nikitakot

@nikitakot I've bootstrapped a new configuration as I wanted to move the directory somewhere else anyways. I didn't encounter any problems (though the toolchain download progressed very weirdly).

BurningEnlightenment avatar Feb 15 '24 19:02 BurningEnlightenment

@nikitakot, an e sync might clear that up.

dsanders11 avatar Feb 15 '24 19:02 dsanders11

@dsanders11 I've initialized a new config, tried e sync and e sync -f, no difference, it still fails with the error above. Trying to build x86 Windows v28.2.3.

nikitakot avatar Feb 15 '24 19:02 nikitakot

FTR I built the current main branch for x64 Windows.

BurningEnlightenment avatar Feb 15 '24 19:02 BurningEnlightenment

@nikitakot, x86 Windows is not a supported build platform. You can build x86 binaries with x64 Windows, but you can't build on x86 Windows. There's no upstream support in Chromium, so it's probably failing to find some needed executables.

dsanders11 avatar Feb 15 '24 19:02 dsanders11

@dsanders11 Yes sorry I meant that I'm building Windows v28.2.3 target cpu x86, my machine is x64. With --reclient none it builds fine and it used to work great with goma.

nikitakot avatar Feb 15 '24 20:02 nikitakot

@dsanders11 maybe it is worth mentioning that I was trying to build 28.2.3 "upstream" tag which I "copied" into my private fork? this is what i mean:

e init // ...some args
e sync
cd ... // to electron src folder
git checkout tags/v28.2.3 -b v28.2.3-my-branch
git push --set-upstream fork v28.2.3-my-branch
e sync
e build // doesn't work, reclient fails

Can it be the issue? Does reclient expect some specific git history or a public repo? My fork is private.

nikitakot avatar Feb 16 '24 10:02 nikitakot

@nikitakot, sorry, I latched on to the x86 Windows and missed that you said you're trying to build v28. Support for Reclient is only on main as of ~a month ago. E28 and E29 don't support building with Reclient. You can manually set your config back to Goma in the meantime. This is going to the be transition period for a few release cycles until all supported Electron versions are using Reclient.

dsanders11 avatar Feb 17 '24 01:02 dsanders11