Issue 12765 in skia: hb-subset.h not found during compilation

1,030 views
Skip to first unread message

josh.… via monorail

unread,
Dec 27, 2021, 2:45:07 AM12/27/21
to bu...@skia.org
Status: Untriaged
Owner: ----
Priority: Medium
Type: Defect

New issue 12765 by josh....@gmail.com: hb-subset.h not found during compilation
https://bugs.chromium.org/p/skia/issues/detail?id=12765

What steps will reproduce the problem?

git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
export PATH="${PWD}/depot_tools:${PATH}"

git clone https://skia.googlesource.com/skia.git
cd skia
python2 tools/git-sync-deps

bin/gn gen out/Static --args='is_official_build=true'

ninja -C out/Static

(got the error)

tools/install_dependencies.sh

ninja -C out/Static

(got the error again)


What is the expected output? What do you see instead?
Successful build is expected.

Actually received:
[367/1178] compile ../../src/pdf/SkPDFSubsetFont.cpp
FAILED: obj/src/pdf/pdf.SkPDFSubsetFont.o
c++ -MD -MF obj/src/pdf/pdf.SkPDFSubsetFont.o.d -DSK_PDF_USE_HARFBUZZ_SUBSET -DNDEBUG -DSK_R32_SHIFT=16 -DSK_ENABLE_SKSL -DSK_GAMMA_APPLY_TO_A8 -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_PDF -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -I../.. -I/usr/include/harfbuzz -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -O3 -fdata-sections -ffunction-sections -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -c ../../src/pdf/SkPDFSubsetFont.cpp -o obj/src/pdf/pdf.SkPDFSubsetFont.o
../../src/pdf/SkPDFSubsetFont.cpp:13:10: fatal error: hb-subset.h: No such file or directory
13 | #include "hb-subset.h"
| ^~~~~~~~~~~~~


What version of the product are you using? On what operating system?
Building from https://skia.googlesource.com/skia.git at origin/main
(26e3815278ce512a1879d0ff188317be4f3d6708) on Debian 11

Provide any additional information below.

ninja version 1.10.1

Python 2.7.18

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

johns… via monorail

unread,
Dec 28, 2021, 4:00:01 PM12/28/21
to bu...@skia.org
Updates:
Owner: bung...@google.com
Status: Accepted

Comment #1 on issue 12765 by johns...@google.com: hb-subset.h not found during compilation
https://bugs.chromium.org/p/skia/issues/detail?id=12765#c1

Ben, PTAL? Thanks

bunge… via monorail

unread,
Dec 28, 2021, 7:53:59 PM12/28/21
to bu...@skia.org
Updates:
Labels: Area-Build Area-PDF

Comment #2 on issue 12765 by bung...@google.com: hb-subset.h not found during compilation
https://bugs.chromium.org/p/skia/issues/detail?id=12765#c2

The HarfBuzz font subsetter was a private API in HarfBuzz 2.x and was made public with some changes in HarfBuzz 3.0. It appears that debian hasn't gotten around to updating HarfBuzz to version 3 (now on 3.2) even on sid, which is disappointing.

One way to resolve this is to build in a newer HarfBuzz or build from source to use the internal API (for example skia_use_system_harfbuzz=false). If you don't need the subsetter then skia_pdf_subset_harfbuzz=false will disable use of the HarfBuzz subsetter.

As far as getting the default 'is_official_build=true' to work, this would require some sort of build generation check to see if the selected HarfBuzz headers exist. We don't currently have a good way of doing that in the build, but maybe something like that could be done.

josh.… via monorail

unread,
Dec 29, 2021, 4:49:43 PM12/29/21
to bu...@skia.org

Comment #3 on issue 12765 by josh....@gmail.com: hb-subset.h not found during compilation
https://bugs.chromium.org/p/skia/issues/detail?id=12765#c3

skia_use_system_harfbuzz=false worked for me. You can close this issue.

One note though skia_pdf_subset_harfbuzz=false by itself still produced an error...

bin/gn gen out/Static --args="skia_pdf_subset_harfbuzz=false"
Done. Made 223 targets from 70 files in 110ms

$ ninja -C out/Static

ninja: Entering directory `out/Static'
[1042/3623] ACTION //third_party/icu:make_data_assembly(//gn/toolchain:gcc_like)
Generated gen/third_party/icu/icudtl_dat.S
[1824/3623] compile ../../src/pdf/SkPDFSubsetFont.cpp
FAILED: obj/src/pdf/pdf.SkPDFSubsetFont.o
c++ -MD -MF obj/src/pdf/pdf.SkPDFSubsetFont.o.d -DSK_PDF_USE_SFNTLY -DSK_R32_SHIFT=16 -DSK_ENABLE_SKSL -DSK_GAMMA_APPLY_TO_A8 -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 -DGR_TEST_UTILS=1 -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_PDF -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DU_USING_ICU_NAMESPACE=0 -DU_DISABLE_RENAMING -DSK_USING_THIRD_PARTY_ICU -I../.. -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -g -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-psabi -Wno-unused-parameter -isystem /home/varga/dev/skia/third_party/externals/zlib -isystem /home/varga/dev/skia/third_party/externals/sfntly/cpp/src -isystem /home/varga/dev/skia/third_party/externals/icu/source/common -isystem /home/varga/dev/skia/third_party/externals/icu/source/i18n -isystem /home/varga/dev/skia/third_party/icu -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wnon-virtual-dtor -Wno-noexcept-type -Wno-redundant-move -c ../../src/pdf/SkPDFSubsetFont.cpp -o obj/src/pdf/pdf.SkPDFSubsetFont.o
../../src/pdf/SkPDFSubsetFont.cpp: In function ‘sk_sp<SkData> subset_sfntly(sk_sp<SkData>, const SkPDFGlyphUse&, const char*, int)’:
../../src/pdf/SkPDFSubsetFont.cpp:118:10: error: ‘SkLoadICU’ was not declared in this scope
118 | if (!SkLoadICU()) {
| ^~~~~~~~~
[1841/3623] compile ../../src/pdf/SkPDFType1Font.cpp
ninja: build stopped: subcommand failed.

Adam Martinelli

unread,
Jun 15, 2022, 5:43:09 AM6/15/22
to Skia Bugs, no_r...@monorail-prod.appspotmail.com
Running into the same issues.
> compiled harfbuzz from source
> set /etc/ld.conf.so.d/* files accordingly, followed by a ldconfig
> then (from the skia dir):
  ./bin/gn gen 'out/linux/arm64' --args='is_official_build=true skia_enable_tool=false target_os="linux" \
                                                                                target_cpu="arm64" skia_use_icu=true skia_use_system_icu=true \
                                                                                skia_use_harfbuzz=true skia_use_system_harfbuzz=true \
                                                                                skia_pdf_subset_harfbuzz=true skia_use_sfntly=false \
                                                                                skia_use_piex=true skia_use_system_expat=false \
                                                                                skia_use_system_freetype2=true skia_use_system_libjpeg_turbo=true \
                                                                                skia_use_system_libpng=true skia_use_system_libwebp=true \
                                                                                skia_use_system_zlib=true skia_enable_gpu=true \
                                                                                extra_cflags=[ "-DSKIA_C_DLL", "-DHAVE_PTHREAD", "-DHB_EXTERN=extern", "-I/usr/local/lib/aarch64-linux-gnu/harfbuzz/include/" ] \
                                                                  --cflags='[ "-DSKIA_C_DLL", "-DHAVE_PTHREAD", "-DHB_EXTERN=extern", "-I/usr/local/lib/aarch64-linux-gnu/harfbuzz/include/"]'
> finally:
  ninja 'SkiaSharp' -C 'out/linux/arm64'

The issues occur when skia_pdf_subset_harfbuzz is set and have to do with functions that don't exist in harfbuzz (anymore? yet?).

The harfbuzz I built was pulled from github about a week ago and I didn't use any special options during compilation, just ran 'meson build' basically.

Hope this helps!

karth… via monorail

unread,
Jul 26, 2022, 2:53:01 AM7/26/22
to bu...@skia.org

Comment #4 on issue 12765 by karth...@gmail.com: hb-subset.h not found during compilation
https://bugs.chromium.org/p/skia/issues/detail?id=12765#c4

Hi I'm build it from source with : bin/gn gen out/Static --args=skia_use_system_harfbuzz=false
And I'm getting stuck at below point :
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-redundant-move’
[1233/3717] compile ../../gm/runtimecolorfilter.cpp
FAILED: obj/gm/gm.runtimecolorfilter.o
c++ -MD -MF obj/gm/gm.runtimecolorfilter.o.d -DSK_GAMMA_APPLY_TO_A8 -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 -DGR_TEST_UTILS=1 -DSK_GL -DSK_ENABLE_DUMP_GPU -DSK_SUPPORT_GPU=1 -DSK_SUPPORT_PDF -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_ENABLE_ANDROID_UTILS -DSK_USE_LIBGIFCODEC -DSK_HAS_HEIF_LIBRARY -DSK_CODEC_DECODES_PNG -DSK_ENCODE_PNG -DSK_CODEC_DECODES_RAW -DSKVM_JIT_WHEN_POSSIBLE -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_WEBP -DSK_XML -DSK_R32_SHIFT=16 -DSK_ENABLE_SKSL -DSK_ENABLE_PRECOMPILE -DSK_ENABLE_SKOTTIE -DSK_ENABLE_PARAGRAPH -DSK_SHAPER_HARFBUZZ_AVAILABLE -I../../include/third_party/vulkan -I../.. -I../../third_party/externals/libgifcodec -I../.. -I../../modules/particles/include -I../../modules/skottie/include -I../../modules/skparagraph/include -I../../modules/skparagraph/utils -I../../modules/skshaper/include -Igen -Wno-attributes -fstrict-aliasing -fPIC -fvisibility=hidden -g -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-psabi -Wno-unused-parameter -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wnon-virtual-dtor -Wno-noexcept-type -Wno-redundant-move -c ../../gm/runtimecolorfilter.cpp -o obj/gm/gm.runtimecolorfilter.o
../../gm/runtimecolorfilter.cpp: In lambda function:
../../gm/runtimecolorfilter.cpp:173:28: error: taking address of temporary [-fpermissive]
&r,
^
Reply all
Reply to author
Forward
0 new messages