[Piglit] [PATCH] Remove MSVC build support.

Jose Fonseca jfonseca at vmware.com
Mon Jul 31 14:50:56 UTC 2017


> How broken was it?


Not much.  My prefix commit 6d78391c04d9f35353891e665f5ca092ce670e91 happened to fix.   I pushed that change for MinGW sake too, which was not throwing an error.


It was throwing an warning:


  warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]


maybe we should promote this to an error to catch it on Mingw too.


Anyway, I've now deleted the Jenkins job I had to build MSVC continuously.  So the next time MSVC would break, it would have stayed broken, and just accumulate brokenness.


> I never build Piglit with MSVC so I didn't notice.

>From now on me too.  And I strongly suspect this means there are now zero people (or bots) building piglit with MSVC.  So might as well RIP.

>  You might want to note in the commit msg that building with MinGW is the way forward.

Right.  I updated the README but forgot the commit: that's indeed the expectation.  MinGW is not flawless and I would never recommend it for production, but for tests, it should be fine.

Jose

PS: It seems more likely that the future for those who want a cross-platform compiler is not GCC but rather Clang.  Chrome just switched to Clang by default on Windows -- https://news.ycombinator.com/item?id=14877963 .  Maybe one day we can switch Mesa too.

________________________________
From: Brian Paul
Sent: Monday, July 31, 2017 15:33
To: Jose Fonseca; piglit at lists.freedesktop.org
Subject: Re: [PATCH] Remove MSVC build support.

How broken was it?  I never build Piglit with MSVC so I didn't notice.

You might want to note in the commit msg that building with MinGW is the
way forward.

Reviewed-by: Brian Paul <brianp at vmware.com>



