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

Can't build on windows because rewrapper_windows.cfg doesn't exist in buildtools of chromium src #578

Open
xyloflake opened this issue Apr 13, 2024 · 13 comments

Comments

@xyloflake
Copy link

Operating System

image

Expected Behavior

The build should succeed

Actual Behavior

I get the following error when doing e build

Running "C:\Users\Xylo\.electron_build_tools\third_party\depot_tools\gn.bat gen out/Testing --args=import("//electron/build/args/testing.gn") use_remoteexec = true" in K:\atom\electron\src
reclient config file 'K:\atom\electron\src\buildtools\reclient_cfgs\chromium-browser-clang\rewrapper_windows.cfg' doesn't exist

To build with gn arg 'use_remoteexec=true' as a googler on a non corp machine
see http://go/chrome-linux-build#setup-remote-execution for setup instructions.

Building with gn arg 'use_remoteexec=true' as a non-googler is not currently
supported on your os (win32).

ERROR at //build/toolchain/rbe.gni:68:3: Script returned non-zero exit code.
  exec_script(rebase_path("//build/toolchain/check_rewrapper_cfg.py"),
  ^----------
Current dir: K:/atom/electron/src/out/Testing/
Command: C:/Users/Xylo/.electron_build_tools/third_party/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python3/bin/python3.exe K:/atom/electron/src/build/toolchain/check_rewrapper_cfg.py ../../buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_windows.cfg
Returned 1.
See //build/config/BUILDCONFIG.gn:739:1: whence it was imported.
import("//build/toolchain/rbe.gni")
^---------------------------------
ERROR Error: Command failed: C:\Users\Xylo\.electron_build_tools\third_party\depot_tools\gn.bat gen out/Testing --args=import("//electron/build/args/testing.gn") use_remoteexec = true
    at checkExecSyncError (node:child_process:885:11)
    at Object.execFileSync (node:child_process:921:15)
    at Object.depotExecFileSync [as execFileSync] (C:\Users\Xylo\.electron_build_tools\src\utils\depot-tools.js:145:23)
    at runGNGen (C:\Users\Xylo\.electron_build_tools\src\e-build.js:22:9)
    at ensureGNGen (C:\Users\Xylo\.electron_build_tools\src\e-build.js:27:41)
    at runNinja (C:\Users\Xylo\.electron_build_tools\src\e-build.js:62:3)
    at Command.<anonymous> (C:\Users\Xylo\.electron_build_tools\src\e-build.js:127:9)
    at Command.listener [as _actionHandler] (C:\Users\Xylo\.electron_build_tools\node_modules\commander\lib\command.js:480:17)
    at C:\Users\Xylo\.electron_build_tools\node_modules\commander\lib\command.js:1234:65

To Reproduce

IDK what causes this so I can't exactly mention the reproduction steps.

Screenshots

Not applicable

Additional Information

So as far as I can say, it's basically chromium messing up the build. I can't find any directory inside https://github.com/chromium/chromium/tree/main/buildtools/reclient_cfgs named chromium-browser-clang. Also no file named rewrapper_windows.cfg exists on the entire repo.

@codebytere
Copy link
Member

@xyloflake are you trying to build regular chromium? We patch Electron to use an external config and so the required configs don't exist in regular Chromium. If you want to build Chromium locally, you can add the following patch:

diff --git a/DEPS b/DEPS
index 40bb9ce0f48b3..4631513d07fd7 100644
--- a/DEPS
+++ b/DEPS
@@ -905,6 +905,9 @@ deps = {
       'condition': 'checkout_ios',
   },

+  'src/third_party/engflow-reclient-configs':
+      'https://github.com/EngFlow/reclient-configs.git@955335c30a752e9ef7bff375baab5e0819b6c00d',
+
   'src/ios/third_party/webkit/src': {
       'url': Var('chromium_git') + '/external/github.com/WebKit/webkit.git' +
              '@' + Var('ios_webkit_revision'),
diff --git a/buildtools/reclient_cfgs/configure_reclient_cfgs.py b/buildtools/reclient_cfgs/configure_reclient_cfgs.py
index 06b75f487e51f4bdef42e7f26c8c803eabd2da60..c6485d888699e2bf10ab16ec2f797dd50855c0cb 100755
--- a/buildtools/reclient_cfgs/configure_reclient_cfgs.py
+++ b/buildtools/reclient_cfgs/configure_reclient_cfgs.py
@@ -329,4 +329,13 @@ def main():
 
 
 if __name__ == "__main__":
-    sys.exit(main())
+    r = main()
+    if r != 0:
+        sys.exit(r)
+
+    electron_script = os.path.join(CHROMIUM_SRC, 'third_party', 'engflow-reclient-configs', 'configure_reclient.py')
+    r = subprocess.call([sys.executable, electron_script, '--src_dir=src', '--force'])
+    if r != 0:
+        sys.exit(r)
+
+    print('done')

The files are generated by the engflow-reclient-configs dependency in a hook.

@xyloflake
Copy link
Author

@codebytere no I'm not. I'm just doing e build

@codebytere
Copy link
Member

@xyloflake did you sync properly prior to building?

@xyloflake
Copy link
Author

xyloflake commented Apr 13, 2024

@codebytere Yes I did, I've done it over 3 times, with 3 diff configs now

@xyloflake
Copy link
Author

xyloflake commented Apr 13, 2024

Here's everything I did @codebytere

  1. npm i -g @electron/build-tools
  2. e init --root=K:/atom/electron --bootstrap testing
  3. e build

@codebytere
Copy link
Member

@xyloflake and did initialization fully succeed? were all patches applied? I suggest running e sync again.

@xyloflake
Copy link
Author

xyloflake commented Apr 13, 2024

@codebytere I'll try again. As far as I remember, no the initialization didn't fully succeed. It started building right away without any instruction from me.

@xyloflake
Copy link
Author

@codebytere I've tried over dozen times now, I get the same error while initiating

Downloading "https://dev-cdn.electronjs.org/reclient/credential-helper/v0.2.2/electron-rbe-credential-helper-windows-amd64.tar.gz" into C:\Users\xylo\.electron_build_tools\third_party\reclient.tar.gz
[===============================================================================================] 1.07MB/s 100% 0.0s
Running "C:\Users\xylo\.electron_build_tools\third_party\reclient\electron-rbe-credential-helper.exe login"
Please visit https://auth.notgoma.com/rbe/b325c0ab8102c3c8bbd977257d72c67c377f708b97e6529b957feeef0824c097 to obtain RBE authentication...

Authentication Status: Authenticated
Since:     2024-04-15 00:05:53 +0530 IST
Expires:   2024-04-17 00:05:53 +0530 IST
Cluster:   cas.notgoma.com
Principal: github/xyloflake
Access:    Cache Only
Running "C:\Users\xylo\.electron_build_tools\third_party\depot_tools\gn.bat gen out/Testing --args=import("//electron/build/args/testing.gn") use_remoteexec = true" in C:\Users\xylo\electron\src
C:\Users\xylo\electron\.gclient_entries missing, .gclient file in parent directory C:\Users\xylo\electron might not be the file you want to use.
gn.py: Could not find gn executable at: C:\Users\xylo\electron\src\buildtools\win\gn.exe
ERROR Error: Command failed: C:\Users\xylo\.electron_build_tools\third_party\depot_tools\gn.bat gen out/Testing --args=import("//electron/build/args/testing.gn") use_remoteexec = true
    at checkExecSyncError (node:child_process:885:11)
    at Object.execFileSync (node:child_process:921:15)
    at Object.depotExecFileSync [as execFileSync] (C:\Users\xylo\.electron_build_tools\src\utils\depot-tools.js:145:23)
    at runGNGen (C:\Users\xylo\.electron_build_tools\src\e-build.js:22:9)
    at ensureGNGen (C:\Users\xylo\.electron_build_tools\src\e-build.js:27:41)
    at runNinja (C:\Users\xylo\.electron_build_tools\src\e-build.js:62:3)
    at Command.<anonymous> (C:\Users\xylo\.electron_build_tools\src\e-build.js:127:9)
    at Command.listener [as _actionHandler] (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:480:17)
    at C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1234:65
ERROR Error: Command failed: C:\Program Files\nodejs\node.exe C:\Users\xylo\.electron_build_tools\src\e build
    at checkExecSyncError (node:child_process:885:11)
    at Object.execFileSync (node:child_process:921:15)
    at Command.<anonymous> (C:\Users\xylo\.electron_build_tools\src\e-init.js:212:22)
    at Command.listener [as _actionHandler] (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:480:17)
    at C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1234:65
    at Command._chainOrCall (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1151:12)
    at Command._parseCommand (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1234:27)
    at Command.parse (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:889:10)
    at Object.<anonymous> (C:\Users\xylo\.electron_build_tools\src\e-init.js:218:4)

It always happens at the rbe auth step, I've tried on 2 different computers with the same OS

@xyloflake
Copy link
Author

@codebytere do you know what might be causing this?

@codebytere
Copy link
Member

Can you paste me the output of the failed init? The best solution here likely is that we shouldn't try to build if sync failed when running e init.

@xyloflake
Copy link
Author

The above one is the output of e init (when it fails) @codebytere

@xyloflake
Copy link
Author

xyloflake commented Apr 15, 2024

Checking for build-tools updates
warning ..\package.json: No license field
fatal: detected dubious ownership in repository at 'C:/Users/xylo/.electron_build_tools'
'C:/Users/xylo/.electron_build_tools' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        XYLOFLAKE/xylo (S-1-5-21-2199669179-138158326-79340719-1001)
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/xylo/.electron_build_tools
ERROR Error: Command failed: git rev-parse --verify HEAD
fatal: detected dubious ownership in repository at 'C:/Users/xylo/.electron_build_tools'
'C:/Users/xylo/.electron_build_tools' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        XYLOFLAKE/xylo (S-1-5-21-2199669179-138158326-79340719-1001)
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/xylo/.electron_build_tools

    at checkExecSyncError (node:child_process:885:11)
    at Object.execSync (node:child_process:957:15)
    at git (C:\Users\xylo\.electron_build_tools\src\e-auto-update.js:107:10)
    at Command.checkForUpdates (C:\Users\xylo\.electron_build_tools\src\e-auto-update.js:112:24)
    at Command.listener [as _actionHandler] (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:480:17)
    at C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1234:65
    at Command._chainOrCall (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1151:12)
    at Command._parseCommand (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:1234:27)
    at Command.parse (C:\Users\xylo\.electron_build_tools\node_modules\commander\lib\command.js:889:10)
error: missing required argument 'name'

I get this now when I try e init @codebytere
I'll try to solve it

@codebytere
Copy link
Member

codebytere commented Apr 16, 2024

@xyloflake you should only have run e init once. After that, you should be running e sync and e build as i noted above:

I suggest running e sync again.

At this point it probably makes sense to simply delete and restart. The gn error you're seeing can happen if runhooks failed, which can happen depending on when sync fails.

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

No branches or pull requests

2 participants