Windows "ninja build all" always fails with "file already exists" |
|||||
Issue description
When I do a "ninja build all" on my Windows box, it always fails on building the webapp. If I do a "ninja build all" again, it always then succeeds.
PS C:\src\chrome\src> ninja -C out/debug all -j 500
ninja: Entering directory `out/debug'
[7248/28761] ACTION //remoting/webapp:webapp(//build/toolchain/win:win_clang_x64)
FAILED: remoting-webapp.v2.zip
C:/python_27_amd64/files/python.exe ../../remoting/webapp/build-webapp.py Dev 64.0.3250.0 remoting/remoting-webapp.v2 remoting-webapp.v2.zip ../../remoting/webapp/crd/manifest.json.jinja2 --files_listfile gen/remoting/webapp/webapp_files.txt --locales_listfile gen/remoting/webapp/webapp_locales.txt --use_gcd 0
Traceback (most recent call last):
File "../../remoting/webapp/build-webapp.py", line 380, in <module>
sys.exit(main())
File "../../remoting/webapp/build-webapp.py", line 376, in main
return buildWebApp(**vars(args))
File "../../remoting/webapp/build-webapp.py", line 276, in buildWebApp
"'OAUTH2_REDIRECT_URL'", oauth2RedirectUrlJs)
File "../../remoting/webapp/build-webapp.py", line 41, in findAndReplace
os.rename(filepath, oldFilepath)
WindowsError: [Error 183] Cannot create a file when that file already exists
ninja: build stopped: subcommand failed.
PS C:\src\chrome\src> ninja -C out/debug all -j 500
ninja: Entering directory `out/debug'
[20900/20900] STAMP obj/All.stamp
PS C:\src\chrome\src>
Sending to Dirk, as he last touched this area AFAICT in https://codereview.chromium.org/2093393002.
,
Oct 31 2017
,
Nov 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/73b6e8740d40deefa0ee829325c88028f4cdbb6a commit 73b6e8740d40deefa0ee829325c88028f4cdbb6a Author: Zijie He <zijiehe@chromium.org> Date: Wed Nov 01 17:43:26 2017 [Chromoting] Use shutil.move instead of os.rename to avoid "file already exists" error This looks like a very common issue when using os.rename() on Windows. https://www.google.com/search?q=python+os.rename+cannot+create+a+file+when+that+file+already+exists&oq=python+os.rename+cannot+create+a+file+when&aqs=chrome.0.0j69i57.12521j0j7&sourceid=chrome&ie=UTF-8 Bug: chromium:778370 Change-Id: I7132a2614fe9361c6860ae9598e994d7dbd00c5b Reviewed-on: https://chromium-review.googlesource.com/748306 Reviewed-by: Jamie Walch <jamiewalch@chromium.org> Commit-Queue: Zijie He <zijiehe@chromium.org> Cr-Commit-Position: refs/heads/master@{#513172} [modify] https://crrev.com/73b6e8740d40deefa0ee829325c88028f4cdbb6a/remoting/webapp/build-webapp.py
,
Nov 3 2017
,
Nov 6 2017
I rebased to 6804a845f099810c3f858a28a22e753a63d5d19e (r514150) and I just encountered this with my build. This doesn't seem to be fixed.
,
Nov 6 2017
Interesting. I will have another look. Before that, does the build error look exactly the same?
,
Nov 6 2017
Yep. I see:
PS C:\src\chrome\src> ninja -C out/debug all -j 300
ninja: Entering directory `out/debug'
[1/1] Regenerating ninja files
[11934/47502] ACTION //remoting/webapp:webapp(//build/toolchain/win:win_clang_x64)
FAILED: remoting-webapp.v2.zip
C:/python_27_amd64/files/python.exe ../../remoting/webapp/build-webapp.py Dev 64.0.3261.0 remoting/remoting-webapp.v2 remoting-webapp.v2.zip ../../remoting/webapp/crd/manifest.json.jinja2 --files_listfile gen/remoting/webapp/webapp_files.txt --locales_listfile gen/remoting/webapp/webapp_locales.txt --use_gcd 0
Traceback (most recent call last):
File "../../remoting/webapp/build-webapp.py", line 380, in <module>
sys.exit(main())
File "../../remoting/webapp/build-webapp.py", line 376, in main
return buildWebApp(**vars(args))
File "../../remoting/webapp/build-webapp.py", line 232, in buildWebApp
replaceString(destination, 'OAUTH2_API_BASE_URL', oauth2ApiBaseUrl)
File "../../remoting/webapp/build-webapp.py", line 63, in replaceString
"'" + placeholder + "'", "'" + value + "'")
File "../../remoting/webapp/build-webapp.py", line 41, in findAndReplace
shutil.move(filepath, oldFilepath)
File "C:\python_27_amd64\files\lib\shutil.py", line 299, in move
copy2(src, real_dst)
File "C:\python_27_amd64\files\lib\shutil.py", line 128, in copy2
copyfile(src, dst)
File "C:\python_27_amd64\files\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'remoting/remoting-webapp.v2\\plugin_settings.js.old'
[12233/47502] CXX obj/v8/v8_base/simd-scalar-lowering.obj
ninja: build stopped: subcommand failed.
PS C:\src\chrome\src> git log
commit 6804a845f099810c3f858a28a22e753a63d5d19e (HEAD, origin/master, origin/HEAD)
,
Dec 11 2017
,
Dec 11 2017
,
Dec 12
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dpranke@chromium.org
, Oct 28 2017Owner: ----