On 07/31/2017 07:38 AM, Jose Fonseca wrote:
> MSVC build of Piglit was broken for over a month.  No point in
> sustaining it.
> ---
>   CMakeLists.txt                  |  6 ++--
>   HACKING                         | 10 ++----
>   README                          | 68 +++++++++++------------------------------
>   appveyor.yml                    |  8 -----
>   tests/shaders/CMakeLists.gl.txt | 10 ++----
>   tests/util/piglit-util.c        | 40 +++---------------------
>   tests/util/piglit-util.h        | 53 --------------------------------
>   7 files changed, 29 insertions(+), 166 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 76288b954..4259ec832 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -17,9 +17,9 @@ endif()
>
>   project (piglit)
>
> -# Require MSVC 2013 U4
> -if (MSVC AND CMAKE_C_COMPILER_VERSION VERSION_LESS 18.00.31101.0)
> -     message (FATAL_ERROR "Visual Studio 2013 Update 4 or later required")
> +# Require MinGW
> +if (MSVC)
> +     message (FATAL_ERROR "Windows builds require MinGW")
>   endif ()
>
>   find_package(Threads)
> diff --git a/HACKING b/HACKING
> index 41565439d..7d7915603 100644
> --- a/HACKING
> +++ b/HACKING
> @@ -101,14 +101,8 @@ Code conventions:
>     e.g. libpiglitutil_gles2
>   * Test names are '<lowercasegroupname>-<testname>.'  e.g. glsl-novertexdata
>   * Use int, float, bool except when GL types (GLint, GLfloat) are really needed
> -* Don't put declarations after code.  For example:
> -      if (x < 3)
> -         x = 0;
> -      int y = x * x;
> -  This will not compile with MSVC.  The 'int y' declaration must be at the
> -  top of the brace-block.
> -* Don't use named/designated initializers.  They don't compile with MSVC.
> -
> +* Always declare GL entrypoint pointer type with APIENTRY, or use piglit
> +  dispatch typedef
>
>   Test conventions:
>
> diff --git a/README b/README
> index 43bdfcae7..9d30bcc30 100644
> --- a/README
> +++ b/README
> @@ -150,83 +150,51 @@ Configure and build.
>   2.5 Windows
>   -----------
>
> -Install Python.
> +Install Python 3.
>   http://www.python.org/download
>
> -Install NumPy.
> -http://sourceforge.net/projects/numpy/files/NumPy
> -
>   Install CMake.
>   http://cmake.org/cmake/resources/software.html
>   Download and install 'Windows' platform.
>
> -Install Microsoft Visual Studio 2013 or later.
> -Install 'Visual C++' feature.
> +Download and install Ninja
> +https://github.com/ninja-build/ninja/releases
> +
> +Install MinGW-w64
> +https://mingw-w64.org/
>
>   Download OpenGL Core API and Extension Header Files.
>   http://www.opengl.org/registry/#headers
> -Copy header files to MSVC.
> -C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL
> -
> -Install pip.
> -http://www.pip-installer.org/en/latest/installing.html
> +Pass -DGLEXT_INCLUDE_DIR=/path/to/headers
>
>   Install python mako.
> -  > c:\Python27\Scripts\pip.exe install mako
> +> pip install mako
> +
> +Install NumPy.
> +> pip install numpy
>
>
>   2.5.1 GLUT
>   ----------
>
> -Download freeglut for MSVC.
> -http://www.transmissionzero.co.uk/software/freeglut-devel
> +Download freeglut for Mingw.
> +http://www.transmissionzero.co.uk/software/freeglut-devel/
>
> -Open Visual Studio Command Prompt.
> -Start Menu->All Programs->Visual Studio 2013->Visual Studio Tools->VS2013 x86 Native Tools Command Prompt
> -CD to piglit directory.
> +> cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext -DGLUT_INCLUDE_DIR=\path\to\freeglut\include -DGLUT_glut_LIBRARY=\path\to\freeglut\lib\x64\libfreeglut.a -DGLEXT_INCLUDE_DIR=\path\to\glext
> +> ninja -C build
>
> -Run CMake GUI.
> -  > C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
> -Configure
> -  - NMake Makefiles
> -  - Use default native compilers
> -Set these variables in the Advanced view.
> -  - GLUT_INCLUDE_DIR
> -  - GLUT_glut_LIBRARY
> -Configure
> -Generate
> -File->Exit
> -
> -Build from the Visual Studio Command Prompt.
> -  > nmake
>
>   2.5.2 Waffle
>   ------------
>
> -Download waffle for MSVC.
> +Download and build waffle for MinGW.
>   http://www.waffle-gl.org/
>
>   Open the Command Prompt.
>   CD to piglit directory.
>
> -Run CMake GUI.
> -  > C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
> -Configure
> -  - 'Visual Studio 12 2013', or
> -  - 'Visual Studio 12 2013 Win64'
> -  - Use default native compilers
> -Set these variables in the Advanced view.
> -Note that the values provided are for reference purposed and may differ on your system.
> -  - PIGLIT_USE_WAFFLE, BOOL, TRUE
> -  - WAFFLE_INCLUDE_DIRS, PATH, ${waffle_root}\include\waffle
> -  - WAFFLE_LDFLAGS, FILEPATH, ${waffle_root}\lib\waffle-1.lib
> -  - GLEXT_INCLUDE_DIR, PATH, C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL
> -Configure
> -Generate
> -File->Exit
> -
> -Build from the Command Prompt.
> -  > cmake --build .
> +> cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext -DPIGLIT_USE_WAFFLE=TRUE -DWAFFLE_INCLUDE_DIRS=\path\to\waffle\include\waffle WAFFLE_LDFLAGS=\path\to\waffle\lib\libwaffle-1.a
> +
>
>   3. How to run tests
>   -------------------
> diff --git a/appveyor.yml b/appveyor.yml
> index 302308599..5f6faec85 100644
> --- a/appveyor.yml
> +++ b/appveyor.yml
> @@ -49,12 +49,6 @@ environment:
>     - MINGW_HOME: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64
>       FREEGLUT_ARCHIVE: freeglut-MinGW-3.0.0-1.mp.zip
>       FREEGLUT_LIB: lib\x64\libfreeglut.a
> -# - MSVC_ARCH: x86
> -#   FREEGLUT_ARCHIVE: freeglut-MSVC-3.0.0-2.mp.zip
> -#   FREEGLUT_LIB: lib\freeglut.lib
> -# - MSVC_ARCH: x86_amd64
> -#   FREEGLUT_ARCHIVE: freeglut-MSVC-3.0.0-2.mp.zip
> -#   FREEGLUT_LIB: lib\x64\freeglut.lib
>
>   matrix:
>     fast_finish: true
> @@ -76,8 +70,6 @@ install:
>   - ninja --version
>   # Setup MinGW
>   - if not "%MINGW_HOME%"=="" set Path=%MINGW_HOME%\bin;%Path%
> -# Setup MSVC
> -- if not "%MSVC_ARCH%"=="" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %MSVC_ARCH%
>   # Install FreeGlut
>   - if not exist "%FREEGLUT_ARCHIVE%" appveyor DownloadFile "http://files.transmissionzero.co.uk/software/development/GLUT/%FREEGLUT_ARCHIVE%"
>   - 7z x -y "%FREEGLUT_ARCHIVE%" > nul
> diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
> index 7f786eed1..1dbd953e5 100644
> --- a/tests/shaders/CMakeLists.gl.txt
> +++ b/tests/shaders/CMakeLists.gl.txt
> @@ -79,10 +79,7 @@ piglit_add_executable (glsl-fs-fragcoord-zw-ortho glsl-fs-fragcoord-zw-ortho.c)
>   piglit_add_executable (glsl-fs-fragcoord-zw-perspective glsl-fs-fragcoord-zw-perspective.c)
>   piglit_add_executable (glsl-fs-loop glsl-fs-loop.c)
>   piglit_add_executable (glsl-fs-loop-nested glsl-fs-loop-nested.c)
> -# MSVC fails with "string exceeds 65535 bytes in length" error
> -IF (NOT MSVC)
> -     piglit_add_executable (glsl-fs-raytrace-bug27060 glsl-fs-raytrace-bug27060.c)
> -ENDIF ()
> +piglit_add_executable (glsl-fs-raytrace-bug27060 glsl-fs-raytrace-bug27060.c)
>   piglit_add_executable (glsl-fs-sampler-numbering glsl-fs-sampler-numbering.c)
>   piglit_add_executable (glsl-fs-shader-stencil-export glsl-fs-shader-stencil-export.c)
>   piglit_add_executable (glsl-fs-sqrt-branch glsl-fs-sqrt-branch.c)
> @@ -102,10 +99,7 @@ piglit_add_executable (glsl-fs-pointcoord glsl-fs-pointcoord.c)
>   piglit_add_executable (glsl-vs-if-bool glsl-vs-if-bool.c)
>   piglit_add_executable (glsl-vs-loop glsl-vs-loop.c)
>   piglit_add_executable (glsl-vs-loop-nested glsl-vs-loop-nested.c)
> -# MSVC fails with "string exceeds 65535 bytes in length" error
> -IF (NOT MSVC)
> -     piglit_add_executable (glsl-vs-raytrace-bug26691 glsl-vs-raytrace-bug26691.c)
> -ENDIF ()
> +piglit_add_executable (glsl-vs-raytrace-bug26691 glsl-vs-raytrace-bug26691.c)
>   piglit_add_executable (glsl-vs-statechange-1 glsl-vs-statechange-1.c)
>   piglit_add_executable (glsl-vs-user-varying-ff glsl-vs-user-varying-ff.c)
>   piglit_add_executable (glsl-light-model glsl-light-model.c)
> diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
> index 15a178b08..e33d055f2 100644
> --- a/tests/util/piglit-util.c
> +++ b/tests/util/piglit-util.c
> @@ -29,7 +29,6 @@
>   #endif
>
>   #ifdef __linux__
> -#include <unistd.h>
>   #include <sys/types.h>
>   #include <sys/syscall.h>
>   #endif
> @@ -64,6 +63,10 @@
>   # define USE_STDIO
>   #endif
>
> +#if defined(HAVE_UNISTD_H)
> +#include <unistd.h>  // for usleep
> +#endif
> +
>   #include "piglit-util.h"
>
>
> @@ -116,35 +119,6 @@ int asprintf(char **strp, const char *fmt, ...)
>
>   #endif /* HAVE_ASPRINTF */
>
> -#ifdef _MSC_VER
> -
> -char *
> -basename(char *path)
> -{
> -     char *res;
> -
> -     // Skip drive letter
> -     if (path[0] != '\0' && path[1] == ':') {
> -             path += 2;
> -     }
> -
> -     // Return pointer to the char after the last directory separator
> -     res = path;
> -     while (true) {
> -             char c = *path++;
> -             switch (c) {
> -             case '\0':
> -                     return res;
> -             case '\\':
> -             case '/':
> -                     res = ++path;
> -                     break;
> -             }
> -     }
> -}
> -
> -#endif /* _MSC_VER */
> -
>   /**
>    * \brief Split \a string into an array of strings.
>    *
> @@ -343,12 +317,6 @@ piglit_disable_error_message_boxes(void)
>                 * http://msdn.microsoft.com/en-us/library/sas1dkb2.aspx
>                 */
>                _set_error_mode(_OUT_TO_STDERR);
> -#ifdef _MSC_VER
> -             /* Disable abort message box.
> -              * http://msdn.microsoft.com/en-us/library/e631wekh.aspx
> -              */
> -             _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
> -#endif
>        }
>   #endif /* _WIN32 */
>   }
> diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
> index ad00817a1..c4e781808 100644
> --- a/tests/util/piglit-util.h
> +++ b/tests/util/piglit-util.h
> @@ -61,31 +61,6 @@ extern "C" {
>   #define __has_attribute(x) 0
>   #endif
>
> -#if defined(_MSC_VER)
> -
> -/* windows.h won't define min/max macros if NOMINMAX is defined, however
> - * stdlib.h will still define them for C files regardless... */
> -#undef max
> -#undef min
> -
> -#if !defined(__cplusplus) && !defined(inline)
> -#define inline __inline
> -#endif
> -
> -#if !defined(__func__)
> -#define __func__ __FUNCTION__
> -#endif
> -
> -#define snprintf _snprintf
> -
> -#define alloca _alloca
> -
> -#define usleep(__usec) Sleep(((__usec) + 999)/1000)
> -
> -char *basename(char *path);
> -
> -#endif /* defined(_MSC_VER) */
> -
>   #if (__GNUC__ >= 3)
>   #define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
>   #else
> @@ -94,8 +69,6 @@ char *basename(char *path);
>
>   #if defined(__GNUC__) || __has_attribute(noreturn)
>   #define NORETURN __attribute__((noreturn))
> -#elif defined(_MSC_VER)
> -#define NORETURN __declspec(noreturn)
>   #else
>   #define NORETURN
>   #endif
> @@ -253,28 +226,6 @@ streq(const char *a, const char *b)
>   static inline double
>   strtod_inf(const char *nptr, char **endptr)
>   {
> -#if defined(_MSC_VER)
> -     /* skip spaces and tabs */
> -     while (*nptr == ' ' || *nptr == '\t')
> -             nptr++;
> -
> -#pragma warning( push )
> -#pragma warning( disable : 4056 ) // overflow in floating-point constant arithmetic
> -#pragma warning( disable : 4756 ) // overflow in constant arithmetic
> -     if (nptr[0] == 'i' && nptr[1] == 'n' && nptr[2] == 'f') {
> -             /* +infinity */
> -             *endptr = (char *) (nptr + 3);
> -             return INFINITY;
> -     }
> -     else if (nptr[0] == '-' && nptr[1] == 'i' && nptr[2] == 'n' && nptr[3] == 'f') {
> -             /* -infinity */
> -             *endptr = (char *) (nptr + 4);
> -             return -INFINITY;
> -     }
> -#pragma warning( pop )
> -
> -     /* fall-through */
> -#endif
>        return strtod(nptr, endptr);
>   }
>
> @@ -354,11 +305,7 @@ strtol_hex(const char *nptr, char **endptr)
>   static inline char *
>   strchrnul(const char *s, int c)
>   {
> -#if defined(_MSC_VER) && defined(__cplusplus)
> -     char *t = strchr((char *)s, c);
> -#else
>        char *t = strchr(s, c);
> -#endif
>
>        return (t == NULL) ? ((char *) s + strlen(s)) : t;
>   }
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170731/c6a5d28e/attachment-0001.html>


More information about the Piglit mailing list