conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
969 stars 1.78k forks source link

[package] boost/* wrong -std targeting c++20 with gcc/clang #25702

Open lukester1975 opened 1 month ago

lukester1975 commented 1 month ago

Description

def _cppstd_flag(self, compiler_cppstd=None):
...
 cppstd_flags.setdefault("17", "17" if clang_version >= "5" else "1z" if clang_version >= "3.5" else None)
 cppstd_flags.setdefault("20", "2a" if clang_version >= "6" else "20" if clang_version >= "12" else None)
 cppstd_flags.setdefault("23", "2b" if clang_version >= "13"  else "23" if clang_version >= "17" else None)

Those last two are somewhat pessimistic... Same problem with gcc for c++20:

cppstd_flags.setdefault("20", "2a" if gcc_version >= "8" else "20" if gcc_version >= "12" else None)

I can create a trivial PR (from https://github.com/lukester1975/conan-center-index/tree/fix-boost-clang-std) but given the comment "Replace it by Conan tool when available: https://github.com/conan-io/conan/issues/12603" (and https://github.com/conan-io/conan/issues/12603) maybe something else is preferred?

Thanks

Package and Environment Details

n/a

Conan profile

n/a

Steps to reproduce

n/a

Logs

n/a

AbrilRBS commented 2 weeks ago

@lukester1975 thanks a lot for the report - We're going to implement this fix (using Conan provided flags instead of the recipe mapping it itself) in a PR for boost alongside some other changes, which will take a bit, thanks a lot for your report :)

uilianries commented 2 weeks ago

Boost recipe is one of most challenging recipes in CCI, we still do not have generators for B2, so any command should be parsed manually, including cppstd.

With Conan 2.x mandatory and default support now, we can simplify many parts of that recipe, including this current bug. Please, be aware we are only looking for Conan 2.x support now, as reporting some ago: https://github.com/conan-io/conan-center-index/discussions/25461

lukester1975 commented 2 weeks ago

FWIW this causes cobalt not to build (sorry, I should've said that originally). I.e. it's not just a cosmetic thing - so I imagine a fix should go in sooner rather than later!

uilianries commented 2 weeks ago

FWIW this causes cobalt not to build (sorry, I should've said that originally). I.e. it's not just a cosmetic thing - so I imagine a fix should go in sooner rather than later!

Totally fine, I prefer separated issues/PRs personally, easier to mitigate and work on. Plus, changing a single line in Boost recipe is always fragile.

lukester1975 commented 2 weeks ago

Sorry, I'm not sure what's being suggested now - should I just close this or do you want a PR to fix the 3 lines?

Thanks