-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 cmake subprojects on normal fallbacks #14007
Conversation
the normal dependency() function doesn't support cmake defines or various overrides that may be desired for compatibility so its best to completely ignore cmake subprojects unless explicitly fetched by cmake.subproject()
It seems there is a test case for this exact logic I'm of the opinion that resolving cmake subprojects from a normal |
The best way to completely ignore cmake subprojects for compatibility is to not have them in your project tree. Why would you add one if you didn't want to use it? Note that you can pass So it's my impression that the motivation for this PR was essentially just a documentation issue -- the Unfortunately there's still a difference between meson subprojects and cmake subprojects inasmuch as you cannot override options from the latter via command-line arguments to |
Looking further the cmake_args support appears to be mildly bonkers and only gets used for dependencies with It is also not tested in CI at all. Still I'd rather make this use case work somehow, rather than delete functionality. Also, if you want to delete this functionality, the correct way to do it is to fully revert #11730 rather than add a check that renders some code branches nonfunctional. |
I want the subproject to be used but I also want to configure it so I don't have 80 different features I don't use embedded in my binary
As mentioned by you (and be me on Matrix)
there is a larger difference in how meson and cmake work which make automatic cmake fallbacks unsuited.
reverting 11730, even just one commit, would cause a regression because now established functionality would suddenly stop working, this is absolutely NOT an option. this PR doesn't delete functionality either, it explicitly makes it so that cmake subprojects are only resolved when they can be explicitly handled e.g. by cmake.subproject() I'm open to adapting this, however I don't see a way of incorporating the existing cmake subproject system into dependency() without implicitly removing any support for other CMakeSubprojectOptions functionality. support for cmake subproject should be handled in the cmake module only, it doesn't make sense to do this elsewhere. |
No, what I said is that this PR does revert 11730 today. The github checks that are failing are checking to see if 11730's added feature works, namely:
Mechanically, your PR requires that a wrap file containing So, merging this PR causes the established functionality (of respecting Reverting 11730 would also remove the test cases which are currently failing in this PR. |
It's (still) not clear to me how this scenario comes up. The original claim by @xclaesse when he implemented #11730 was that normal fallbacks should never use a cmake subproject unless the wrap file contains A regular cmake subproject (does not contain Is there a testcase demonstrating the problematic fallback you are trying to avoid? |
closing because I'm no longer interested in working on this |
the normal dependency() function doesn't support cmake defines or various overrides that may be desired for compatibility so its best to completely ignore cmake subprojects unless explicitly fetched by cmake.subproject()
message and comment could probably be improved