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

MDEV-31963 Fix libfmt usage #2732

Merged
merged 3 commits into from
Aug 28, 2023
Merged

Conversation

ZhongRuoyu
Copy link
Contributor

  • The Jira issue number for this PR is: MDEV-31963

Description

As described in MDEV-31963, MariaDB fails to build with libfmt 10.1.0 because fmt::detail::make_arg no longer accepts temporaries. (See also: fmtlib/fmt#3596 (comment).) This PR fixes the code snippet that checks the system libfmt, and also the SFORMAT code that makes use of libfmt.

How can this PR be tested?

I do not think addition or modification to test cases is necessary; func_sformat.test should continue to pass.

To verify the fix, one could install libfmt 10.1.0 locally and build MariaDB 10.7 or later against that. I applied the changes to MariaDB 11.0.3 and 10.9.8 and can confirm that it fixes the build. For the examples in the SFORMAT documentation, the patched builds continue to provide the same results.

Basing the PR against the correct MariaDB version

  • This is a new feature and the PR is based against the latest MariaDB development branch.
  • This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced.

NB. This fix only applies to 10.7 and later since SFORMAT was added in 10.7.0. I based my branch on 10.10 as the final release (10.9.8) in the 10.9 series has been made.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

`fmt::detail::make_arg` does not accept temporaries, so the code snippet
checking system libfmt needs to be adjusted.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
@CLAassistant
Copy link

CLAassistant commented Aug 20, 2023

CLA assistant check
All committers have signed the CLA.

`fmt::detail::make_arg` does not accept temporaries. Make it happy by
storing the format arg values in a temporary array first.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
@grooverdan
Copy link
Member

Thank you @ZhongRuoyu

@grooverdan grooverdan merged commit cd5808e into MariaDB:10.10 Aug 28, 2023
13 checks passed
@ZhongRuoyu ZhongRuoyu deleted the libfmt-make_arg branch August 28, 2023 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants