From: Nam Nguyen Subject: Re: [libcxx22] fallout To: Rafael Sadowski Cc: ports@openbsd.org Date: Fri, 28 Aug 2026 00:40:55 -0700 Rafael Sadowski writes: > On Fri Aug 21, 2026 at 02:15:34PM +0200, Theo Buehler wrote: >> Here is the directly libcxx22-related breakage of my first bulk. >> >> There may be a few more because mono got stuck with a weird error. And >> I did not try to build the V8 monsters: codex, deno, chromiums and a few >> others because my machine isn't beefy enough. I don't think anything >> super important is directly affected or hiding behind those. So as far >> as ports are concerned, I think we can land libcxx22 whenever we want: >> >> audio/ncmpcpp >> audio/rubberband >> cad/freecad >> databases/mongodb/44 >> games/cataclysm-dda >> games/dxx-rebirth >> games/flightgear/base >> games/keeperrl >> mail/kopano/core >> misc/subsurface >> shells/fish/v3 >> textproc/lttoolbox >> >> There are basically two main classes of failures: comparison operators >> and locale things and a few odd ones like fish/v3 and >> >> audio/ncmpcpp >> /usr/include/c++/v1/__algorithm/sift_down.h:49:39: error: no matching function for call to object of type 'LocaleBasedSorting' >> 49 | } else if ((__child + 1) < __len && __comp(__first[__child], __first[__child + 1])) { >> | ^~~~~~ >> > > The lambdas are more or less a workaround from me. > > I think, the much cleaner fix would be to teach LocaleBasedSorting to > handle all this, but that means digging even depper into the Boost > lib. I don't want go this way. Anyone? I tested adding items to playlist and opening the tag editor and it hit both codepaths. Types match up. browser.cpp uses stable_sort so it is different. It is a bit strange that PlaylistEditor::update() has the old style and it works fine: std::sort(Playlists.beginV(), Playlists.endV(), LocaleBasedSorting(std::locale(), Config.ignore_leading_the)); Playlists = NC::Menu bool operator()(const MPD::Playlist &a, const MPD::Playlist &b) const { ok namn@ > > diff --git a/audio/ncmpcpp/patches/patch-src_screens_sel_items_adder_cpp b/audio/ncmpcpp/patches/patch-src_screens_sel_items_adder_cpp > new file mode 100644 > index 00000000000..8f4ca627847 > --- /dev/null > +++ b/audio/ncmpcpp/patches/patch-src_screens_sel_items_adder_cpp > @@ -0,0 +1,16 @@ > +Fix build with libc++22: Boost operator[] proxy breaks template argument > +deduction in LocaleBasedSorting. > +Index: src/screens/sel_items_adder.cpp > +--- src/screens/sel_items_adder.cpp.orig > ++++ src/screens/sel_items_adder.cpp > +@@ -254,7 +254,9 @@ void SelectedItemsAdder::populatePlaylistSelector(Base > + )); > + }; > + std::sort(m_playlist_selector.beginV()+begin, m_playlist_selector.endV(), > +- LocaleBasedSorting(std::locale(), Config.ignore_leading_the)); > ++ [cmp = LocaleBasedSorting(std::locale(), Config.ignore_leading_the)] > ++ (const Entry &a, const Entry &b) { return cmp(a, b); }); > ++ > + if (begin < m_playlist_selector.size()) > + m_playlist_selector.addSeparator(); > + } > diff --git a/audio/ncmpcpp/patches/patch-src_screens_tag_editor_cpp b/audio/ncmpcpp/patches/patch-src_screens_tag_editor_cpp > new file mode 100644 > index 00000000000..24a6fa9d851 > --- /dev/null > +++ b/audio/ncmpcpp/patches/patch-src_screens_tag_editor_cpp > @@ -0,0 +1,16 @@ > +Fix build with libc++22: Boost operator[] proxy breaks template argument > +deduction in LocaleBasedSorting. > +Index: src/screens/tag_editor.cpp > +--- src/screens/tag_editor.cpp.orig > ++++ src/screens/tag_editor.cpp > +@@ -289,7 +289,9 @@ void TagEditor::update() > + Dirs->highlight(Dirs->size()-1); > + }; > + std::sort(Dirs->beginV()+1, Dirs->endV(), > +- LocaleBasedSorting(std::locale(), Config.ignore_leading_the)); > ++ [cmp = LocaleBasedSorting(std::locale(), Config.ignore_leading_the)] > ++ (const std::pair &a, > ++ const std::pair &b) { return cmp(a, b); }); > + Dirs->display(); > + } > +