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

[R-package] CRAN warnings about use of 'char_traits<fmt::detail::char8_type>' #6264

Closed
jameslamb opened this issue Jan 11, 2024 · 3 comments · Fixed by #6265
Closed

[R-package] CRAN warnings about use of 'char_traits<fmt::detail::char8_type>' #6264

jameslamb opened this issue Jan 11, 2024 · 3 comments · Fixed by #6265
Assignees

Comments

@jameslamb
Copy link
Collaborator

jameslamb commented Jan 11, 2024

Description

I received the following email from CRAN today. They found a warning raised when {lightgbm} is compiled with clang-18, and are giving us 14 days to fix it or risk the project being archived.

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_lightgbm.html.

Please correct before 2024-01-24 to safely retain your package on CRAN.

Do remember to look at the 'Additional issues'.

The CRAN Team

That is about this compilation warning:

/usr/local/clang-trunk/bin/clang++ -std=gnu++17 -I"/data/gannet/ripley/R/R-clang-trunk/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DEIGEN_DONT_PARALLELIZE -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD  -isystem /usr/local/clang-trunk/include -I/usr/local/clang/include   -fopenmp -pthread -fpic  -O3 -Wall -pedantic -frtti -Wp,-D_FORTIFY_SOURCE=3  -c treelearner/serial_tree_learner.cpp -o treelearner/serial_tree_learner.o
In file included from treelearner/linear_tree_learner.cpp:5:
In file included from treelearner/linear_tree_learner.h:8:
In file included from /usr/local/clang-trunk/bin/../include/c++/v1/string:625:
In file included from /usr/local/clang-trunk/bin/../include/c++/v1/string_view:213:
/usr/local/clang-trunk/bin/../include/c++/v1/__fwd/string_view.h:22:41: warning: 'char_traits<fmt::detail::char8_type>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]
   22 | template <class _CharT, class _Traits = char_traits<_CharT> >
      |                                         ^
./include/LightGBM/fmt/core.h:344:26: note: in instantiation of default argument for 'basic_string_view<fmt::detail::char8_type>' required here
  344 | template <typename Char> using std_string_view = std::basic_string_view<Char>;
      |                          ^~~~~
./include/LightGBM/fmt/core.h:435:50: note: in instantiation of template type alias 'std_string_view' requested here
  435 |                                       S, detail::std_string_view<Char>>::value)>
      |                                                  ^
./include/LightGBM/fmt/format.h:777:57: note: in instantiation of template class 'fmt::basic_string_view<fmt::detail::char8_type>' requested here
  777 | inline auto compute_width(basic_string_view<char8_type> s) -> size_t {
      |                                                         ^
/usr/local/clang-trunk/bin/../include/c++/v1/__string/char_traits.h:81:8: note: 'char_traits<fmt::detail::char8_type>' has been explicitly marked deprecated here
   81 | struct _LIBCPP_DEPRECATED_(
      |        ^
/usr/local/clang-trunk/bin/../include/c++/v1/__config:933:53: note: expanded from macro '_LIBCPP_DEPRECATED_'
  933 | #      define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
      |                                                     ^

(R CMD check logs from CRAN)

Reproducible example

This is happening on CRAN's builds with clang-18: https://www.stats.ox.ac.uk/pub/bdr/clang18/lightgbm.log

I'll try to add CI here that reproduces it. CRAN's "Additional Issues" documentation (link) says the following for clang-18:

Tests as for the main fedora-clang checks but using LLVM pre-18
including flang-new as the Fortran compiler.
Other details as for 
https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang .

Environment info

LightGBM version or commit hash: v4.2.0

Additional Comments

Trying to reproduce this might benefit from #6116.

Related conversations about this warning:

@jameslamb
Copy link
Collaborator Author

Assigned this to myself. I'm investigating it right now.

Anyone else reading this... please do post if you have ideas!

@jameslamb
Copy link
Collaborator Author

Decided to leave this open until we see a new release to CRAN pass checks.

@jameslamb
Copy link
Collaborator Author

Happy to say v4.3.0, which contains the fix from #6265, has been accepted to CRAN.

It's passing all but one checks (just waiting for r-patched-linux-x86_64 to run), and the clang18 warning is no longer shown there.

https://cran.r-project.org/web/checks/check_results_lightgbm.html

This can be closed.

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.

1 participant