redict/redict
27
352
Fork
You've already forked redict
19

WIP: Muon build system #52

Draft
ddevault wants to merge 27 commits from muon into main
pull from: muon
merge into: redict:main
redict:main
redict:v7.3.x

This adds a build system alongside the current Makefiles which is compatible with Muon and Meson.

Remaining TODOs:

  • Add Muon support to hiredict upstream and add support for building the vendored hiredict
  • Build TLS support as a Redict module
  • Integrate the test suite
  • TAP support for test suite
  • Generate release.h
  • Integrate test certificate generation
  • Update CI configs
  • Test that everything is built properly, esp. Lua et al
  • Verify everything still works with make
  • Add deprecation warning for make users

jemalloc and tcmalloc support was not added given that #49 proposes to remove it. Another notable change is that binaries which are copies of redict-server and use argv[0] to distinguish themselves (e.g. redict-sentinel) are now installed as symlinks rather than copies of redict-server.

See #1

This adds a build system alongside the current Makefiles which is compatible with [Muon](https://muon.build/) and [Meson](https://mesonbuild.com/index.html). Remaining TODOs: * [x] Add Muon support to hiredict upstream and add support for building the vendored hiredict * [x] Build TLS support as a Redict module * [x] Integrate the test suite * [x] TAP support for test suite * [x] Generate release.h * [ ] Integrate test certificate generation * [ ] Update CI configs * [x] Test that everything is built properly, esp. Lua et al * [x] Verify everything still works with make * [x] Add deprecation warning for make users jemalloc and tcmalloc support was not added given that #49 proposes to remove it. Another notable change is that binaries which are copies of redict-server and use argv[0] to distinguish themselves (e.g. redict-sentinel) are now installed as symlinks rather than copies of redict-server. See #1
Owner
Copy link

WIP for hiredict: redict/hiredict#21

WIP for hiredict: https://codeberg.org/redict/hiredict/pulls/21
meson.build Outdated
@ -0,0 +43,4 @@
endif
# Vendored dependencies
ifget_option('hiredict')=='vendor'
Owner
Copy link

we shouldn't need an option for this, since meson's and muon's dependency() calls would fallback to a subproject should the system library not be available

and both have flags for forcing that, meson --force-fallback-for=hiredict{,_ssl}, muon -Dforce_fallback_for=hiredict{,_ssl}

we shouldn't need an option for this, since meson's and muon's `dependency()` calls would fallback to a subproject should the system library not be available and both have flags for forcing that, meson `--force-fallback-for=hiredict{,_ssl}`, muon `-Dforce_fallback_for=hiredict{,_ssl}`
ddevault marked this conversation as resolved
meson.build Outdated
@ -0,0 +178,4 @@
]
foreachtarg:redict_server_links
install_symlink(targ,
Owner
Copy link

install_symlink was added on meson_version: '0.61.0', but we specify >=0.59.0

`install_symlink` was added on `meson_version: '0.61.0'`, but we specify `>=0.59.0`
ddevault marked this conversation as resolved
@ -0,0 +1,14 @@
hdr_histogram_include=include_directories('.')
hdr_histogram_lib=static_library(
Owner
Copy link

/home/anna/src/redict/redict/build/../deps/hdr_histogram/hdr_histogram.c:769:(.text+0x1838): undefined reference to 'sqrt'

needs -lm as well

`/home/anna/src/redict/redict/build/../deps/hdr_histogram/hdr_histogram.c:769:(.text+0x1838): undefined reference to 'sqrt'` needs -lm as well
ddevault marked this conversation as resolved
meson.build Outdated
@ -0,0 +206,4 @@
redict_cli=executable('redict-cli',
redict_cli_src,
dependencies:[
Owner
Copy link

/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/anna/src/redict/redict/build/../src/redict-cli.c:9573:(.text+0x1f749): undefined reference to 'pow'

needs cc.find_library('m')

`/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/anna/src/redict/redict/build/../src/redict-cli.c:9573:(.text+0x1f749): undefined reference to 'pow'` needs cc.find_library('m')
ddevault marked this conversation as resolved
Owner
Copy link

integrating hiredict muon should be only a matter of copying the vendored tree to subprojects/hiredict and calling dependency('hiredict') or dependency('hiredict_ssl')

integrating hiredict muon should be only a matter of copying the vendored tree to `subprojects/hiredict` and calling `dependency('hiredict')` or `dependency('hiredict_ssl')`
Author
Owner
Copy link

Updated to address @navi's feedback and tested with her hiredict branch as a subproject -- works. But this is blocked on the hiredict changes being merged.

Updated to address @navi's feedback and tested with her hiredict branch as a subproject -- works. But this is blocked on the hiredict changes being merged.
Author
Owner
Copy link

Working on integrating the test suite, and it requires unreleased features of Muon. Raised the issue here:

https://lists.sr.ht/~lattis/muon/%3CD48E6HXJFGU7.359IZNTGB5VGH@cmpwn.com%3E

Until then we'll have to use meson, or build muon from git.

Working on integrating the test suite, and it requires unreleased features of Muon. Raised the issue here: https://lists.sr.ht/~lattis/muon/%3CD48E6HXJFGU7.359IZNTGB5VGH@cmpwn.com%3E Until then we'll have to use meson, or build muon from git.
Author
Owner
Copy link

Have started some initial support to refactor the test suite to support TAP.

Have started some initial support to refactor the test suite to support TAP.
1.5.0 is quite new and hasn't landed for instance in Alpine stable.
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Author
Owner
Copy link

Working on integrating the test suite, and it requires unreleased features of Muon. Raised the issue here:

https://lists.sr.ht/~lattis/muon/%3CD48E6HXJFGU7.359IZNTGB5VGH@cmpwn.com%3E

Until then we'll have to use meson, or build muon from git.

Update: the earliest version of Meson with these features is also pretty new and not widely circulated to distros. So I've commented out these features in the meson.build with a TODO to enable them once widely circulated, and we're now compatible with Muon stable as well.

However, I would still recommend using Meson because Muon's support for TAP tests is limited, see relevant ticket.

> Working on integrating the test suite, and it requires unreleased features of Muon. Raised the issue here: > > https://lists.sr.ht/~lattis/muon/%3CD48E6HXJFGU7.359IZNTGB5VGH@cmpwn.com%3E > > Until then we'll have to use meson, or build muon from git. Update: the earliest version of Meson with these features is also pretty new and not widely circulated to distros. So I've commented out these features in the meson.build with a TODO to enable them once widely circulated, and we're now compatible with Muon stable as well. However, I would still recommend using Meson because Muon's support for TAP tests is limited, see [relevant ticket](https://todo.sr.ht/~lattis/muon/133).
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
d8bb52fc9 Makefile: add deprecation warning
6395bf6fa build: update build script to use muon
00f3d10ba build: drop cmake
9e715031e meson.build: add meson/muon build system support
5427e72f1 tests: output TAP protocol
a7a2abe80 hiredict.h: take version from build system
60ef513ea util/test.sh: accept hiredict-test path via argument
25c3d7c2a include/hiredict/hiredict_ssl.h: fix copyright mistake
31a5c3c44 hiredict: restructure into subdirectories
73e0f09f8 Makefile: correctly handle version suffixes on macOS
57291e224 hiredict.h: bump to 1.3.1
96a6d7161 hiredict.pc.in: remove -I${pkgincludedir} from Cflags
abc9232cf .builds: add ci for build and tests
git-subtree-dir: deps/hiredict
git-subtree-split: d8bb52fc996bbe4f06bd42d3d741bcb2bcd847c5
d8c55e8d8 meson.build: link hiredict_ssl_dep against hiredict
git-subtree-dir: deps/hiredict
git-subtree-split: d8c55e8d87fd546b022a23038721735b206e133b
48f2f4139 meson.build: remove lint.sh test from meson
git-subtree-dir: deps/hiredict
git-subtree-split: 48f2f4139336f3fbbd115631341e47e3bf5cb9a2
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Contributor
Copy link

As it's not marked in the MR description items, the hiredict option doesn't seems to be used anywhere (grepped for get_option).

As it's not marked in the MR description items, the `hiredict` option doesn't seems to be used anywhere (grepped for `get_option`).
Contributor
Copy link

By the way:

  • Integrate test certificate generation

Isn't this done with the custom_target done at lines 327 to 340 of meson.build?

By the way: > - [ ] Integrate test certificate generation Isn't this done with the custom_target done at lines 327 to 340 of `meson.build`?
Author
Owner
Copy link

@lanodan wrote in #52 (comment):

By the way:

  • Integrate test certificate generation

Isn't this done with the custom_target done at lines 327 to 340 of meson.build?

It should be, but I think there was some kind of problem with it last time I checked. The test suite has some issues which are ultimately the reason this MR is blocked.

@lanodan wrote in https://codeberg.org/redict/redict/pulls/52#issuecomment-7664962: > By the way: > > > * [ ] Integrate test certificate generation > > Isn't this done with the custom_target done at lines 327 to 340 of `meson.build`? It should be, but I think there was some kind of problem with it last time I checked. The test suite has some issues which are ultimately the reason this MR is blocked.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin muon:muon
git switch muon

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff muon
git switch muon
git rebase main
git switch main
git merge --ff-only muon
git switch muon
git rebase main
git switch main
git merge --no-ff muon
git switch main
git merge --squash muon
git switch main
git merge --ff-only muon
git switch main
git merge muon
git push origin main
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
redict/redict!52
Reference in a new issue
redict/redict
No description provided.
Delete branch "muon"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?