Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexciarlillo opened this issue Jan 17, 2024 · 23 comments
Open

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

alexciarlillo opened this issue Jan 17, 2024 · 23 comments
Labels

Comments

@alexciarlillo
Copy link

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
Copy link
Author

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?

@codebytere
Copy link
Member

@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 cc4f6c3 - you can run e sanitize-config to make this permanent.

@alexciarlillo
Copy link
Author

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.

@nikitakot
Copy link

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"
  }
}

@codebytere
Copy link
Member

@MarshallOfSound what are your thoughts here?

@SheikhSajid
Copy link

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.

@nikitakot
Copy link

@SheikhSajid configs are in ~/.electron_build_tools/configs

@dsanders11
Copy link
Member

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?

@BurningEnlightenment
Copy link

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

@nikitakot
Copy link

@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

@SheikhSajid
Copy link

@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

@nikitakot
Copy link

nikitakot commented Feb 8, 2024

@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.

@dsanders11
Copy link
Member

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

@BurningEnlightenment
Copy link

@dsanders11 it seems to work fine now.

@nikitakot
Copy link

nikitakot commented Feb 15, 2024

@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

@BurningEnlightenment
Copy link

@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).

@dsanders11
Copy link
Member

@nikitakot, an e sync might clear that up.

@nikitakot
Copy link

@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.

@BurningEnlightenment
Copy link

FTR I built the current main branch for x64 Windows.

@dsanders11
Copy link
Member

@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.

@nikitakot
Copy link

@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
Copy link

nikitakot commented Feb 16, 2024

@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.

@dsanders11
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants