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
ignore meson subproject directories #496
Conversation
|
Thanks for your suggestion and the code! Before looking at the code too closely (for which others are better suited anyway), I am not sure whether we want to have this flag enabled by default like the submodules. I assume there are other projects out there that contain a I comparison, Git submodules are excluded by default by the REUSE spec, so it makes totally sense to also exclode them in the tool. |
The code of course checks whether meson is used as build system, and only then excludes directories in the subprojects folder.
Maybe I'm blind, but I cannot see any mention of git submodules in the spec to be excluded from linting .Only files that are part of version control or specifically excluded from version control are skipeed while linting. git submodules are under version control. |
Ah OK, I see. @carmenbianca @silverhook what do you think about such a specific ignore?
You are right, this issue is still open but the path is clear: the spec will ignore Git submodules. fsfe/reuse-docs#36 |
I see. This solves the issue for those that include subprojects via git submodules but not for those that include subprojects via other means, e.g. git subtree or verbatim copy. For a meson project it's pretty clear that every directory und ./subprojects is a subproject. If the --recursive flag will ever come around, it could make sense to subsum meson subprojects with git submodules. Why have I come up with this patch in the first place? Really a lot of my projects include subprojects via *git subtree and look like this, e.g. they're all esoteric in @carmenbianca's terms ;-)
As the subprojects are mine, too, the parent project would comply to REUSE, but in order to do so, I need to duplicate the dep5 files from all subprojects which is superfluous, as the information is already there. I'd really like to get rid of the unneeded dep5 file the the parent project. Maybe there's a better solution for my use case than this patch here? I don't know. |
|
As a side note, all my subprojects are checked for and pass REUSE compatibility individually as part of the build/test mechanism, so no information is lost by excluding them from linting of the parent project. E.g. when building/testing the parent project, meson builds/tests all its subprojects individually. Example output of the tests that are in one of my projects https://git.open-music-kontrollers.ch/lv2/mephisto.lv2 |
Meson subprojects should be handled similarly to git submodules. Meson
subprojects may actually be git submodules, but they may also just be
regular directories e.g. included via git subtree or via other means.
If the project of question uses meson as its build system, e.g. has the
following file:
./meson.build
Then directories in the subprojects root directory should be ignored by
default:
./subprojects/libfoo/foo.c
./subprojects/libbar/bar.c
Normal files in the subprojects root directory are normally parsed:
./subprojects/libfoo.wrap
./subprojects/libbar.wrap
This can be overriden with the command line switch:
reuse --include-meson-subprojects lint
Relevant resources are at [1] and [2].
[1] https://mesonbuild.com/Subprojects.html
[2] https://mesonbuild.com/Wrap-dependency-system-manual.html
Signed-off-by: Carmen Bianca Bakker <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca Bakker <carmenbianca@fsfe.org>
|
Pushed some changes/fixes to the branch; now LGTM. Thanks @ventosus ! Ready for review. |
|
Ah, this still needs a change log entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but yes, please do the changelog entry before merging.
|
Thank you! I'm looking forward to this change :)
|
Meson subprojects should be handled similarly to git submodules. Meson
subprojects may actually be git submodules, but they may also just be
regular directories e.g. included via git subtree or via other means.
If the project of question uses meson as its build system, e.g. has the
following file:
Then directories in the subprojects root directory should be ignored by
default:
Normal files in the subprojects root directory are normally parsed:
This can be overriden with the command line switch:
Relevant resources are at [1] and [2].
[1] https://mesonbuild.com/Subprojects.html
[2] https://mesonbuild.com/Wrap-dependency-system-manual.html