Bug 106843 - Cannot build osmesa with GLES (shared glapi) using Scons and MSVC
Summary: Cannot build osmesa with GLES (shared glapi) using Scons and MSVC
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/OSMesa (show other bugs)
Version: unspecified
Hardware: All Windows (All)
: high critical
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-06 19:12 UTC by pal1000
Modified: 2019-01-23 20:54 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Build attempt log (64-bit) (3.38 KB, text/plain)
2018-06-06 19:12 UTC, pal1000
Details

Description pal1000 2018-06-06 19:12:15 UTC
Created attachment 140056 [details]
Build attempt log (64-bit)

If I try to build osmesa and GLES support is enabled, Mesa build fails with unresolved symbols. It doesn't matter if I add extra targets like libg-gdi, graw-gdi or swr or not. RQeproduced with both 32-bit and 64-bit builds on Mesa 18.1.1 with Visual Studio 15.7,3 and Windows SDK 10.0.17134.12
Comment 1 pal1000 2018-06-06 21:01:33 UTC
I was able to replicate this with Mesa master too.
Comment 2 pal1000 2018-06-07 09:24:43 UTC
Can also replicate with the very short scons gles=1 because osmesa is included in the default configuration.
Comment 4 Eric Engestrom 2018-06-18 12:03:34 UTC
Hi Alex,

First off, note that I don't know anything about scons, msvc or windows, but Dylan has been adding Windows support to Meson (https://lists.freedesktop.org/archives/mesa-dev/2018-June/197325.html).

Would you mind testing the work-in-progress branch and report if it works when building with Meson?
git://people.freedesktop.org/~dbaker/mesa meson-windows
Comment 5 pal1000 2018-06-19 16:38:55 UTC
Eric, I tried that branch but it's far from being in working state. When I attempt to build it, it tries to find pkg-config. This doesn't make sense for a MSVC build. As far as I know that's a Linux, MSYS2 and Cygwin thing and has nothing to do with MSVC:

The following Python versions were detected:
1. Python 2.7

Note: Experimental /enablemeson command-line argument is set. We will attempt to build Mesa3D if you pick any of the folowing Python versions even if it is known to fail for now:

5. Python 3.6

Select Python version by entering its index from the table above:5

Using Python 3.6.5 from C:\Software\DEVELO~1\projects\mesa\py3\python.exe.

WARNING: Python 3.x support is experimental.

Install/update python packages (y/n):

Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):


Begin mesa build. Proceed (y/n):y

Use Ninja build system instead of MsBuild (y/n); less storage device strain and maybe faster build:

Do you want to clean build (y/n):y


**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

Microsoft Windows [Version 10.0.17134.112]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Software\DEVELO~1\projects\mesa\mesa>echo %buildcmd%
C:\Software\DEVELO~1\projects\mesa\py3\python.exe C:\Software\DEVELO~1\projects\mesa\py3\Scripts\meson.py . .\build\windows-x86_64 --backend=vs2017 --buildtype=release

C:\Software\DEVELO~1\projects\mesa\mesa>%buildcmd%
The Meson build system
Version: 0.46.1
Source dir: C:\Software\DEVELO~1\projects\mesa\mesa
Build dir: C:\Software\DEVELO~1\projects\mesa\mesa\build\windows-x86_64
Build type: native build
Program python found: YES (C:\Software\DEVELO~1\projects\mesa\py3\python.EXE)
Project name: mesa
Native C compiler: cl (msvc 19.14.26430)
Native C++ compiler: cl (msvc 19.14.26430)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Program pkg-config found: NO

meson.build:414:0: ERROR:  Program(s) ['pkg-config'] not found or not executable

A full log can be found at C:\Software\DEVELO~1\projects\mesa\mesa\build\windows-x86_64\meson-logs\meson-log.txt

C:\Software\DEVELO~1\projects\mesa\mesa>


To test for this issue I probably only have to add -Dshared-glapi=true and Dosmesa=gallium. Dgles1 and Dgles2 are not needed as the only requirement is an osmesa build with shared-glapi. But for those options to have any meaningful effect the build has to get further.
Comment 6 pal1000 2018-06-19 16:44:15 UTC
Ping.
Comment 7 pal1000 2018-07-02 20:19:35 UTC
(In reply to Eric Engestrom from comment #4)
> Hi Alex,
> Would you mind testing the work-in-progress branch and report if it works
> when building with Meson?
> git://people.freedesktop.org/~dbaker/mesa meson-windows
That branch appears to be incomplete. It has only 24 of the 48 patches in the series:
https://cgit.freedesktop.org/~dbaker/mesa/log/?h=meson-windows
Full series: https://patchwork.freedesktop.org/series/44596/
After looking at the 46th patch in the series that acts like a blueprint I noticed the branch is incomplete.
Comment 8 pal1000 2018-07-10 08:28:01 UTC
(In reply to Alex Granni from comment #7)
> (In reply to Eric Engestrom from comment #4)
> > Hi Alex,
> > Would you mind testing the work-in-progress branch and report if it works
> > when building with Meson?
> > git://people.freedesktop.org/~dbaker/mesa meson-windows
> That branch appears to be incomplete. It has only 24 of the 48 patches in
> the series:
> https://cgit.freedesktop.org/~dbaker/mesa/log/?h=meson-windows
> Full series: https://patchwork.freedesktop.org/series/44596/
> After looking at the 46th patch in the series that acts like a blueprint I
> noticed the branch is incomplete.
Dylan posted the Meson windows branch on Freedesktop Gitlab. I'll test this issue with Meson soon.
Comment 9 pal1000 2018-07-10 15:56:45 UTC
(In reply to Alex Granni from comment #8)
> (In reply to Alex Granni from comment #7)
> > (In reply to Eric Engestrom from comment #4)
> > > Hi Alex,
> > > Would you mind testing the work-in-progress branch and report if it works
> > > when building with Meson?
> > > git://people.freedesktop.org/~dbaker/mesa meson-windows
> > That branch appears to be incomplete. It has only 24 of the 48 patches in
> > the series:
> > https://cgit.freedesktop.org/~dbaker/mesa/log/?h=meson-windows
> > Full series: https://patchwork.freedesktop.org/series/44596/
> > After looking at the 46th patch in the series that acts like a blueprint I
> > noticed the branch is incomplete.
> Dylan posted the Meson windows branch on Freedesktop Gitlab. I'll test this
> issue with Meson soon.

Tested and it builds successfully, so it's a Scons only issue. Because Meson has GLES enabled by default unlike Scons it is not much of a surprise it's unaffected.
Comment 10 pal1000 2019-01-23 20:54:08 UTC
This got fixed by having offending feature removed.


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.