Bug 100202

Summary: llvmpipe Windows scons build can't detect Visual Studio 2017 toolchain
Product: Mesa Reporter: Anonymous Helper <anonymous>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: major    
Priority: medium    
Version: 17.0   
Hardware: All   
OS: Windows (All)   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=102852
Whiteboard:
i915 platform: i915 features:
Attachments: Build log

Description Anonymous Helper 2017-03-14 16:57:05 UTC
Created attachment 130220 [details]
Build log
Comment 1 Jose Fonseca 2017-03-15 22:41:30 UTC
Yes, it doesn't look like SCons officially supports 2017 yet:

  https://pairlist4.pair.net/pipermail/scons-users/2017-January/005607.html

That thread points to some solutions (e.g, use MSVC_USE_SCRIPT env var and point it to MSVS 2017 vcvars.bat)

We'll just have to wait for SCons to officially support it.
Comment 2 Anonymous Helper 2017-03-27 15:43:16 UTC
Workaround:
Open Visual Studio 2017 installer. Opt-in for Visual Studio 2015 Update 3 toolset
in Desktop Development with C/C++ section.
Because LLVM 4.0 is not supported per bug 100201 you have to patch LLVM 3.9.1 source code with this 
https://www.diffchecker.com/t58yZ2JE on lib\DebugInfo\PDB\DIA\DIASession.cpp line 61.
For now you can use either the normal VS2017 Native Tools and VS2015 Native Tools, but VS2017 toolset would stop working if bug 100201 gets fixed before this bug.
This is because of the following confusion with Scons:
- MSVC 2017 toolset has built-in xtime definition;
- MSVC 2015 toolset doesn't;
- LLVM 4.0 makes use of xtime;
- LLVM 3.9.1 doesn't;
- Scons, while it can use MSVC 2017 toolset if MSVC 2015 toolset is installed, it doesn't support it properly, it is unable to detect certain headers, mainly brand new ones like xtimec.h where xtime is defined. This leads to a no escape situation where you can only decide how you fail.

- If you remove xtime definition from Mesa codbase, you quickly get xtime undefined coming from Scons;
- If you leave this unchanged, MSVC compiler encounters an xtime redifintion close to the end of the build like here:
https://bugs.freedesktop.org/attachment.cgi?id=130219
Comment 3 Anonymous Helper 2017-03-28 08:51:05 UTC
(In reply to Anonymous Helper from comment #2)
> For now you can use either the normal VS2017 Native Tools and VS2015 Native
> Tools, but VS2017 toolset would stop working if bug 100201 gets fixed before
> this bug.
> This is because of the following confusion with Scons:
> - MSVC 2017 toolset has built-in xtime definition;
> - MSVC 2015 toolset doesn't;
> - LLVM 4.0 makes use of xtime;
> - LLVM 3.9.1 doesn't;
> - Scons, while it can use MSVC 2017 toolset if MSVC 2015 toolset is
> installed, it doesn't support it properly, it is unable to detect certain
> headers, mainly brand new ones like xtimec.h where xtime is defined. This
> leads to a no escape situation where you can only decide how you fail.
> 
> - If you remove xtime definition from Mesa codbase, you quickly get xtime
> undefined coming from Scons;
> - If you leave this unchanged, MSVC compiler encounters an xtime redifintion
> close to the end of the build like here:
> https://bugs.freedesktop.org/attachment.cgi?id=130219
Update: It turns out that LLVM 4.0 won't actually impact Scons interaction with MSVC 2017 toolset as I stated above, also xtime was already defined in MSVC 2015 toolset, so it isn't actually brand new as I thought. Both toolchains would be usable regardless of what's going to happpen with bug 100201.
Comment 4 pal1000 2017-10-23 10:51:10 UTC
Mesa 17.2.3 supports Scons 3.0.0 which in turn supports Visual Studio 2017.
This marks this bug as fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.