-
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
Improve the use of both_libraries #12632
Conversation
c41f08e
to
1a8115f
Compare
1a8115f
to
b09c4b1
Compare
f455e58
to
1682604
Compare
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.
I have some implementation suggestions, but overall this looks like a nice change to me.
65d0fbe
to
b8beae4
Compare
Otherwise, the both_libs object is resolved by the interpreter and we no longer have access to it from the dependency object.
b8beae4
to
37de678
Compare
@dcbaker I think I addressed all your comments. typing in build.py is not easy, as this file is not ready for typing yet, so I didn't tried to run mypy on it... |
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.
Thanks, looks good to me
Yeah. Don't. I've tried to fix it several times and it's a huge amount of work to get it all right. I'm hoping to get back to it after I get the machinefile, options, and coredata done. |
I suspect this is breaking gobject-introspection when building GStreamer with default_library=both.
|
The gnome module has a bunch of |
@dcbaker @bruchar1 This is causing GStreamer CI regression: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7753. |
I'm not really setup for working with the gnome module. Would running the test (e.g. framework/7 gnome) with both_libraries trigger the bug? My guess is that calling Maybe should you open a separate issue to track this? |
I managed to write a unit test: #13835. |
This partly reverts mesonbuild#12632 and provide an alternative implementation. The issue is we cannot propagate BothLibraries objects beyond the interpreter because it breaks many isinstance(obj, SharedLibrary) cases. Instead make SharedLibrary and StaticLibrary cross reference each other so we can take their brother library in as_static() and as_shared() methods.
This partly reverts mesonbuild#12632 and provide an alternative implementation. The issue is we cannot propagate BothLibraries objects beyond the interpreter because it breaks many isinstance(obj, SharedLibrary) cases. Instead make SharedLibrary and StaticLibrary cross reference each other so we can take their brother library in as_static() and as_shared() methods.
This partly reverts mesonbuild#12632 and provide an alternative implementation. The issue is we cannot propagate BothLibraries objects beyond the interpreter because it breaks many isinstance(obj, SharedLibrary) cases. Instead make SharedLibrary and StaticLibrary cross reference each other so we can take their brother library in as_static() and as_shared() methods.
This partly reverts mesonbuild#12632 and provide an alternative implementation. The issue is we cannot propagate BothLibraries objects beyond the interpreter because it breaks many isinstance(obj, SharedLibrary) cases. Instead make SharedLibrary and StaticLibrary cross reference each other so we can take their brother library in as_static() and as_shared() methods.
FIxes #5452
as_static
andas_shared
methods on dependencies for that (otherwise the default is automatically used)default_both_libraries
to configure the default behavior of both_dependencies. Previously, it was always the shared version by default.In my monorepo, I need to compile static and shared versions of many common libs, for different uses. For instance, I usually prefer the shared version, but for plugins, I need to compile them with static dependencies to make them independent from the version of the common libs used in the main app. With the proposed changes, I can remove a lot of duplication in my build files, by using both_libraries instead of having to duplicate shared_library and static_library, along with their respective declare_dependency.