SkDOM undefined in libsvg (with libskia linked)

31 views
Skip to first unread message

Kalen White

unread,
Jun 4, 2025, 6:04:31 PM6/4/25
to skia-discuss
# This is my build config for skia using a very recent skia source

skia https://skia.googlesource.com/skia.git c6835e2d5ff641dad9347ce4c2ff79dbc29cf9aa
cxx="clang++"
cc="clang"
is_official_build=true
is_debug=false
is_component_build=true
skia_pdf_subset_harfbuzz=false
skia_use_harfbuzz=true
skia_use_system_harfbuzz=false
skia_use_vulkan=true
skia_use_vma=true
skia_use_libwebp_encode=false
skia_use_libwebp_decode=false
skia_enable_gpu=true
skia_enable_svg=true
skia_use_expat=true
> cd .. && python3 tools/git-sync-deps
> cd .. && bin/gn gen $BUILD_TYPE --args='$BUILD_CONFIG'
> cd .. && ninja -C $BUILD_TYPE
> rsync -a *.so $TAPESTRY/lib/
-lskia -lsvg
-lm

The above produces issues with SkDOM not being exported from libskia

This is using 'tapestry' syntax, with the idea of combining everything
for config, build, install and use in one string. That is,
its used somewhat like GN project DEPS file, but declares more
for use with your project.

Anyway, I cannot trace what would turn SkDOM symbols on, or move them itno
the libsvg. They are definitely inside the libskia, but not exported.

Regards,

Kalen N White

bungeman

unread,
Jun 5, 2025, 10:32:52 AM6/5/25
to skia-discuss
While SkSVG has exported symbols, SkDOM and its headers are all in src/ and its symbols aren't exported. SkDOM is considered to be an implementation detail of SkSVG (and a few other things in Skia). Since there isn't any indication of what the actual issue is, one might guess that issue here is that SkSVG doesn't really support the is_component_build. I think this is tracked by https://issues.skia.org/issues/40045538https://issues.skia.org/issues/40042871, and https://issues.skia.org/issues/358587938. You might want to +1 all of those.

Kalen White

unread,
Jun 5, 2025, 7:01:51 PM6/5/25
to skia-discuss
Thank you for clarifying this.  I thought this had something to do with component_build as you say.   If I can track this down and get it working can the team accept a pull request?

Kalen White

unread,
Jun 5, 2025, 8:02:14 PM6/5/25
to skia-discuss
config("xml_force_visible") {
  cflags = [ "-fvisibility=default" ]
}


optional("xml") {
  enabled = skia_use_expat || skia_use_jpeg_gainmaps
  public_defines = [ "SK_XML" ]
  configs = [ ":xml_force_visible" ]
  deps = [ "//third_party/expat" ]
  sources = skia_xml_sources + skia_codec_xmp + [
              "src/svg/SkSVGCanvas.cpp",
              "src/svg/SkSVGDevice.cpp",
            ]
}

in bold are the actual changes made to BUILD.gn

Let me know if this is ok as a general PR?  Its least disruptive because its only applying to the xml source.

Kalen White

unread,
Jun 5, 2025, 8:03:39 PM6/5/25
to skia-discuss
The above does seem to work for me.   I can submit PR for github or google source threads

bungeman

unread,
Jun 6, 2025, 10:25:24 AM6/6/25
to skia-discuss
The way to do this would be to add SK_SPI to the parts of SkXML that would need to be exported. This marks them as publicly available but not stable.
Reply all
Reply to author
Forward
0 new messages