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

[bug] profile detect does not try to use the compiler provided #15399

Closed
Ignition opened this issue Jan 5, 2024 · 3 comments · Fixed by #15418
Closed

[bug] profile detect does not try to use the compiler provided #15399

Ignition opened this issue Jan 5, 2024 · 3 comments · Fixed by #15418
Assignees
Milestone

Comments

@Ignition
Copy link
Contributor

Ignition commented Jan 5, 2024

Environment details

  • Operating System+version: Ubuntu 22.04.3 LTS
  • Compiler+version: Ubuntu clang version 17.0.6
  • Conan version: Conan version 2.0.16
  • Python version: Python 3.10.12

Steps to reproduce

CC=clang-17 CXX=clang++-17 conan profile detect
I would expect it to use clang++-17 when detecting libcxx

Logs

detect_api: CC and CXX: clang-17, clang++-17 
detect_api: Found clang 17.0
detect_api: clang>=8, using the major as version
detect_api: WARN: compiler.libcxx check error: /bin/sh: 1: clang++: not found
...
@memsharded memsharded added this to the 2.1 milestone Jan 5, 2024
@memsharded
Copy link
Member

Hi @Ignition

Thanks for your report.
Yes, it seems that there could be a bug there, and the detection should be using CC/CXX defined compiler.

@memsharded
Copy link
Member

@RubenRBS I am having a look how this could be improved:

  • Breaking the detect_api interface, and make "detect_compiler" return: compiler, version, compiler_exe = detect_compiler(), so we can pass the compiler_exe as optional argument to detect_libcxx and others
  • Make it optional to not break with detect_compiler(return_compiler_exe=True)
  • Extract and re-use the logic that checks CC/CXX env-vars and call it again inside the detect_libcxx call. Not super robust, but doable

@AbrilRBS AbrilRBS modified the milestones: 2.1, 2.0.17 Jan 9, 2024
@AbrilRBS AbrilRBS linked a pull request Jan 9, 2024 that will close this issue
@czoido
Copy link
Contributor

czoido commented Jan 10, 2024

Closed by #15418 that add new detect_default_compiler function.
Should be release very soon in 2.0.17

@czoido czoido closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants