Skip to content

[Bug]: freetype 2.13.3 rules are incompatible with OpenSSL or Zlib in the same binary #4142

Open
@arvid-norlander

Description

@arvid-norlander

What happened?

Freetype bundles parts of OpenSSL and Zlib by default, and in the cmake / autoconf etc build systems you can choose to link to zlib / openssl instead of using the bundled versions.

The build in this repo isn't set up to use those as dependencies, causing ODR errors if you try to use normal OpenSSL or normal Zlib as well as the Freetype 2.13.3 build from BCR.

It would be good if some bool_flags or similar could be added to let the user control this, as Freetype from BCR currently isn't usable by us due to this. I can make a PR but I would appreciate help on what the best way to do this is.

Basically what needs to be accomplished is to have the following in the BUILD file:

    copts = [
        "-DFT_CONFIG_OPTION_SYSTEM_ZLIB",
        "-DHAVE_OPENSSL",
        # Other flags as before
    ],
    # ...
    deps = [
        "@boringssl//:crypto",  # or @openssl//:crypto, depending on your preference, we use boringssl
        "@zlib",
    ],

Version

Development (host) and target OS/architectures:

Output of bazel --version: bazel 8.1.1

Version of relevant rules from the WORKSPACE or MODULE.bazel file: freetype 2.13.3

Language(s) and/or frameworks involved: C++?

How to reproduce

Build a project using freetype as well as at least one of OpenSSL/BoringSSL/Zlib. Get ODR errors and linker errors.

Any other information?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions