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

clang-cl compiler not found on Windows #1152

Closed
1 of 6 tasks
jsmolka opened this issue Jun 30, 2020 · 5 comments
Closed
1 of 6 tasks

clang-cl compiler not found on Windows #1152

jsmolka opened this issue Jun 30, 2020 · 5 comments
Assignees
Labels
Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows

Comments

@jsmolka
Copy link

jsmolka commented Jun 30, 2020

Describe the bug
No CMAKE_CXX_COMPILER could be found. when trying to build with clang-cl with cmake on Windows.

Area for Triage:
C/C++

Question, Bug, or Feature?:
Bug

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Ubuntu 20.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Expected behavior
I am contributing to a C++ project where we use GitHub actions for automated builds. 19 days ago the Windows builds passed without any problem (link to action). Now, the same commit causes build errors on Windows (link to action).

These are the problematic commands in the cmake file:

mkdir build
cd build
set VCPKG_ROOT=C:/vcpkg
cmake -DCMAKE_BUILD_TYPE=Release -T clangcl ..

Which gives the following output:

-- Building for: Visual Studio 16 2019
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:8 (project):
  No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "D:/a/NanoboyAdvance/NanoboyAdvance/build/CMakeFiles/CMakeOutput.log".
See also "D:/a/NanoboyAdvance/NanoboyAdvance/build/CMakeFiles/CMakeError.log".
##[error]Process completed with exit code 1.

Somehow the compiler is not recognized in the GitHub actions environment (on my machine everything is working). Passing the clang-cl binary via the CMAKE_CXX_COMPILER flag mitigates the problem to some degree but causes other build errors.

Actual behavior
The build errors started happening around 3 days ago (see the commit history). Nothing which could cause the error has been changed in the cmake file.

@Darleev
Copy link
Contributor

Darleev commented Jun 30, 2020

Hello @jsmolka,
The issue probably can be related to the previously reported. Could you please try the same workaround by adding the following task before cmake:

rmdir /s /q C:\PROGRA~1\POSTGR~1

Looking forward to your reply.

@Darleev Darleev added Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows and removed needs triage labels Jun 30, 2020
@jsmolka
Copy link
Author

jsmolka commented Jun 30, 2020

I changed the part to

mkdir build
cd build
set VCPKG_ROOT=C:/vcpkg
rmdir /s /q C:\PROGRA~1\POSTGR~1
cmake -DCMAKE_BUILD_TYPE=Release -T clangcl ..

but the errors still persists (action run).

@Darleev
Copy link
Contributor

Darleev commented Jun 30, 2020

@jsmolka
Thank you for the information provided.
We will investigate the issue.

@vsafonkin
Copy link
Contributor

vsafonkin commented Jul 6, 2020

Hi @jsmolka , looks like the latest release of vcpkg has changes that broken your build. I've tried to downgrade vcpkg to the previous release and build was successful: run action

As a workaround you can reinstall vcpkg adding next step:

- name: Setup vcpkg
  run: |
    Remove-Item "C:\vcpkg" -Recurse -Force
    $Uri = 'https:/Microsoft/vcpkg.git'
    $InstallDir = 'C:\vcpkg'

    git clone -b 2020.04 --single-branch --depth=1 $Uri $InstallDir -q

    Invoke-Expression "$InstallDir\bootstrap-vcpkg.bat"
    vcpkg integrate install

The detailed build log contains message about error:

lld-link : error : could not open 'C:\vcpkg\installed\x64-windows\debug\lib\*.lib': invalid argument

The problem is clang linker lld-link is failed during autolinking with installed vcpkg packages. This old issue in vcpkg that fixed it but this fix is not working after the latest vcpkg release.
I believe, make sense to create issue in vcpkg repository to report about this bug.

@jsmolka
Copy link
Author

jsmolka commented Jul 6, 2020

Thanks for investigating the issue. I will open a new one in vcpkg and see it if can be resolved there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows
Projects
None yet
Development

No branches or pull requests

3 participants