servo / servo/font-kit

Support statically linking against fontconfig and FreeType

Open
#120 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement fontconfig
Dominant language
Rust
Stars
840
Forks
137
Avg merge
4h 56m
Merged PRs (30d)
1

Description

Does font-kit support being built in Docker using the rust-musl-bulider? I am trying to produce a fully static binary to be used on an Alpine Linux image. I am currently unable to get my application to build when I include font-kit as a dependency. Any help you can offer would be greatly appreciated.

The executable seems to build, but it seems to be dynamically linking against libfontconfig and libfreetype, here is the output of ldd from the docker image:

/usr/local/bin # ldd optimus-prime
        /lib/ld64.so.1 (0x7fe47f989000)
Error loading shared library libfontconfig.so.1: No such file or directory (needed by optimus-prime)
Error loading shared library libfreetype.so.6: No such file or directory (needed by optimus-prime)
Error relocating optimus-prime: FT_Init_FreeType: symbol not found
Error relocating optimus-prime: FcObjectSetCreate: symbol not found
Error relocating optimus-prime: FcPatternDestroy: symbol not found
Error relocating optimus-prime: FT_Set_Char_Size: symbol not found
Error relocating optimus-prime: FcPatternGetInteger: symbol not found
Error relocating optimus-prime: FcPatternCreate: symbol not found
Error relocating optimus-prime: FcInitLoadConfigAndFonts: symbol not found
Error relocating optimus-prime: FcPatternAddString: symbol not found
Error relocating optimus-prime: FT_Done_Face: symbol not found
Error relocating optimus-prime: FcObjectSetDestroy: symbol not found
Error relocating optimus-prime: FT_New_Memory_Face: symbol not found
Error relocating optimus-prime: FcPatternGetString: symbol not found
Error relocating optimus-prime: FcObjectSetAdd: symbol not found
Error relocating optimus-prime: FcFontList: symbol not found
Error relocating optimus-prime: FcFontSetDestroy: symbol not found

@pcwalton

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the font-kit build configuration and the Docker rust-musl-builder setup described in the issue, then inspect the ldd output for the reported executable. The work is done when a font-kit application can produce a fully static Alpine-compatible binary without runtime dependencies on libfontconfig.so.1 or libfreetype.so.6.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux, rust
Domain
build-system, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.