Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fmt] build failure: clang++: error: no such file or directory: '/utf-8' #40912

Open
marleeeeeey opened this issue Sep 11, 2024 · 1 comment · May be fixed by #40944
Open

[fmt] build failure: clang++: error: no such file or directory: '/utf-8' #40912

marleeeeeey opened this issue Sep 11, 2024 · 1 comment · May be fixed by #40944
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@marleeeeeey
Copy link

marleeeeeey commented Sep 11, 2024

Operating system

Windows 11 23H2 (OS Build 22631.4037)

Compiler

clang version 18.1.8
cmake version 3.30.3

Steps to reproduce the behavior

Step 1. cmake configure

Commands:

git clone --branch 2024.08.23 --single-branch https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install --triplet=x64-windows

cmake -S . -B build --preset use_vcpkg -GNinja -DCMAKE_CXX_COMPILER=clang++ --trace

Output:

Pay attention to this argument: \$<\$<COMPILE_LANGUAGE:CXX>:/utf-8>.
Looks like error comes from: vcpkg\ports\folly\fix-fmt11-cmake.patch:
string(REPLACE "<$<COMPILE_LANGUAGE:CXX>:/utf-8>" "/utf-8" cflags "${cflags}")

C:/dev/vcpkg_error_minimal_example/build/vcpkg_installed/x64-windows/share/fmt/fmt-targets.cmake(60):  set_target_properties(fmt::fmt PROPERTIES INTERFACE_COMPILE_DEFINITIONS FMT_SHARED INTERFACE_COMPILE_FEATURES cxx_std_11 INTERFACE_COMPILE_OPTIONS \$<\$<COMPILE_LANGUAGE:CXX>:/utf-8> INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/include )

Step 2. cmake build -> error

Commands:

cmake --build build -- -k 0

Output:

[1/2] Building CXX object CMakeFiles/main_cpp.dir/main.cpp.obj
FAILED: CMakeFiles/main_cpp.dir/main.cpp.obj
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -isystem C:/dev/vcpkg_error_minimal_example/build/vcpkg_installed/x64-windows/include -O0 -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd /utf-8 -MD -MT CMakeFiles/main_cpp.dir/main.cpp.obj -MF CMakeFiles\main_cpp.dir\main.cpp.obj.d -o CMakeFiles/main_cpp.dir/main.cpp.obj -c C:/dev/vcpkg_error_minimal_example/main.cpp
clang++: error: no such file or directory: '/utf-8'
ninja: build stopped: cannot make progress due to previous errors.

Files

CMakePreset.json

{
    "version": 8,
    "configurePresets": [
        {
            "name": "use_vcpkg",
            "cacheVariables": {
                "CMAKE_TOOLCHAIN_FILE": "vcpkg/scripts/buildsystems/vcpkg.cmake"
            }
        }
    ]
}

vcpkg.json

{
  "dependencies": [
    "spdlog"
  ]
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.15)
project(main_cpp)
find_package(spdlog CONFIG REQUIRED)
add_executable(main_cpp main.cpp)
target_link_libraries(main_cpp PRIVATE spdlog::spdlog)

main.cpp

int main() {}

Failure logs

[1/2] Building CXX object CMakeFiles/main_cpp.dir/main.cpp.obj
FAILED: CMakeFiles/main_cpp.dir/main.cpp.obj
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -isystem C:/dev/vcpkg_error_minimal_example/build/vcpkg_installed/x64-windows/include -O0 -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd /utf-8 -MD -MT CMakeFiles/main_cpp.dir/main.cpp.obj -MF CMakeFiles\main_cpp.dir\main.cpp.obj.d -o CMakeFiles/main_cpp.dir/main.cpp.obj -c C:/dev/vcpkg_error_minimal_example/main.cpp
clang++: error: no such file or directory: '/utf-8'
ninja: build stopped: cannot make progress due to previous errors.

Additional context

No response

@marleeeeeey marleeeeeey added the category:port-bug The issue is with a library, which is something the port should already support label Sep 11, 2024
@JonLiu1993
Copy link
Member

Fixing by #40944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants