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

Option to link against system libraries of freetype, libpng and zlib #46

Closed
lilydjwg opened this issue Oct 12, 2019 · 6 comments
Closed

Comments

@lilydjwg
Copy link
Contributor

Is it a build problem?

Yes.

$ rustup show
command not found.

I do not use rustup on my Arch Linux.

Did something not work the way you expected?

The build system can't be instructed to use system libraries of freetype, libpng and zlib, which is unexpected.

By making use of system libraries, I have the following benefits:

  • much less download time (I'm in a sad place where the speed of cloning from GitHub is about 15KB/s)
  • less build time
  • receives updates from the distribution

What did you try?

Read the source to see if I can set any environment variables to achieve this.

@wez
Copy link
Owner

wez commented Oct 12, 2019

You mentioned rustup above: whether you use rustup or not shouldn't have any bearing on how freetype is linked in. You need to have a reasonably recent version of rust + cargo installed to build wezterm.

freetype and harfbuzz are co-dependent libraries and most distributions do not have the right combination of these available and built with the correct build options, which is why we bundle and build them. These libraries do not get updated very frequently by distributions (which is another reason for bundling) and weakens the argument that you will receive updates from your distribution.

I spent a lot of time getting the build in its current reproducible state so, while I have empathy for the slow downloads you're experiencing, I'm sorry to say that I don't think the amount of effort required to get the build working that way is worth the time.

If you, or someone else, wanted to submit a PR that makes this possible I'm open to it, but I would want it to not be the default mode of operation.

As an alternative proposal, consider making a PR for the azure pipelines configuration that captures the built artifacts using the same mechanism we use for the other targets; then we would have a binary tarball or package download for Arch. This feels like a more impactful use of time!

@wez
Copy link
Owner

wez commented Oct 15, 2019

Thanks for the pull requests! I'm currently traveling so it may take a few days before I can fully review these!

wez added a commit that referenced this issue Dec 24, 2019
Full means "including git submodules" and makes it easier for folks to
download and build a release without sucking down large repos from
various locations, especially for folks with bandwidth constraints.

Upload the source tarball to the associated release.

Refs: #81
Refs: #46
Refs: #48
@wez
Copy link
Owner

wez commented Dec 24, 2019

I decided against allowing this; see #48 (comment) for the rationale

@wez wez closed this as completed Dec 24, 2019
wez added a commit that referenced this issue Dec 24, 2019
* harfbuzz includes some ttf fixtures.
* libpng has some test images
* the wezterm web page has some movie files(!)

None of these are required to be in the source tarball, so strip them
out to save ~40MB and bring the tarball down to <5MB.

Refs: #46
@Logarithmus
Copy link
Contributor

Logarithmus commented May 1, 2021

@wez why don't you use https://lib.rs/crates/harfbuzz_rs & https://lib.rs/crates/freetype?
Do they lack any features you need for wezterm?

@wez
Copy link
Owner

wez commented May 1, 2021

When I started this, they didn't exist and/or the only existing bindings linked only against system libraries, but I require static linkage of known versions so that I have consistent behavior across windows, mac and linux. In particular, freetype, harfbuzz, zlib and png are problematic on windows; all are required for proper color emoji support.

If those other crates now meet those requirements then I'm open to a PR that targets them.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants