Skip to content

Add support for Meson build system - #1437

Merged
ebraminio merged 34 commits into
harfbuzz:masterfrom
tp-m:meson-rebased
Mar 11, 2020
Merged

ebraminio merged 34 commits into
harfbuzz:masterfrom
tp-m:meson-rebased

Conversation

@tp-m

@tp-m tp-m commented Dec 1, 2018

Copy link
Copy Markdown
Contributor

Probably not perfect, but builds for me with test suite passing on:

  • Linux (64-bit, gcc 8.2.0 / Debian sid)
  • Windows with MSVC (32-bit, vs2015)
  • Windows mingw (32-bit, fontconfig disabled).

@khaledhosny

Copy link
Copy Markdown
Collaborator

We need to switch some of our CI builds to meson.

Comment thread subprojects/glib.wrap Resolved
Comment thread subprojects/zlib.wrap Resolved
Comment thread test/shaping/meson.build Resolved
Comment thread test/shaping/meson.build Resolved
Comment thread test/subset/meson.build Resolved
@tp-m

tp-m commented Dec 2, 2018

Copy link
Copy Markdown
Contributor Author

cmake ci failure looks unrelated (/bin/bash: wget: command not found)

@behdad

behdad commented Dec 2, 2018

Copy link
Copy Markdown
Member

I haven't checked the code, but duplicating list of source files and tests is one thing I definitely don't want amongst various build systems. But if we are working towards a milestone of switching to meson and removing the autotools & cmake ones, then I'm fine. Otherwise, we will need meson build to also read the same Makefile.sources files as other two systems. If it's not too much work to make it read those files right now, that would definitely make the transition easier.

@tp-m

tp-m commented Dec 2, 2018

Copy link
Copy Markdown
Contributor Author

There is no easy or good way to re-use the contents of the sources files really, though I understand why that would be desirable from a maintainability point of view of course.

Happy to help beat the Meson build into shape if there's anything wrong or missing, but it's up to you maintainers to decide where you want to go build system wise in future of course.

Personally, I don't think supporting and maintaining three build systems is viable in the long run for most projects. I would probably work towards at least dropping one of them, but I suppose it depends a lot on what people are using and who's using what.

@behdad

behdad commented Dec 2, 2018

Copy link
Copy Markdown
Member

Our source code and test suite has finally grown enough that the autotools build system speed has become a big enough annoyance to me. Since I wasn't willing to learn cmake, I never embraced that one. But since meson seems to be the clear replacement for autotools in the circles I frequent, I'm fine with learning it and then retiring the other two in favor. It just will take some time.

Comment thread meson.build Resolved
tp-m added a commit to tp-m/harfbuzz that referenced this pull request Dec 3, 2018
tp-m added a commit to tp-m/harfbuzz that referenced this pull request Dec 3, 2018
@CoffeeFlux

Copy link
Copy Markdown
Contributor

This errors for me when building statically on Windows 10 with MSVC. The error appears to be an upstream issue, so I've reported it here, but figured I should mention it in this issue as well.

@behdad

behdad commented Apr 29, 2019

Copy link
Copy Markdown
Member

What's the status here?

@tp-m

tp-m commented Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

What's the status here?

I don't know tbh, you have raised some doubts about duplication and how many build systems you want to maintain going forward etc., and I was kind of waiting for a decision from you on how you want to proceed with all of that.

I can work on rebasing it again, but Harfbuzz is a pretty fast-moving project, so this needs to be done with a clear goal of getting it merged soon after.

Are there any particular blockers / missing bits to get it merged?

@behdad

behdad commented Apr 29, 2019

Copy link
Copy Markdown
Member

I haven't studied it yet. Was hoping @ebraminio would do. Maybe I just need to sit down and test it. If I can make it work for me with minw32 cross-copiling, that's good enough to go. That, and a "make distcheck" equivalent.

@tp-m

tp-m commented Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

What would be helpful is if someone who knows how the appveyor.yml works added a basic meson build to it.

@tp-m

tp-m commented Apr 29, 2019

