chroumium electron apply_all_patches.py patch git error WindowsError: [Error 2] The system cannot find the file specified
patch failure during build of electron on head commit:9554d06 #24046
Comments
When I add "shell=True" at Popen, it doesn't show that error. But other issur occured: running 'vpython.bat src/electron/script/apply_all_patches.py src/electron/patches/config.json' in 'C:\zhibin' None None |
When first error occured, git run without "cmd -c". This can be fixed by modifying src\electron\script\lib\git.py then do gclient sync a again. |
Please use |
I figure out why git cannot be found by check_all or pOPen in file of git.py, must fix by adding shell=true. |
bigben0123 commented 2 days ago •
I have just installed a windows server 2019 vm on AWS.
1, I unzip the deposit_tools and executed gclient. It get tools of git and python 2 and 3 for me.
2, execute env.bat :
set path=C:\zhibin\depot_tools;%PATH%
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GIT_CACHE_PATH=C:.git_cache
3, `gclient sync --with_branch_heads --with_tags
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Syncing projects: 11% (11/92) src/third_party/blink/web_tests/wpt_internal/webgpu/third_party/glslang_js:chromium/third
Syncing projects: 13% (12/92) src/chrome/test/data/perf/frame_rate/content
Syncing projects: 100% (100/100), done.
running 'vpython.bat src/electron/script/apply_all_patches.py src/electron/patches/config.json' in 'C:\zhibin'
src/electron/patches/chromium
['git', '-C', u'src', 'update-ref', 'refs/patches/upstream-head', 'HEAD']
(['git', '-C', u'src', 'update-ref', 'refs/patches/upstream-head', 'HEAD'],)
{}
None
git -C src update-ref refs/patches/upstream-head HEAD
None
None
<subprocess.STARTUPINFO instance at 0x0000000002DDCE88>
git -C src update-ref refs/patches/upstream-head HEAD
Traceback (most recent call last):
File "src/electron/script/apply_all_patches.py", line 36, in
main()
File "src/electron/script/apply_all_patches.py", line 32, in main
apply_patches(json.load(config_json))
File "src/electron/script/apply_all_patches.py", line 18, in apply_patches
committer_name="Electron Scripts", committer_email="scripts@electron")
File "C:\zhibin\src\electron\script\lib\git.py", line 97, in import_patches
newvalue='HEAD'
File "C:\zhibin\src\electron\script\lib\git.py", line 121, in update_ref
return subprocess.check_call(args)
File "C:\zhibin\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\Lib\subprocess.py", line 187, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\zhibin\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\Lib\subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\zhibin\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\Lib\subprocess.py", line 396, in init
errread, errwrite)
File "C:\zhibin\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\Lib\subprocess.py", line 654, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Error: Command 'vpython.bat src/electron/script/apply_all_patches.py src/electron/patches/config.json' returned non-zero exit status 1 in C:\zhibin`
I add some debug in git.py. I find out that if command with "C:\Windows\system32\cmd.exe /c "xxxxx" ", it's ok. However, this not start with "cmd.exe" : git -C src update-ref refs/patches/upstream-head HEAD.
I'am not familiar with python. It's not helpful from previous same issue solve.
By default, gclient use pthon3. I tried python2 and it doesn't work either.
where git
C:\zhibin\depot_tools\git.bat
where git.exe
C:\zhibin\depot_tools\bootstrap-3_8_0_chromium_8_bin\git\bin\git.exe