Open Todiq opened 12 months ago
Hi @Todiq !
Sorry about the delay. Could you check if it's still failing with the latest Conan release (2.0.16)?
Hello @juansblanco,
No worries. I managed to reproduce it with 2.0.16.
I have 2 profiles:
[settings]
arch={{detect_api.detect_arch()}}
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=193
os=Windows
&:build_type=Debug &:compiler=clang &:compiler.cppstd=17 &:compiler.version=16
[buildenv] &:PATH=+(path)C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/
[conf] &:tools.build:exelinkflags=["-fuse-ld=lld"] &:tools.build:sharedlinkflags=["-fuse-ld=lld"] &:tools.build:skip_test=False &:tools.env.virtualenv:powershell=True &:tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
- windows-msvc-debug:
```txt
[settings]
arch={{detect_api.detect_arch()}}
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=193
os=Windows
&:build_type=Debug
&:compiler.cppstd=17
[conf]
&:tools.build:skip_test=False
&:tools.env.virtualenv:powershell=True
&:tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
This issue happens whenever I first run conan build .\project --profile:all "windows-clang-debug"
, then conan build .\core --profile:all "windows-msvc-debug"
It does not come from an overlapping of build folders. In fact, here my layout()
method:
def layout(self):
self.folders.build_folder_vars = ["settings.os", "settings.compiler", "settings.compiler.version", "settings.arch"]
cmake_layout(self)
Which means I have both project\build\windows-clang-16-x86_64
and project\build\windows-msvc-193-x86_64
in my workspace.
Please tell me if you need further information
I confirm this keeps happening on 2.4.1 when switching between generators (MSBuild & Ninja)
Hi @Todiq
I am trying to reproduce, but no success so far. I am running in a regular cmd windows, not a powershell one, I don't know if this could be a difference.
The profiles above are not really changing generators in both cases clang/msvc it is always using Ninja Multi-Config
, am I missing something?
Hi @Todiq any update here? I couldn't reproduce and it wasn't very clear the generators as always using Ninja Multi-Config
@memsharded
I’ll try to reproduce it. But it’s been a random issue for me. I’m gonna give it a shot before 2.5.0
goes out
@memsharded
I have been unable to reproduce it consistently. It always happens randomly.
The quick fix that always works is to kill the powershell that was running the conan build
and start with a fresh one.
If that can help, I am using Visual Studio 2022 Developer PowerShell v17.10.5
and use conan from a virtualenv:
version: 2.6.0
conan_path: D:\venv\Scripts\conan
python
version: 3.9.13
sys_version: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
sys_executable: D:\venv\Scripts\python.exe
is_frozen: False
architecture: AMD64
system
version: 10.0.22631
platform: Windows-10-10.0.22631-SP0
system: Windows
release: 10
cpu: Intel64 Family 6 Model 186 Stepping 3, GenuineIntel
My msvc profile is now the following:
{% set os = detect_api.detect_os() %}
{% if os == "Windows" %}
{% set compiler, version, compiler_exe = detect_api.detect_msvc_compiler() %}
{% else %}
{% set compiler = "msvc" %}
{% set version = "194" %}
{% endif %}
[settings]
arch={{detect_api.detect_arch()}}
build_type=Release
compiler={{compiler}}
compiler.cppstd=17
compiler.runtime=dynamic
compiler.version={{version}}
os=Windows
cast*/*:compiler.cppstd=17
[conf]
{% if os == "Windows" %}
pkg*/*:tools.env.virtualenv:powershell=True
{% endif %}
pkg*/*:tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
pkg*/*:tools.cmake.cmake_layout:build_folder_vars = ["settings.os", "settings.compiler", "settings.compiler.version", "settings.arch"]
Just happened after deleting the build
folder and the CMakeUserPreset.json
file:
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.4
[vcvarsall.bat] Environment initialized for: 'x64'
-- Using Conan toolchain: D:/core/build/windows-msvc-194-x86_64/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$<CONFIG:Release>:MultiThreadedDLL>
-- Conan toolchain: C++ Standard 17 with extensions OFF
-- Conan toolchain: Setting BUILD_SHARED_LIBS = ON
-- The CXX compiler identification is MSVC 19.40.33813.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:60 (message):
The C++ compiler
"C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'D:/core/build/windows-msvc-194-x86_64/CMakeFiles/CMakeScratch/TryCompile-msi59b'
Run Build Command(s): D:/venv/Scripts/ninja.exe -v cmTC_754d3
ninja: error: CMakeFiles\common.ninja:23: loading 'CMakeFiles\rules.ninja': Le fichier spécifié est introuvable.
include CMakeFiles\rules.ninja
^ near here
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
ERROR: conanfile.py (castcore/0.1): Error in build() method, line 130
cmake.configure()
ConanException: Error 1 while executing
I though it would only happen when there is a conflict in the build folder between two subfolders (one generated with Ninja, the other with Ninja Multi-Config), but apparently not
Environment details
Steps to reproduce
conan new cmake_lib -d name=hello -d version=1.0
conan build .
This issue must be related to (or consequence of) https://github.com/conan-io/conan/issues/14765/
Logs