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

dev-util/electron: uses system harfbuzz despite USE=-system-harfbuzz #116

Open
aleclearmind opened this issue Nov 20, 2021 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@aleclearmind
Copy link

It seems like electron is using the system harfbuzz despite USE=-system-harfbuzz.
Here's the error log. Note /usr/include/harfbuzz.

FAILED: obj/skia/skia/SkPDFSubsetFont.o                                                                                                                                                       
x86_64-pc-linux-gnu-clang++ -MMD -MF obj/skia/skia/SkPDFSubsetFont.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_UNTIL_CRBUG_1187654_IS_FIXED -DSK_FAVOR_WUFFS_V_0_3_OVER_V_0_2 -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_HAS_WUFFS_LIBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_USE_PLATFORM_XCB_KHR -DSK_FREETYPE_MINIMUM_RUNTIME_VERSION=\(\(\(FREETYPE_MAJOR\)\ \*\ 0x01000000\)\ \|\ \(\(FREETYPE_MINOR\)\ \*\ 0x00010000\)\ \|\ \(\(FREETYPE_PATCH\)\ \*\ 0x00000100\)\) -DSKIA_IMPLEMENTATION=1 -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DFT_CONFIG_MODULES_H=\"freetype-custom/freetype/config/ftmodule.h\" -DFT_CONFIG_OPTIONS_H=\"freetype-custom/freetype/config/ftoption.h\" -DPDFIUM_REQUIRED_MODULES -DCHROMIUM_RESTRICT_VISIBILITY -DUSE_SYSTEM_LIBJPEG -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUSE_SYSTEM_ZLIB=1 -I../.. -Igen -I../../third_party/skia -I../../third_party/wuffs/src/release/c -I../../third_party/vulkan/include -I../../third_party/vulkan-deps/vulkan-headers/src/include -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Igen/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/freetype/include -I../../third_party/freetype/include/freetype-custom -I../../third_party/freetype/src/include -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fvisibility=hidden -Wall -Wno-unused-variable -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -O2 -fdata-sections -ffunction-sections -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -DPROTOBUF_ALLOW_DEPRECATED=1 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -std=c++17  -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=native -pipe -fstack-protector-strong -flax-vector-conversions=all -Wno-unknown-warning-option -Wno-builtin-macro-redefined -c ../../third_party/skia/src/pdf/SkPDFSubsetFont.cpp -o obj/skia/skia/SkPDFSubsetFont.o                                                                                                      ../../third_party/skia/src/pdf/SkPDFSubsetFont.cpp:74:5: error: use of undeclared identifier 'hb_subset_input_set_retain_gids'; did you mean 'hb_subset_input_set_flags'?                         hb_subset_input_set_retain_gids(input.get(), true);                                                                                                                                       
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                           
    hb_subset_input_set_flags                                                                                                                                                                 
/usr/include/harfbuzz/hb-subset.h:142:1: note: 'hb_subset_input_set_flags' declared here                                                                                                      
hb_subset_input_set_flags (hb_subset_input_t *input,                                                                                                                                          
^                                                                                                                                                                                             
../../third_party/skia/src/pdf/SkPDFSubsetFont.cpp:77:5: error: use of undeclared identifier 'hb_subset_input_set_drop_hints'                                                                 
    hb_subset_input_set_drop_hints(input.get(), false);                                                                                                                                       
    ^                                                                                                                                                                                         
../../third_party/skia/src/pdf/SkPDFSubsetFont.cpp:78:19: error: use of undeclared identifier 'hb_subset'; did you mean 'hb_set_set'?                                                         
    HBFace subset(hb_subset(face.get(), input.get()));                                                                                                                                        
                  ^~~~~~~~~                                                                                                                                                                   
                  hb_set_set                                                                                                                                                                  
/usr/include/harfbuzz/hb-set.h:131:1: note: 'hb_set_set' declared here
hb_set_set (hb_set_t       *set,
^
../../third_party/skia/src/pdf/SkPDFSubsetFont.cpp:78:29: error: cannot initialize a parameter of type 'hb_set_t *' with an rvalue of type 'std::unique_ptr<hb_face_t, SkFunctionWrapper<void 
(hb_face_t *), &hb_face_destroy>>::pointer' (aka 'hb_face_t *')
    HBFace subset(hb_subset(face.get(), input.get()));
                            ^~~~~~~~~~
/usr/include/harfbuzz/hb-face.h:55:16: note: 'hb_face_t' is not defined, but forward declared here; conversion would be valid if it was derived from 'hb_set_t'
typedef struct hb_face_t hb_face_t;
               ^
/usr/include/harfbuzz/hb-set.h:131:29: note: passing argument to parameter 'set' here
hb_set_set (hb_set_t       *set,
                            ^
4 errors generated.
@aleclearmind aleclearmind added the bug Something isn't working label Nov 20, 2021
@PF4Public
Copy link
Owner

Honestly saying, I never tried compiling with -system-harfbuzz. I'll look into it later when I have some more time.

@aleclearmind
Copy link
Author

aleclearmind commented Nov 22, 2021

The problem seems to be due to media-libs/harfbuzz-3.1.1. I think media-libs/harfbuzz-2.9.0 was working fine.

I've tried this:

diff --git a/dev-util/electron/electron-13.6.1.ebuild b/dev-util/electron/electron-13.6.1.ebuild
index 113f3ea..868cadc 100644
--- a/dev-util/electron/electron-13.6.1.ebuild
+++ b/dev-util/electron/electron-13.6.1.ebuild
@@ -1835,7 +1835,7 @@ src_configure() {
        build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
 
        # See dependency logic in third_party/BUILD.gn
-       myconf_gn+=" use_system_harfbuzz=true"
+       # myconf_gn+=" use_system_harfbuzz=true"
 
        # Disable deprecated libgnome-keyring dependency, bug #713012
        myconf_gn+=" use_gnome_keyring=false"

Now it fails due to:

../../third_party/harfbuzz-ng/src/src/hb-subset-cff1.cc:405:33: error: variable 'supp_size' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned int  size0, size1, supp_size;
                                ^
1 error generated.

Even though -Werror is not passed in the command line.

@PF4Public
Copy link
Owner

PF4Public commented Nov 22, 2021

media-libs/harfbuzz-3.1.1 has a number of incompatibilities in ABI, therefore, its support needs to be added via a patch.

But still that is a weird behaviour if you're trying to use bundled harfbuzz.

@aleclearmind
Copy link
Author

I think with such big projects maintaining patches must be a nightmare, I'd go for adding as a dep <media-libs/harfbuzz-3 and make sure the bundled harfbuzz builds correctly.

But I guess you've more experience with this and maybe your take is that patching is the right path.

@PF4Public
Copy link
Owner

No idea. Didn't investigate yet. Like I've already said:

I'll look into it later when I have some more time.

@PF4Public PF4Public changed the title dev-util/electron-13.6.1: uses system harfbuzz despite USE=-system-harfbuzz dev-util/electron: uses system harfbuzz despite USE=-system-harfbuzz Dec 25, 2021
@PF4Public PF4Public added enhancement New feature or request and removed bug Something isn't working labels Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants