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

Remove path from tools.build:compiler_executables #640

Closed

Conversation

ssrobins
Copy link
Contributor

@ssrobins ssrobins commented May 9, 2024

@@ -312,14 +312,16 @@ macro(append_compiler_executables_configuration)
set(_conan_c_compiler "")
set(_conan_cpp_compiler "")
if(CMAKE_C_COMPILER)
set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\",")
get_filename_component(_c_compiler_name ${CMAKE_C_COMPILER} NAME)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid this could be a problem.
There are users that can set the full path to a compiler in a toolchain file or the like. It is necessary that compiler_executables will contain the full path here, so dependencies will also be able to use it, otherwise they might fail.

I think the fact that Meson doesn't work with the full path to cl.exe because it contains spaces (from conan-io/conan#16212) is not enough for this change.

In any case, we could discuss if we wanted to reduce this for MSVC cl.exe exclusively, but not for other compilers, will ask @jcar87 for feedback. And then we probably still need a fix in Meson so it doesn't fail with path with spaces there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, even for MSVC it's not uncommon to have multiple copies of cl.exe (via different toolsets, different architectures, or Side-by-side Minor Version MSVC Toolsets, so the full path matters.

@memsharded memsharded requested a review from jcar87 May 9, 2024 09:44
@ssrobins
Copy link
Contributor Author

ssrobins commented Jun 6, 2024

I confirmed that with the fix from conan-io/conan#16212, this change is rendered obsolete. And from the comments, that's good because it sounds like it wouldn't have worked anyway. Thanks as always for the great community support! Closing this.

@ssrobins ssrobins closed this Jun 6, 2024
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 this pull request may close these issues.

3 participants