Skip to content

vcpkg fails to build on macOS 12.0.1 with XCode 13.1 #20993

@acgetchell

Description

@acgetchell

Describe the bug
vcpkg fails to build.

Environment

  • OS: macOS 12.0.1
  • Compiler: 13.0.0.13000029

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/microsoft/vcpkg.git
  2. cd vcpkg
  3. ./bootstrap-vcpkg.sh

Expected behavior
Expect vcpkg to build.

Failure logs

adam@hapkido ~/projects/vcpkg (master) $ ./bootstrap-vcpkg.sh 
Downloading cmake...
Downloading cmake... done.
Extracting cmake...
Extracting cmake... done.
Downloading ninja...
Downloading ninja... done.
Extracting ninja...
Extracting ninja... done.
Downloading vcpkg tool sources
Building vcpkg-tool...
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting the C++ compiler in use
-- Detecting the C++ compiler in use - clang
-- Detecting the C++ standard library
-- Detecting the C++ standard library - libc++
-- Detecting how to use the C++ filesystem library
-- Detecting how to use the C++ filesystem library - <filesystem>
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/adam/projects/vcpkg/buildtrees/_vcpkg/build
[0/2] Re-checking globbed directories...
[30/89] Building CXX object CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o
FAILED: CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DVCPKG_BASE_VERSION=2021-09-10 -DVCPKG_USE_STD_FILESYSTEM=1 -DVCPKG_VERSION=unknownhash -I/Users/adam/projects/vcpkg/buildtrees/_vcpkg/src/vcpkg-tool-2021-09-10/include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -std=c++17 -MD -MT CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o -MF CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o.d -o CMakeFiles/vcpkg.dir/src/vcpkg.cpp.o -c /Users/adam/projects/vcpkg/buildtrees/_vcpkg/src/vcpkg-tool-2021-09-10/src/vcpkg.cpp
/Users/adam/projects/vcpkg/buildtrees/_vcpkg/src/vcpkg-tool-2021-09-10/src/vcpkg.cpp:186:15: error: no member named 'setlocale' in the global namespace
        if (::setlocale(LC_ALL, utf8_locale))
            ~~^
/Users/adam/projects/vcpkg/buildtrees/_vcpkg/src/vcpkg-tool-2021-09-10/src/vcpkg.cpp:186:25: error: use of undeclared identifier 'LC_ALL'
        if (::setlocale(LC_ALL, utf8_locale))
                        ^
2 errors generated.
[43/89] Building CXX object CMakeFiles/vcpkglib.dir/src/vcpkg/binarycaching.cpp.o
ninja: build stopped: subcommand failed.

Additional context
XCode Command Line tools were installed with xcode-select --install

Metadata

Metadata

Labels

category:vcpkg-bugThe issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)requires:tool-releaseAn issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions