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

harfbuzz-icu fails to build with ICU 75 #4671

Open
dschepler opened this issue Apr 19, 2024 · 5 comments
Open

harfbuzz-icu fails to build with ICU 75 #4671

dschepler opened this issue Apr 19, 2024 · 5 comments

Comments

@dschepler
Copy link

The error I'm getting is:

FAILED: src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o 
c++ -Isrc/libharfbuzz-icu.so.0.60840.0.p -Isrc -I../../src -I. -I../.. -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++11 -fno-exceptions -O3 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -fPIC -Wno-non-virtual-dtor -MD -MQ src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o -MF src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o.d -o src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o -c ../../src/hb-icu.cc
In file included from /usr/include/unicode/uset.h:36,
                 from /usr/include/unicode/unorm2.h:35,
                 from ../../src/hb-icu.cc:39:
/usr/include/unicode/localpointer.h:561:26: error: parameter declared 'auto'
  561 | template <typename Type, auto closeFunction>
      |                          ^~~~
/usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid
  573 |     explicit LocalOpenPointer(std::unique_ptr<Type, decltype(closeFunction)> &&p)
      |                                                                            ^
/usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid
  583 |     LocalOpenPointer &operator=(std::unique_ptr<Type, decltype(closeFunction)> &&p) {
      |                                                                              ^
/usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid
  599 |     operator std::unique_ptr<Type, decltype(closeFunction)> () && {
      |                                                           ^
/usr/include/unicode/uset.h:358:1: note: invalid template non-type parameter
  358 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/unorm2.h:286:1: note: invalid template non-type parameter
  286 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Maybe the new ICU version requires a newer C++ standard?

@behdad
Copy link
Member

behdad commented Apr 19, 2024

Yeah, that looks like C++17.

@Eltharion
Copy link

I confirm, had the same error. Compiling harfbuzz 8.4.0 with icu 75.1 using g++ 13.2.0 (MSYS2). Added "-Dcpp_std=c++17 " to the meson setup line and everything compiles fine again...

@behdad
Copy link
Member

behdad commented Apr 19, 2024

I confirm, had the same error. Compiling harfbuzz 8.4.0 with icu 75.1 using g++ 13.2.0 (MSYS2). Added "-Dcpp_std=c++17 " to the meson setup line and everything compiles fine again...

We can possibly detect that and err if the compiler doesn't support, when ICU is enabled. My meson knowledge is zero though.

@esaaprillia
Copy link

[71/107] Generating src/harfbuzz-subset.cc with a custom command
[72/107] Compiling C++ object src/libharfbuzz-subset.so.0.60840.0.p/graph_gsubgpos-context.cc.o
[73/107] Compiling C++ object src/libharfbuzz-cairo.so.0.60840.0.p/hb-cairo-utils.cc.o
[74/107] Compiling C++ object src/libharfbuzz-cairo.so.0.60840.0.p/hb-cairo.cc.o
[75/107] Compiling C++ object src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o
FAILED: src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o 
aarch64-openwrt-linux-musl-g++ -Isrc/libharfbuzz-icu.so.0.60840.0.p -Isrc -I../src -I. -I.. -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/toolchain-aarch64_generic_gcc-13.2.0_musl/usr/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/toolchain-aarch64_generic_gcc-13.2.0_musl/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/toolchain-aarch64_generic_gcc-13.2.0_musl/include/fortify -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++11 -fno-exceptions -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -Os -pipe -mcpu=generic -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/runner/work/mosdns/mosdns/sdk/build_dir/target-aarch64_generic_musl/harfbuzz-8.4.0=harfbuzz-8.4.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fPIC -Wno-non-virtual-dtor -MD -MQ src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o -MF src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o.d -o src/libharfbuzz-icu.so.0.60840.0.p/hb-icu.cc.o -c ../src/hb-icu.cc
In file included from /home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/uset.h:36,
                 from /home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/unorm2.h:35,
                 from ../src/hb-icu.cc:39:
/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/localpointer.h:561:26: error: parameter declared 'auto'
  561 | template <typename Type, auto closeFunction>
      |                          ^~~~
/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid
  573 |     explicit LocalOpenPointer(std::unique_ptr<Type, decltype(closeFunction)> &&p)
      |                                                                            ^
/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid
  583 |     LocalOpenPointer &operator=(std::unique_ptr<Type, decltype(closeFunction)> &&p) {
      |                                                                              ^
/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid
  599 |     operator std::unique_ptr<Type, decltype(closeFunction)> () && {
      |                                                           ^
/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/uset.h:358:1: note: invalid template non-type parameter
  358 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/usr/include/unicode/unorm2.h:286:1: note: invalid template non-type parameter
  286 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[76/107] Compiling C++ object src/libharfbuzz-cairo.so.0.60840.0.p/hb-static.cc.o
[77/107] Compiling C++ object src/libharfbuzz-subset.so.0.60840.0.p/hb-subset-plan.cc.o
[78/107] Compiling C++ object src/libharfbuzz-subset.so.0.60840.0.p/hb-subset.cc.o
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:55: /home/runner/work/mosdns/mosdns/sdk/build_dir/target-aarch64_generic_musl/harfbuzz-8.4.0/.built] Error 1

@debohman
Copy link

Yes, ICU-75 requires c++17 when building dependent code.

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

No branches or pull requests

5 participants