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

Work to be done to move to Meson build by default #15048

Open
8 of 26 tasks
omoerbeek opened this issue Jan 17, 2025 · 10 comments
Open
8 of 26 tasks

Work to be done to move to Meson build by default #15048

omoerbeek opened this issue Jan 17, 2025 · 10 comments

Comments

@omoerbeek
Copy link
Member

omoerbeek commented Jan 17, 2025

Timeline: the goal is to ave this done end of Q2 2025.

We (that is I) will start with distr tarball for recursor, and we'll use the experience with that case for the other products.
We should not be too hesitant to add (new) build dependencies, especially for tools that are very common, like python (already used by Meson itself), flex or bison.

In the meantime the other task (mostly in CI itself) can also be tackled.

When we have all subtasks below done, and all three products have branched, we wil be free to start to deprecate autotools and at one point maybe even remove them.

  • Basic build for a developer
    • auth
    • dnsdist (there is a not yet merged PR)
    • rec
  • Unit test build and run from Meson
    • auth
    • dnsdist
    • rec
  • Docs build
    • auth
    • dnsdist
    • rec
  • CI build and test all
    • auth
    • dnsdist
    • rec
  • CI Use results of Meson "build and test all" for unit tests
    • auth
    • dnsdist
    • rec
  • CI Use results of Meson "build and test all" for regression tests
    • auth
    • dnsdist
    • rec
  • Dist tarball (there are differences between Meson approach and autotools approach, see discussion below)
    • auth
    • dnsdist
    • rec
  • CI package building
    • auth
    • dnsdist
    • rec
  • CI Docs Build and publishing
  • Inventory of potential third party issues?
@eli-schwartz
Copy link
Contributor

  • Dist tarball (there are conflicts between Meson approach and autotools approach, Meson wants all files in git, no "pre-generate" step)

This is not precisely accurate. You can create files in the dist tarball using meson.add_dist_script().

Unifying this between from-git builds and from-dist-tarball builds could perhaps use a bit of polish from the meson side. You can run ninja targets for e.g. built sources you want to be functional even without generator tools installed (manpages, doxygen, flex/bison...) from the dist script and copy the built results into the dist staging root, and then use an if/else to see if the file exists in the source tree and directly use it -- I've wanted to provide methods for automatically handling this for a while but never gotten around to it.

@omoerbeek
Copy link
Member Author

This is not precisely accurate. You can create files in the dist tarball using meson.add_dist_script().

Thanks, I understood earlier that there was no such facility. One of the goals is to have some files pregenerated in the dist tarball, to make life easier (because of less build dependencies) for package builders.

@eli-schwartz
Copy link
Contributor

Excellent, you should be good to go then with a bit of work. Feel free to ping me for review.

@jsoref
Copy link
Contributor

jsoref commented Jan 21, 2025

I wonder if https://mesonbuild.com/Creating-releases.html should include a note about meson.add_dist_script().

@omoerbeek
Copy link
Member Author

omoerbeek commented Jan 21, 2025

I wonder if https://mesonbuild.com/Creating-releases.html should include a note about meson.add_dist_script().

I'd say so, as it suggests there's no way to do extra work before creating the tarball and https://mesonbuild.com/Creating-releases.html#autotools-dist-vs-meson-dist also gives no clue you could.

@romeroalx
Copy link
Member

There is an error when building recursor in CI with meson on Debian 11:

[169/174] clang++-13  -o rec_control rec_control.p/rec_control.cc.o -fsanitize=address,undefined --coverage -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -fstack-clash-protection -fstack-protector-strong -fcf-protection=full -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS '-Wl,-rpath,$ORIGIN/settings/rust' -Wl,-rpath-link,/__w/pdns/pdns/pdns/recursordist/pdns-recursor-0.0.0-git1/settings/rust -Wl,--start-group librec-common.a settings/rust/libsettings.a ext/json11/libjson11.a ext/yahttp/yahttp/libyahttp.a librec-dnslabeltext.a /usr/lib/x86_64-linux-gnu/libboost_context.so.1.74.0 -pthread /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libluajit-5.1.so -Wl,--end-group
FAILED: rec_control 
clang++-13  -o rec_control rec_control.p/rec_control.cc.o -fsanitize=address,undefined --coverage -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -fstack-clash-protection -fstack-protector-strong -fcf-protection=full -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS '-Wl,-rpath,$ORIGIN/settings/rust' -Wl,-rpath-link,/__w/pdns/pdns/pdns/recursordist/pdns-recursor-0.0.0-git1/settings/rust -Wl,--start-group librec-common.a settings/rust/libsettings.a ext/json11/libjson11.a ext/yahttp/yahttp/libyahttp.a librec-dnslabeltext.a /usr/lib/x86_64-linux-gnu/libboost_context.so.1.74.0 -pthread /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libluajit-5.1.so -Wl,--end-group
/usr/bin/ld: /usr/bin/ld: DWARF error: could not find variable specification at offset 9280
librec-common.a.p/credentials.cc.o: in function `dns_random_uint32()':
/__w/pdns/pdns/pdns/recursordist/pdns-recursor-0.0.0-git1/../dns_random.hh:36: undefined reference to `arc4random'

For the build-and-test-all workflow, building auth with meson on Debian 11 is skipped (#14674). I am wondering if we should do the same for recursor.

Here is the run: https://github.com/PowerDNS/pdns/actions/runs/12938843578/job/36089893572

@omoerbeek
Copy link
Member Author

I'll check if there's a quick fix, if not disabling is OK.

@omoerbeek
Copy link
Member Author

omoerbeek commented Jan 24, 2025

@omoerbeek
Copy link
Member Author

omoerbeek commented Jan 24, 2025

@eli-schwartz
Copy link
Contributor

I wonder if https://mesonbuild.com/Creating-releases.html should include a note about meson.add_dist_script().

I'd say so, as it suggests there's no way to do extra work before creating the tarball and https://mesonbuild.com/Creating-releases.html#autotools-dist-vs-meson-dist also gives no clue you could.

Yes please, that's a silly oversight and it should definitely be amended to steer people in the right direction. Can one of you submit a PR to discuss this scenario in the docs?

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

No branches or pull requests

4 participants