Build against Memgraph 3.1 headers and meson 1.3 - #1
Closed
vkatter-uantwerpen wants to merge 2 commits into
Closed
Conversation
added 2 commits
August 17, 2026 13:15
meson only added 'c23' as a recognised c_std value in 1.4, but the project
declares meson_version >=1.3.0. On meson 1.3.x configuration fails outright:
ERROR: Unknown C std ['c23']. Possible values are [... 'c2x' ...]
Newer meson still accepts 'c2x' and it selects the same standard, so 'c2x' is
the spelling that works across the supported meson range.
sync_module.c calls mgp_list_append_move, mgp_map_insert_move and mgp_unordered_map_make_empty. Memgraph 3.1.1 ships none of them, so the module fails to compile against a stock 3.1 install. Add guarded shims implementing the three on top of the copying variants, and detect the situation in meson via cc.has_header_symbol rather than requiring -DSYNC_KGRAPH_MGP_COMPAT to be passed by hand. Against newer headers the shims compile out entirely and nothing changes. Note for review: mgp_list_append and mgp_map_insert copy the value, so the shims destroy the source on success to preserve the move-semantics contract the call sites rely on (they destroy the value themselves on failure). That mirrors what the real *_move functions do, but it is an assumption about the intended contract rather than something the headers state, so it is worth confirming.
Owner
|
#2 supersedes this and carries the same commits + the syntax-check failures fixed @vkatter-uantwerpen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A clean checkout does not build against a stock Memgraph 3.1 install. Two
independent reasons, one commit each.
1. meson stops before compiling
meson.buildsetsc_std=c23, but meson only recognises that value from 1.4,while the project declares
meson_version: '>=1.3.0'. On meson 1.3.x:c2xselects the same standard and is accepted across the whole declared mesonrange, so the first commit just changes the spelling.
2. Three
mgp_*functions do not exist in 3.1.1src/memgraph/sync_module.ccallsmgp_list_append_move,mgp_map_insert_moveandmgp_unordered_map_make_empty. None are declared inmg_procedure.hon Memgraph 3.1.1, so the module fails to compile.The second commit adds guarded shims built on the copying variants
(
mgp_list_append,mgp_map_insert,mgp_map_make_empty), and has mesondetect the situation with
cc.has_header_symbolinstead of requiring-DSYNC_KGRAPH_MGP_COMPATto be passed by hand:Against newer headers the symbol is found, the shims compile out entirely, and
nothing changes.
One thing worth your review
mgp_list_appendandmgp_map_insertcopy the value, so the shims destroy thesource on success in order to preserve the move-semantics contract the call
sites rely on (they already destroy the value themselves on failure). I believe
that matches what the real
*_movefunctions do, but it is my inference aboutthe intended contract rather than something the headers state — and if it is
wrong it is a leak or a double free rather than a compile error. You wrote the
call sites, so you are better placed to confirm it than I am.
Nothing currently exercises it either: the shims are only reachable on older
Memgraph headers, and the test suite covers
src/sync.crather than the module.Verified
Fresh clone of this branch, Memgraph 3.1.1 headers, meson 1.3.2, clang 18:
Builds
sync.sowith no hand-passed flags, andmeson test -C buildpasses.