-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix zlib-ng build failure caught in the sdk CI #104750
Conversation
Fixed by converting its NativeLibrary entry in Microsoft.NETCore.Native.Unix.targets to a NetCoreAppNativeLibrary, and place it after System.IO.Compression.Native, to ensure the linker detects the symbols, since it is unable to look back.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
In #104454 (comment), you mentioned that the failing test has We don't have anything resembling I think the SDK issue is that not all distros have same version of zlib-ng, so we will probably need a shim (like icushim, opensslshim) to require the set of APIs we need from the lib and polyfill the differences. |
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
Which is as good as not having UseSystemZlib in nativeaot at all. Also, this order dependent comment is not correct; these args are not order dependent, this is how library lookup path works on unix. I suggest we remove UseSystemZlib from nativeaot for now, until there is a better solution. It seems like an unnecessary risk to take this late in the release cycle. |
The condition check is not changed. It is still checking for
I just pushed a commit to fix the folder where the UseSystemZlib condition is checking on Unix. It should now be
All Unix desktop distros should use the newly added copy of zlib-ng, which we build ourselves It's under src/native/external/zlib-ng. The exceptions are mobile platforms (android, ios, tvos, maccatalyst): they should find and use the system-installed zlib, whatever it is. There should not be an issue with that since all zlib versions expose the same public methods. |
This is not what I meant? You are not addressing the issue SDK is having, but un-fixing something which is kind of working. Current state of this PR is actually never picking up zlib-ng which we compile in-tree.. |
I fixed it with 5daaa28, but didn't notice your comment until after I pushed it. We're not supposed to check there anymore with this fix.
It's within our plans to introduce zlib-ng in Preview7. It works in nativeaot. Bugs were expected, we're fixing them. |
Sorry, I'm not following. I'm not changing the condition in which we decide to use system zlib or not. We just needed to check in the correct folder. |
The current state of this PR is using system libz in both UseSystemZlib true and false cases. You probably need: - <NativeLibrary Condition="'$(UseSystemZlib)' != 'true'" Include="$(IlcSdkPath)libz.a" />
+ <NativeLibrary Condition="'$(UseSystemZlib)' != 'true'" Include="$(IlcFrameworkNativePath)libz.a" /> |
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
No, we don't want to use NativeLibrary. As I mentioned before, the order matters. We already investigated this and determined that was the root cause of the problem. The zlib library, whatever it is, needs to be added after System.IO.Compression.Native, and it needs to be a NetCoreAppNartiveLibrary, not a NativeLibrary. It needs to be Line 193 does the insertion of actual system zlib, with the condition reversed. |
|
I see what you're trying to say, and I can understand adding a |
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Show resolved
Hide resolved
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Fixed by converting its NativeLibrary entry in Microsoft.NETCore.Native.Unix.targets to a NetCoreAppNativeLibrary, and place it after System.IO.Compression.Native, to ensure the linker detects the symbols, since it is unable to look back.
Fixes this build failure: https://dev.azure.com/dnceng-public/public/_build/results?buildId=734455&view=logs&j=3a02e3c5-16cf-5fed-f87e-ba752007640e&t=0d50ed43-4be9-5564-4350-aed7d4fced7d