meson: Wrong cpu detection for 'x86_64' windows

In ‘x64 Native Tools Command Prompt for VS 2017’, the cpu detected by meson is ‘x86’ ?

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.16
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
D:\opt\glib-2.62.2\_build>meson .. --buildtype=release --prefix="D:\opt\glib\"
The Meson build system
Version: 0.52.0
Source dir: D:\opt\glib-2.62.2
Build dir: D:\opt\glib-2.62.2\_build
Build type: native build
Project name: glib
Project version: 2.62.2
C compiler for the host machine: cl (msvc 19.16.27034)
C linker for the host machine: link 19.16.27034
C++ compiler for the host machine: cl (msvc 19.16.27034)
C++ linker for the host machine: link 19.16.27034
Host machine cpu family: x86
Host machine cpu: x86

And I tried in vs2013 , 2015, got the same result.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 49 (36 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @pandyah5! The VS Developer Command Prompt is always x86. If you want to target x86_64 then use the VS x64 Native Tools Command Prompt.

Should the issue persist, please do the following:

  1. Open Start > Microsoft Visual Studio > VS x64 Native Tools Command Prompt
  2. Type cl.exe /? and press Enter
  3. Post the output here

Setting VSLANG=1033 works only if the English / US language pack is installed. That’s because VS uses a translation method based on string IDs, most probably relying on message tables in satellite DLLs, as usual for Windows-based software. That’s different from typical UNIX software w/ libintl, where the base language is hardcoded in the program and thus always available.

In order to install the language pack, open the Visual Studio Installer, select “Modify” and then click on the “Language Pack” tab

Assuming English language environment has been an issue previously, maybe on some issues still open.

It seems time to specifically have a non-English CI environment. Maybe a couple (Latin & non-Latin alphabets)

The problem is this: https://github.com/mesonbuild/meson/blob/4c96aa34cb415ca654c0571280386880e9d14ca3/mesonbuild/environment.py#L993

The RE doesn’t match. So match is None and target gets set to ‘x86’.

hmm, is this related to #6134