Copy link
Copy Markdown
Contributor Author

I don't know if anyone has tested cross-compiling with the existing build yet, the main goal (and what has been tested) were native builds on Linux and Windows (MingW an MSVC), esp. for use as subproject when building the gtk3/cairo/pango stack with MSVC on Windows.

If there are problems with cross-compiling, they can be fixed. I would test native builds first :)

@behdad behdad self-assigned this Apr 30, 2019
@ebraminio

Copy link
Copy Markdown
Collaborator

This looks very coherent and cleaner than our autotools and cmake ports even.

What would be helpful is if someone who knows how the appveyor.yml works added a basic meson build to it.

Sure. Try to test it once in Windows and give me the commands, I will make it work appveyor. Or I should do it once but I don't have to a working Windows installation right now. Nothing to worry about anyway once we can get this in repo so don't consider it as a blocker.

@boxerab

boxerab commented Jul 22, 2019

Copy link
Copy Markdown

@CoffeeFlux

Copy link
Copy Markdown
Contributor

I've PR'd a fix to meson for the build issue I mentioned above. If there's anything else blocking a review @behdad please let me know; it'd be great to get this merged.

@behdad

behdad commented Oct 9, 2019

Copy link
Copy Markdown
Member

@ebraminio would you volunteer to maintain this until we remove autotools-based one?

@ebraminio

ebraminio commented Oct 9, 2019 via email

Copy link
Copy Markdown
Collaborator

@behdad

behdad commented Oct 11, 2019

Copy link
Copy Markdown
Member

I see. Okay maybe we can merge at least and push me to learn to use it over time. It rotting in tree is not worse than rotting in a PR. :))

@boxerab

boxerab commented Dec 16, 2019

Copy link
Copy Markdown

It would be great to get this merged :) and avoid bit rot.
Currently I have a harfbuzz fork just for meson.

@tp-m

tp-m commented Dec 16, 2019

Copy link
Copy Markdown
Contributor Author

I have this on my xmas holiday hack list, but feel free to take over if I don't get around to it.

tp-m and others added 21 commits March 9, 2020 16:29
Fix symbol export with MSVC when features are disabled,
such as GLib. We need to generate the list of exported
symbols on the fly to make sure we only export symbols
that are actually available.

Needs some minor modifications to the gen-def.py script:
 - accept header list also via command line args; we can't
   pass things to a configure_file() command via the environment
   in Meson.
 - strip any leading 'src/' from library filename. This might
   be there because in Meson the script might be called from
   the top-level directory and not the current source directory.

Remove .def files again which had been checked in for earlier
versions of the Meson port.
HarfBuzz headers are under src/ not the root directory, without using
incsrc no headers will be found by the dependent project. I think
incbase is superfluous, it should be replaced by incsrc or dropped.
Makes it clearer what it's for: config.h. See harfbuzz#4.
And remove header files from sources list, Meson figures
out header dependencies by itself (via the compiler).
@tp-m

tp-m commented Mar 11, 2020

Copy link
Copy Markdown
Contributor Author

Rebased now. (Contrary to github's notifications I pushed more than 0 commits ;))

@ebraminio
ebraminio merged commit 68f9824 into harfbuzz:master Mar 11, 2020
ebraminio pushed a commit that referenced this pull request Mar 11, 2020
@ebraminio

Copy link
Copy Markdown
Collaborator

Okay, merged, let me setup a bot for it and see what we can do, possibly removing cmake or parts of it at least.

@ebraminio ebraminio added the meson meson build system label Mar 11, 2020
@ebraminio

Copy link
Copy Markdown
Collaborator

@boxerab it would be fantastic if you can have a look and see what is missing on the merged port and provide a PR using things you've done on your fork :)

@CoffeeFlux please help us to make this stable now that is merged. Thanks :)

@boxerab

boxerab commented Mar 13, 2020 •

Copy link
Copy Markdown

@ebraminio @tp-m already kindly merged my changes before you merged his PR, so we now have the latest and greatest meson support merged into harfbuzz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meson meson build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants