Skip to content

cmake: ensure fmt lib is at least 8.1.1#48705

Merged
idryomov merged 1 commit intoceph:mainfrom
theanalyst:cmake-fmt-versionbump
Aug 14, 2023
Merged

cmake: ensure fmt lib is at least 8.1.1#48705
idryomov merged 1 commit intoceph:mainfrom
theanalyst:cmake-fmt-versionbump

Conversation

@theanalyst
Copy link
Copy Markdown
Member

@theanalyst theanalyst commented Nov 2, 2022

Since we depend on newer api features like group_digits ensure that the system version of fmt we use is at least as new as the submodules we bring.

Signed-Off-By: Abhishek Lekshmanan abhishek.l@cern.ch

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@theanalyst
Copy link
Copy Markdown
Member Author

There is ceph.spec.in also where we set fmt-devel >= 6.3.1, I suppose this can also be changed? But not so sure if many distros package such a newer version.

@Matan-B
Copy link
Copy Markdown
Contributor

Matan-B commented Nov 10, 2022

There is ceph.spec.in also where we set fmt-devel >= 6.3.1, I suppose this can also be changed? But not so sure if many distros package such a newer version.

Let's update ceph.spec.in as well since we already introduced fmtlib 8.1 features. @ronen-fr

@Matan-B Matan-B self-requested a review November 10, 2022 11:13
@theanalyst
Copy link
Copy Markdown
Member Author

There is ceph.spec.in also where we set fmt-devel >= 6.3.1, I suppose this can also be changed? But not so sure if many distros package such a newer version.

Let's update ceph.spec.in as well since we already introduced fmtlib 8.1 features. @ronen-fr

So tried this on my centos8 box and here since we don't have system packages of fmtlib > 8.1.1 the install-deps step fails. Don't know what the current distro support matrix is for master (I see fc36 packages newer version), but since we do use fmt as a submodule and anyway can build regardless of system packages don't know whether it is worth failing install-deps. Happy to update ceph.spec.in or keep this pr as it is based on the opinion here.

@yehudasa
Copy link
Copy Markdown
Member

I ran into this issue now. This will fix compilation, but my question is whether the original usage of fmt::group_digits() is worth dropping a system package in favor of the submodule version. We should at least figure out which systems that would affect. I think the original change can be easily adapted to avoid the need for the package upgrade.

@github-actions
Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@tchaikov tchaikov changed the title cmake: ensure fmt lib is atleast 8.1.1 cmake: ensure fmt lib is at least 8.1.1 Dec 19, 2022
@rzarzynski
Copy link
Copy Markdown
Contributor

From core PR scrub: @ktdreyer would you mind taking a look? It seems this PR pokes with packages we need to install.

@ktdreyer
Copy link
Copy Markdown
Contributor

ktdreyer commented Jul 3, 2023

I'm sorry, I cannot review this PR now with my other priorities

Copy link
Copy Markdown
Contributor

@ktdreyer ktdreyer left a comment

Choose a reason for hiding this comment

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

I've made time to look at this today, since I've hit this build failure myself.

../src/osd/scrubber/osd_scrub_sched.cc:552:24: error: ‘group_digits’ is not a member of ‘fmt’
            fmt::group_digits(conf()->osd_scrub_max_interval),

On RHEL 8:

  • fmt is in EPEL 8, fmt-6.2.1-1.el8
  • In an el8 build: -DWITH_FMT_HEADER_ONLY:BOOL=ON leads to Could not find fmt, will build it

On RHEL 9:

  • fmt is in EPEL 9, fmt-8.1.1-5.el9
  • In an el9 build, -DWITH_FMT_HEADER_ONLY:BOOL=ON uses the system package, though CMake's find_package() does not print the version it successfully found (maybe the QUIET option hides that success output?)

I'm good with merging this and backporting to reef.

Separately, I do think the version mis-match in ceph.spec.in is confusing (7.0.0 and 8.1.1 here in CMake vs 6.2.1 in ceph.spec.in). If we bump that number in the RPM packaging, though, then we'll fail to build on el8, since EPEL 8 will no longer be able to satisfy that. My recommendation (separate PR!) is:

@ronen-fr
Copy link
Copy Markdown
Contributor

@ktdreyer

  • Better yet, drop el8 altogether for main

I'm wholeheartedly for that.
Note that when discussed in some meetings, the question that was raised was
how dropping centos 8 affects old RHEL support.

@ktdreyer
Copy link
Copy Markdown
Contributor

@ronen-fr Do you mind giving your approval on this PR so we can merge it to main?

@ktdreyer
Copy link
Copy Markdown
Contributor

@theanalyst could you rebase this onto the latest main?

@rosinL
Copy link
Copy Markdown
Member

rosinL commented Jul 24, 2023

Separately, I do think the version mis-match in ceph.spec.in is confusing (7.0.0 and 8.1.1 here in CMake vs 6.2.1 in ceph.spec.in).

yeah, It is really confusing.

On RHEL 8:
fmt is in EPEL 8, fmt-6.2.1-1.el8
In an el8 build: -DWITH_FMT_HEADER_ONLY:BOOL=ON leads to Could not find fmt, will build it

Why not always building the fmt?
As I remove BuildRequires: fmt-devel >= 6.2.1 from ceph.spec and remove the fmt-devel packages(as many packages depend on fmt, so keep it), ceph building works fine, so I think the BuildRequires of fmt-devel in ceph.spec.in is not really needed.

@tchaikov
Copy link
Copy Markdown
Contributor

tchaikov commented Jul 24, 2023

Separately, I do think the version mis-match in ceph.spec.in is confusing (7.0.0 and 8.1.1 here in CMake vs 6.2.1 in ceph.spec.in).

yeah, It is really confusing.

On RHEL 8:
fmt is in EPEL 8, fmt-6.2.1-1.el8
In an el8 build: -DWITH_FMT_HEADER_ONLY:BOOL=ON leads to Could not find fmt, will build it

Why not always building the fmt? As I remove BuildRequires: fmt-devel >= 6.2.1 from ceph.spec and remove the fmt-devel packages(as many packages depend on fmt, so keep it), ceph building works fine, so I think the BuildRequires of fmt-devel in ceph.spec.in is not really needed.

i think the idea is to respect the philosophy of how the downstream distributions are structured. in general, package maintainers are encouraged to reuse the the shared libraries and facilities shipped along with the distribution instead of vendering by the packages themselves. have you imagined a distribution full of with packages each of which embeds their own libc? the same applies to other 3rd party libraries like fmtlib. there are more reasons for sure, among other things, like better maintainability like a bug in shared library can be fixed right away, without requiring "make world".

@ktdreyer
Copy link
Copy Markdown
Contributor

Right @tchaikov . Also, pre-built packages lower Ceph's build times.

Since we depend on newer api features like `group_digits` ensure that the system
version of fmt we use is at least as new as the submodules we bring.

Signed-off-by: Abhishek Lekshmanan <abhishek.l@cern.ch>
@theanalyst theanalyst force-pushed the cmake-fmt-versionbump branch from d3556f7 to eead42d Compare July 26, 2023 08:25
@theanalyst
Copy link
Copy Markdown
Member Author

@theanalyst could you rebase this onto the latest main?

done!

@ronen-fr
Copy link
Copy Markdown
Contributor

jenkins test make check

@tchaikov tchaikov mentioned this pull request Aug 12, 2023
14 tasks
@idryomov
Copy link
Copy Markdown
Contributor

jenkins test make check

@idryomov idryomov merged commit 2f4720d into ceph:main Aug 14, 2023
Copy link
Copy Markdown
Contributor

@idryomov idryomov left a comment

Choose a reason for hiding this comment

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

I went ahead and merged since this has been pending for months. Highlighting Ken's recommendation:

Separately, I do think the version mis-match in ceph.spec.in is confusing (7.0.0 and 8.1.1 here in CMake vs 6.2.1 in ceph.spec.in). If we bump that number in the RPM packaging, though, then we'll fail to build on el8, since EPEL 8 will no longer be able to satisfy that. My recommendation (separate PR!) is:

@idryomov
Copy link
Copy Markdown
Contributor

Opened a reef backport since fmt::group_digits is used there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants