-
Notifications
You must be signed in to change notification settings - Fork 555
[dotnet] Add support for .so files #16887
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
Conversation
OK, let's wait for that one to be complete & merged then, which makes it easier to review and test these changes. |
|
@ylatuya can you rebase this on main and fix the merge conflicts? |
|
Sure! I will also create a new test for it. |
5dae230 to
1c918d1
Compare
|
Integration test added and rebased |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Out of curiosity, why not? It seems to me that .dylibs and .so files should be treated the same way. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1c918d1 to
f35921e
Compare
By definition, libtool modules are libraries that are meant to be dlopened: https://www.gnu.org/software/automake/manual/html_node/Libtool-Modules.html. It's usually plugins such as the SVG loader for gdk-pixbuf, GIO modules, GStreamer plugins, etc... that will be loaded at runtime on-demand. Thinking about that, we might not want to treat all Using GStreamer as example, which ships its plugins as |
f35921e to
b227188
Compare
b227188 to
28d8b36
Compare
|
@rolfbjarne can you review this one please? |
|
/azp run |
Will do |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rolfbjarne
left a comment
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.
This looks good! It would be great if you could make a couple of minor improvements:
- Update the documentation in https://github.com/xamarin/xamarin-macios/blob/main/dotnet/BundleContents.md with the new behavior.
- Add a test case for
*.sofiles to the BundleStructure test here:- https://github.com/xamarin/xamarin-macios/tree/main/tests/dotnet/BundleStructure
- This would just be adding a
NoneQ.sofile in each subdirectory of the test project (so for iOS add the file here: https://github.com/xamarin/xamarin-macios/tree/main/tests/dotnet/BundleStructure/iOS, and likewise for the other platforms) - no need to add anything to the *.csproj, because these files should be added automatically to the build. - And then fix the unit test accordingly: https://github.com/xamarin/xamarin-macios/blob/main/tests/dotnet/UnitTests/BundleStructureTest.cs, probably somewhere around here: https://github.com/xamarin/xamarin-macios/blob/49d13fc0efe5e462a4a5273d26fe4245f19b8389/tests/dotnet/UnitTests/BundleStructureTest.cs#L130-L131
|
@ylatuya would be great to land this, can you address @rolfbjarne comment? |
Some projects like GStreamer, GIO or GdkPixbuf provide plugins as dynamic libraries that are loaded on demand at runtime. These libraries have usually the .dylib extension except for autotools-based projects using libtool's -module flag that generate libraries with the .so extension. These libraries need to be re-identified and deployed but that are not linked to the application.
aeae7c0 to
e1ef824
Compare
I am able to build xamarin-macios. When I run the tests with
I had a fix locally for this one that I forgot to commit. What is the error of the other failing test? The BCL one? |
That's a random issue unrelated to your PR. |
Ok! The failing test should be passing now. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rolfbjarne
left a comment
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.
This is looking better and better! Just a few really minor things left now.
| <!-- Bundled, not linked with, install_name_tool must have been executed --> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| </ItemGroup> |
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.
The NoneQ.so file you added doesn't seem to be used anywhere, so let's try to do that:
| </ItemGroup> | |
| <None Update="NoneQ.so"> | |
| <!-- Bundled, not linked with --> | |
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
| </None> | |
| </ItemGroup> |
this will require changes in the BundleStructureTest.cs file as well.
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 tried replicating the same structure as NoneQ, that has NoneQ.dylib and libNoneQ.dylib, so I created NoneQ.so and libNoneQ.so. It seems that NoneQ.dylib is not checked either and that's the reason why I simply added NoneQ.so. I though they just need to be there and simply ignored, since they are not real libraries, it's just a text file with the file extension.
e1ef824 to
9a38405
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)✅ Generator diffGenerator diff is empty Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 225 tests passed 🎉 Tests counts✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
|
Thanks a lot for your contribution! |
|
/sudo backport release/7.0.2xx |
|
Backport Job to branch release/7.0.2xx Created! The magic is happening here |
|
Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7281842 for more details. |
It was a great learning experience. Thanks a lot for your help during the process! |
Autotools-based project using libtool's -module flag generate plugins with the .so extension that needs to be treated like DynamicLibraries in terms of deployment location and relocation, except they are not linked to the app. This PR depends on #16706 Backport of #16887 Co-authored-by: Andoni Morales Alastruey <ylatuya@gmail.com>
Autotools-based project using libtool's -module flag generate plugins with the .so extension that needs to be treated like DynamicLibraries in terms of deployment location and relocation, except they are not linked to the app.
This PR depends on #16706