Discussion:
[chromium-dev] vs_toolchain.py issue
Demetrios Tsillas
2018-11-18 23:42:43 UTC
Permalink
Hi Folks,

I am trying to setup a new dev machine for Windows using Windows 7 and
VS2017. I'm following instructions given here:

https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md

Everything is going well until I need to generate the gn files.

I run into an error (pasted below). The error appears to be due to the use
of a forward slash in generating a SysWOW64 path.

Replacing the forward slash '/' with '\\' fixes in build/vs_toolchain.py
within SetEnvironmentAndGetRuntimeDllDir fixes the problem.

thanks!!!
-Jim.

E:\Work\workspace0\src>gn gen out\Release
Traceback (most recent call last):
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 476, in <module>
sys.exit(main())
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 472, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 295, in CopyDlls
_CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 275, in
_CopyRuntime

suffix)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 211, in
_CopyUCRTRun
time
os.path.join(source_dir, 'ucrtbase' + suffix))
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 179, in
_CopyRuntime
Impl
shutil.copy2(source, target)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 130, in copy2
copyfile(src, dst)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory:
'C:\\WINDOWS/SysWOW64\\ucrtbased.d
ll'
ERROR at //build/toolchain/win/BUILD.gn:43:3: Script returned non-zero exit
code
.
exec_script("../../vs_toolchain.py",
^----------
Current dir: E:/Work/workspace0/src/out/Release/
Command:
C:/Users/jtsillas/Git/depot_tools/win_tools-2_7_6_bin/python/bin/python
.exe E:/Work/workspace0/src/build/vs_toolchain.py copy_dlls
E:/Work/workspace0/s
rc/out/Release Debug x86
Returned 1 and printed out:

Copying C:\WINDOWS/SysWOW64\ucrtbased.dll to
E:/Work/workspace0/src/out/Release\
ucrtbased.dll...

See //BUILD.gn:61:1: which caused the file to be included.
group("gn_all") {
^----------------
Traceback (most recent call last):
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 292
, in <module>
main()
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 284
, in main
assert vc_lib_um_path
AssertionError
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org.
Sylvain Defresne
2018-11-19 14:25:47 UTC
Permalink
It looks like the script failed to find C:\WINDOWS\SysWOW64\ucrtbased.dll.
This is supposed to be part of Visual Studio and should be installed if you
select "Common Tools for Visual C++". Can you check whether this has been
correctly installed?
-- Sylvain
Post by Demetrios Tsillas
Hi Folks,
I am trying to setup a new dev machine for Windows using Windows 7 and
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
Everything is going well until I need to generate the gn files.
I run into an error (pasted below). The error appears to be due to the use
of a forward slash in generating a SysWOW64 path.
Replacing the forward slash '/' with '\\' fixes in build/vs_toolchain.py
within SetEnvironmentAndGetRuntimeDllDir fixes the problem.
thanks!!!
-Jim.
E:\Work\workspace0\src>gn gen out\Release
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 476, in <module>
sys.exit(main())
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 472, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 295, in CopyDlls
_CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 275, in
_CopyRuntime
suffix)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 211, in
_CopyUCRTRun
time
os.path.join(source_dir, 'ucrtbase' + suffix))
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 179, in
_CopyRuntime
Impl
shutil.copy2(source, target)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 130, in copy2
copyfile(src, dst)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 82, in copyfile
'C:\\WINDOWS/SysWOW64\\ucrtbased.d
ll'
ERROR at //build/toolchain/win/BUILD.gn:43:3: Script returned non-zero
exit code
.
exec_script("../../vs_toolchain.py",
^----------
Current dir: E:/Work/workspace0/src/out/Release/
C:/Users/jtsillas/Git/depot_tools/win_tools-2_7_6_bin/python/bin/python
.exe E:/Work/workspace0/src/build/vs_toolchain.py copy_dlls
E:/Work/workspace0/s
rc/out/Release Debug x86
Copying C:\WINDOWS/SysWOW64\ucrtbased.dll to
E:/Work/workspace0/src/out/Release\
ucrtbased.dll...
See //BUILD.gn:61:1: which caused the file to be included.
group("gn_all") {
^----------------
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 292
, in <module>
main()
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 284
, in main
assert vc_lib_um_path
AssertionError
--
--
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups
"Chromium-dev" group.
To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org
<https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org?utm_medium=email&utm_source=footer>
.
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJauWCHie2us_MpgURjVBa_4TnZc-WG94VONZqSh7uyR%3D%2BWqFg%40mail.gmail.com.
Demetrios Tsillas
2018-11-19 15:24:57 UTC
Permalink
The file is there. It's just that vs_toolchain.py cannot find it. When I
fix the path (as I describe in my original question) it works fine.
Post by Sylvain Defresne
It looks like the script failed to find C:\WINDOWS\SysWOW64\ucrtbased.dll.
This is supposed to be part of Visual Studio and should be installed if you
select "Common Tools for Visual C++". Can you check whether this has been
correctly installed?
-- Sylvain
Post by Demetrios Tsillas
Hi Folks,
I am trying to setup a new dev machine for Windows using Windows 7 and
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
Everything is going well until I need to generate the gn files.
I run into an error (pasted below). The error appears to be due to the
use of a forward slash in generating a SysWOW64 path.
Replacing the forward slash '/' with '\\' fixes in build/vs_toolchain.py
within SetEnvironmentAndGetRuntimeDllDir fixes the problem.
thanks!!!
-Jim.
E:\Work\workspace0\src>gn gen out\Release
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 476, in <module>
sys.exit(main())
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 472, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 295, in CopyDlls
_CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 275, in
_CopyRuntime
suffix)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 211, in
_CopyUCRTRun
time
os.path.join(source_dir, 'ucrtbase' + suffix))
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 179, in
_CopyRuntime
Impl
shutil.copy2(source, target)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 130, in copy2
copyfile(src, dst)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 82, in copyfile
'C:\\WINDOWS/SysWOW64\\ucrtbased.d
ll'
ERROR at //build/toolchain/win/BUILD.gn:43:3: Script returned non-zero
exit code
.
exec_script("../../vs_toolchain.py",
^----------
Current dir: E:/Work/workspace0/src/out/Release/
C:/Users/jtsillas/Git/depot_tools/win_tools-2_7_6_bin/python/bin/python
.exe E:/Work/workspace0/src/build/vs_toolchain.py copy_dlls
E:/Work/workspace0/s
rc/out/Release Debug x86
Copying C:\WINDOWS/SysWOW64\ucrtbased.dll to
E:/Work/workspace0/src/out/Release\
ucrtbased.dll...
See //BUILD.gn:61:1: which caused the file to be included.
group("gn_all") {
^----------------
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 292
, in <module>
main()
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 284
, in main
assert vc_lib_um_path
AssertionError
--
--
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups
"Chromium-dev" group.
To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org
<https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org?utm_medium=email&utm_source=footer>
.
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4f8adeb1-a0f8-45f5-a35a-3a69ed8f32ea%40chromium.org.
b***@chromium.org
2018-11-19 21:19:15 UTC
Permalink
That's very odd that the slash would cause problems, since that script has
been working for years and I don't think any of the recent changes to it
have affected that. Are you using an unusual version of Windows or version
of Python?

That said, there shouldn't be a slash in there. The script contains this:

os.path.expandvars('%windir%/SysWOW64')

when it should contain this:

os.path.join(os.path.expandvars('%windir%'),'SysWOW64')

Except that ucrtbase.dll really should be coming from c:\Program Files
(x86)\Windows Kits\10\bin\%SDKVER%\%target_cpu%\ucrt\

Grabbing that file from the SDK is slightly simpler (no special cases for
32-bit versus 64-bit Python) and will also support target_cpu=arm64. We
should be changing to the third option soon and that will fix your
mysterious failures. We could do the intermediate change immediately if
necessary, but I'd be interested in understanding why you are hitting the
failure in the first place.
Post by Demetrios Tsillas
The file is there. It's just that vs_toolchain.py cannot find it. When I
fix the path (as I describe in my original question) it works fine.
Post by Sylvain Defresne
It looks like the script failed to find
C:\WINDOWS\SysWOW64\ucrtbased.dll. This is supposed to be part of Visual
Studio and should be installed if you select "Common Tools for Visual C++".
Can you check whether this has been correctly installed?
-- Sylvain
Post by Demetrios Tsillas
Hi Folks,
I am trying to setup a new dev machine for Windows using Windows 7 and
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
Everything is going well until I need to generate the gn files.
I run into an error (pasted below). The error appears to be due to the
use of a forward slash in generating a SysWOW64 path.
Replacing the forward slash '/' with '\\' fixes in build/vs_toolchain.py
within SetEnvironmentAndGetRuntimeDllDir fixes the problem.
thanks!!!
-Jim.
E:\Work\workspace0\src>gn gen out\Release
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 476, in <module>
sys.exit(main())
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 472, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 295, in CopyDlls
_CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 275, in
_CopyRuntime
suffix)
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 211, in
_CopyUCRTRun
time
os.path.join(source_dir, 'ucrtbase' + suffix))
File "E:/Work/workspace0/src/build/vs_toolchain.py", line 179, in
_CopyRuntime
Impl
shutil.copy2(source, target)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 130, in copy2
copyfile(src, dst)
File
"C:\Users\jtsillas\Git\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shu
til.py", line 82, in copyfile
'C:\\WINDOWS/SysWOW64\\ucrtbased.d
ll'
ERROR at //build/toolchain/win/BUILD.gn:43:3: Script returned non-zero
exit code
.
exec_script("../../vs_toolchain.py",
^----------
Current dir: E:/Work/workspace0/src/out/Release/
C:/Users/jtsillas/Git/depot_tools/win_tools-2_7_6_bin/python/bin/python
.exe E:/Work/workspace0/src/build/vs_toolchain.py copy_dlls
E:/Work/workspace0/s
rc/out/Release Debug x86
Copying C:\WINDOWS/SysWOW64\ucrtbased.dll to
E:/Work/workspace0/src/out/Release\
ucrtbased.dll...
See //BUILD.gn:61:1: which caused the file to be included.
group("gn_all") {
^----------------
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 292
, in <module>
main()
File "E:/Work/workspace0/src/build/toolchain/win/setup_toolchain.py",
line 284
, in main
assert vc_lib_um_path
AssertionError
--
--
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google
Groups "Chromium-dev" group.
To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org
<https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4cc04e06-6696-4bf4-bb42-ec508240cfee%40chromium.org?utm_medium=email&utm_source=footer>
.
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/6482946f-2d75-4ebe-8159-0b7a1e52168e%40chromium.org.
Loading...