meson: add check that all present sources are mentioned in a build file #167

Open
opened 2024-03-22 00:47:15 +00:00 by jade · 5 comments
Owner

though we don't want to wild card at build time, we should at minimum CI that nobody has forgot any sources, above and beyond simply whether it builds or not. especially the headers list can get out of date.

though we don't want to wild card at build time, we should at minimum CI that nobody has forgot any sources, above and beyond simply whether it builds or not. especially the headers list can get out of date.
jade added the
devx
label 2024-03-22 00:47:15 +00:00
jade added this to the Meson migration project 2024-03-22 00:47:15 +00:00
Owner

Are you just imagining something that pulls out the Meson source inputs and then wildcards through the sources and errors or worns if there's a gap? I'm not sure we can throw a hard error on that but we could mark a non-required label with the CI just to alert authors?

Are you just imagining something that pulls out the Meson source inputs and then wildcards through the sources and errors or worns if there's a gap? I'm not sure we can throw a hard error on that but we could mark a non-required label with the CI just to alert authors?
Author
Owner

Are you just imagining something that pulls out the Meson source inputs and then wildcards through the sources and errors or worns if there's a gap? I'm not sure we can throw a hard error on that but we could mark a non-required label with the CI just to alert authors?

yeah or so. just cuz i made this mistake and i didn't seem to notice it getting caught automatically. we can't not throw a hard error, or else we can't distinguish between it getting worse and staying the same. basically. every file in src should be mentioned in at least one place.

> Are you just imagining something that pulls out the Meson source inputs and then wildcards through the sources and errors or worns if there's a gap? I'm not sure we can throw a hard error on that but we could mark a non-required label with the CI just to alert authors? yeah or so. just cuz i made this mistake and i didn't seem to notice it getting caught automatically. we can't *not* throw a hard error, or else we can't distinguish between it getting worse and staying the same. basically. every file in src should be mentioned in at least one place.
Owner

something something

set -euo pipefail
mesonFiles="$(fd -F meson.build)"
sourceFiles="$(fd '\.(cc|hh|h)')"
for f in "$sourceFiles"; do
	echo "$mesonFiles" | xargs rg "$f" # non-zero exit if no files match
done

but like. not scuffed

something something ```bash set -euo pipefail mesonFiles="$(fd -F meson.build)" sourceFiles="$(fd '\.(cc|hh|h)')" for f in "$sourceFiles"; do echo "$mesonFiles" | xargs rg "$f" # non-zero exit if no files match done ``` but like. not scuffed
Owner

this would be quite useful, it looks like https://gerrit.lix.systems/c/lix/+/505/10 caused a failure by forgetting to add a new file to the meson build files. we can totally see this being hella confusing

this would be quite useful, it looks like https://gerrit.lix.systems/c/lix/+/505/10 caused a failure by forgetting to add a new file to the meson build files. we can totally see this being hella confusing
Author
Owner

ought to be a pre commit check for this, tbh. it's cheap and simple. i would even be cool with shipping a scuffed script as long as it works properly.

though ideally maybe the whole thing should just be generated by a pre-commit hook if possible.

ought to be a pre commit check for this, tbh. it's cheap and simple. i would even be cool with shipping a scuffed script as long as it works properly. though ideally maybe the whole thing should just be generated by a pre-commit hook if possible.
Sign in to join this conversation.
No milestone
No assignees
4 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: lix-project/lix#167
No description provided.