dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Failure to build dmd 32-bit Windows

Open dkorpel opened this issue 7 months ago • 2 comments

While trying to build dmd 2.112 with the installer:

Building Druntime 32-bit
Entering dir: clones\dmd\druntime
Running: "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64_x86 && mingw32-make -j4 MODEL=32 "DMD=C:\Users\vagrant\clones/dmd/generated/windows/release/32/dmd.exe" ENABLE_RELEASE=1 LATEST=2.112.0-beta.1
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'
Using make SHELL "C:/Program Files/Git/usr/bin/bash.exe", should be bash.
C:\Users\vagrant\clones/dmd/generated/windows/release/32/dmd.exe -c -conf= -Isrc -Iimport -w -de -preview=dip1000 -preview=fieldwise -m32   -preview=dtorfields -O -release -inline  -I. -P=-I. src/core/stdc/errno.c -of../generated/windows/release/32/errno_c.obj
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(83): Error: no type-specifier for parameter
_Pragma("pack(push, _CRT_PACKING)")
        ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(83): Error: found `"pack(push, _CRT_PACKING)"` when expecting `,`
_Pragma("pack(push, _CRT_PACKING)")
        ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error: expected identifier for declarator
    typedef unsigned int     size_t;
    ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error: expected identifier for declaration
    typedef unsigned int     size_t;
    ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(184): Error: `=`, `;` or `,` expected to end declaration instead of `typedef`
    typedef unsigned int     size_t;
    ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(296): Error: no type-specifier for parameter
_Pragma("pack(pop)")
        ^
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(296): Error: found `"pack(pop)"` when expecting `,`
_Pragma("pack(pop)")
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(12): Error: expected identifier for declarator
_Pragma("pack(push, _CRT_PACKING)")
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(12): Error: expected identifier for declaration
_Pragma("pack(push, _CRT_PACKING)")
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(12): Error: `=`, `;` or `,` expected to end declaration instead of `_Pragma`
_Pragma("pack(push, _CRT_PACKING)")
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(2010): Error: no type-specifier for parameter
_Pragma("pack(pop)")
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(2010): Error: found `"pack(pop)"` when expecting `,`
_Pragma("pack(pop)")
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\errno.h(14): Error: expected identifier for declarator
_Pragma("pack(push, _CRT_PACKING)")
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\errno.h(14): Error: expected identifier for declaration
_Pragma("pack(push, _CRT_PACKING)")
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\errno.h(14): Error: `=`, `;` or `,` expected to end declaration instead of `_Pragma`
_Pragma("pack(push, _CRT_PACKING)")
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\errno.h(130): Error: no type-specifier for parameter
_Pragma("pack(pop)")
        ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\errno.h(130): Error: found `"pack(pop)"` when expecting `,`
_Pragma("pack(pop)")
        ^
src\core\stdc\errno.c(15): Error: expected identifier for declarator
int getErrno()
^
src\core\stdc\errno.c(15): Error: expected identifier for declaration
int getErrno()
^
src\core\stdc\errno.c(15): Error: `=`, `;` or `,` expected to end declaration instead of `int`
int getErrno()
^
error limit (20) reached, use `-verrors=0` to show all

dkorpel avatar May 02 '25 10:05 dkorpel

Is _Pragma a(n unexpanded) macro in this context?

thewilsonator avatar May 02 '25 10:05 thewilsonator

Well it clearly works for CI (GHA + Azure), so this isn't a general issue. FWIW, the CI builds here don't use the x64_x86 env (but the pure 32-bit x86 one - can't imagine that that's a problem), and use VS 2022 (GHA) / 2019 (Azure), not 2017.

kinke avatar May 02 '25 18:05 kinke