Skip to content

Select the Conan C++26 mode with an option - #455

Merged
Bronek merged 4 commits into
mainfrom
bronek/conan_packaging_fixes
Oct 14, 2026
Merged

Bronek merged 4 commits into
mainfrom
bronek/conan_packaging_fixes

Conversation

@Bronek

@Bronek Bronek commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Port the fixes from the Conan Center review of the libfn recipe (conan-io/conan-center-index#30871) to the in-repo conanfile.py, and tidy the README sections around packaging.

CMakeDeps links every component into the libfn::libfn aggregate. With fn_cxx26 as a component, any consumer linking libfn::libfn got LIBFN_CXX26 and, through the recipe's build module, C++26 without asking for either. A cxx26 option replaces the component: it selects the mode for the whole dependency graph, the profile's compiler.cppstd selects the standard, and libfn::fn_cxx26 becomes an alias of libfn::fn when the option is set.

Changes for Conan consumers:

  • Select the C++26 mode with -o "libfn/*:cxx26=True" and -s compiler.cppstd=26; without the option, libfn::fn_cxx26 does not exist.
  • Linking libfn::libfn no longer selects the mode.
  • The package provides libfn::version, as the CMake package does.
  • The recipe rejects compilers below the supported floors (GCC 12, Clang 19, Apple Clang 21, MSVC 2022), as the Conan Center recipe does with its own floors.

Other changes:

  • The recipe packages the headers through the CMake install rules, so its contents follow the install list.
  • test_package compiles a mode check against libfn::libfn, and no longer sets the C++ standard itself; it builds only if the package (or the Conan profile) supplies C++20.
  • The Linux Conan lane resolves the recipe's cmake tool requirement to the image's CMake: ConanCenter has no Linux arm64 cmake binary, so the lane would otherwise build cmake from source on every run.
  • README: Conan mode selection, which routes supply compile options and the C++ standard, and a merged versioning section.

Verified locally with gcc 16.2.1 and Conan 2.31.1: both Conan lanes pass; the mode check fails for a recipe that puts a fn_cxx26 component back and for one whose cxx26 option omits the define; the packaged headers match include/*.hpp. Through the installed CMake package and clang 22 (default C++17), test_package builds as C++20 and fails once the package's compile features are removed. The Windows lane is covered by CI only.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6.1-sol

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6.1-sol
CMakeDeps links every component into libfn::libfn, so the fn_cxx26
component also enabled LIBFN_CXX26 and C++26 on the aggregate target.
Use an explicit cxx26 option, following the Conan Center recipe review
(conan-io/conan-center-index#30871). The profile selects the language
standard, and libfn::fn_cxx26 becomes an alias when cxx26 is enabled.
Consumers that exchange fn types must use the same mode.

Package headers through CMake's install rules and provide the
libfn::version component. The test package checks that the aggregate's
LIBFN_CXX26 definition matches the option. Linux CI uses the image's
CMake to satisfy the recipe's tool requirement.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6.1-sol
Remove the consumer's explicit cxx_std_20 requirement so the test uses
libfn::fn's CMake usage requirement, or compiler.cppstd from the Conan
profile. Clarify this distinction in the README.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6.1-sol
@augmentcode

augmentcode Bot commented Oct 13, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Makes Conan C++26 mode selection explicit and aligns packaging with CMake.

  • Replaces the fn_cxx26 component with a default-off cxx26 option.
  • Avoids enabling the mode merely by linking the aggregate libfn::libfn target.
  • Validates C++20/C++26 requirements; the Conan profile selects the language standard.
  • Defines LIBFN_CXX26 on libfn::fn and conditionally exposes libfn::fn_cxx26 as an alias.
  • Adds libfn::version and aligns component dependencies and compiler options.
  • Configures CMake with tests disabled and packages headers through its install rules.
  • Removes installed CMake metadata so Conan-generated targets remain authoritative.
  • Adds an aggregate-mode check and derives test selection from the dependency option.
  • Updates Conan CI commands, Linux CMake resolution, packaging docs, and versioning guidance.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread conanfile.py Resolved
Mirror the Conan Center recipe, which restored its compiler table
after review, with main's floors; also drop the default includedirs.

Assisted-by: Claude:claude-opus-5-5
@sonarqubecloud

Copy link
Copy Markdown

@Bronek
Bronek merged commit 7106633 into main Oct 14, 2026
15 checks passed
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.

1 participant