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

[feature] Backport new msvc compiler settings to old build helpers and generators #10364

Closed
1 task done
SpaceIm opened this issue Jan 18, 2022 · 4 comments · Fixed by #10457
Closed
1 task done

[feature] Backport new msvc compiler settings to old build helpers and generators #10364

SpaceIm opened this issue Jan 18, 2022 · 4 comments · Fixed by #10457
Milestone

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 18, 2022

conan-center-index cannot ensure proper support of the new compiler msvc in settings.yml since all CCI recipes rely either on cmake + old CMake helper, or things like AutoToolsBuildEnvironment/MSBuild/VisualStudioBuildEnvironment/Meson helpers.

I've tested to support libsodium for example (conan-io/conan-center-index#8957).

It builds with these 2 profiles:

[settings]
os=Windows
arch=x86_64
compiler=Visual Studio
compiler.version=17
build_type=Release
[options]
[build_requires]
[env]
[settings]
os=Windows
arch=x86_64
compiler=msvc
compiler.version=193
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.cppstd=17
build_type=Release
[env]

But the second one reports some linking incoherency in CMake based test_package (and not the first one):

cl : command line warning D9002: ignoring unknown option '/dynamic' [D:\projects\conan-center-index\recipes\libsodium\all\test_package\build\186009612552ee0133c675206a8ad5077496a98d\test_package.vcxproj]
  test_package.c
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library [D:\projects\conan-center-index\recipes\libsodium\all\test_package\build\186009612552ee0133c675206a8ad5
077496a98d\test_package.vcxproj]
  test_package.vcxproj -> D:\projects\conan-center-index\recipes\libsodium\all\test_package\build\186009612552ee0133c675206a8ad5077496a98d\bin\test_package.exe
  Building Custom Rule D:/projects/conan-center-index/recipes/libsodium/all/test_package/CMakeLists.txt

So I guess there is some magic missing for this new compiler in old helpers or generators.

In this example I think there are 2 issues:

  • something wrong at build time of the library which leads to the warning in test package: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library (I guess that MSBuild has not properly honored compiler.runtime).
  • and another one in the old cmake generator or CMake helper in test package: ignoring unknown option '/dynamic'
@SpaceIm SpaceIm changed the title [feature] Backport new msvc compiler of settings to old build helpers and generators [feature] Backport new msvc compiler settings to old build helpers and generators Jan 18, 2022
@memsharded
Copy link
Member

It was never intended to backport the msvc compiler to the previous build system integrations, it is going to be supported only for the new integrations. The risk and the effort is too high for the value, it is simply not worth it, as we need to start moving to the new integrations anyway as soon as possible.

From now on, changes in the build system integrations will only be done for important bugs, but not new features like supporting the new msvc compiler setting (which cannot be tested anyway, because ConanCenter still uses the Visual Studio one).

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Jan 18, 2022

Therefore I think it is a bad user experience to create profile with compiler=msvc if conan detects Visual Studio 2022 in a fresh conan installation, specially for new comers. Because they will then complain in conan-center that conan doesn't work, which is understandable. The amount of work to move to new helpers in conan-center is huge, I don't think it can be even started now due to unstability of new helpers. Moreover, a period of backward compatibility will be needed.

@memsharded memsharded added this to the 1.45 milestone Jan 25, 2022
@memsharded
Copy link
Member

Let's fix the compiler=msvc => compiler=Visual Studio auto-detect until ConanCenter catches up supporting it.
But the previous build system integrations will not support msvc, only the new ones.

@memsharded
Copy link
Member

#10457 switched to detect VS 17 instead of msvc 193 for VS 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants