Repository navigation
Drop the unused libnsl dependency from the bundled Xerces - #90
Merged
Merged
Conversation
The bundled libxerces-c needs libnsl.so.2 but imports none of its symbols. Ubuntu 24.04 doesn't install libnsl2 by default, so import failed there until users installed it. The build now removes that DT_NEEDED entry with patchelf, and CI no longer installs libnsl2, so the tests prove the wheel works without it. Fixes #59 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test stands in for a MIKE installation with the unpatched NuGet libraries, whose Xerces still needs libnsl.so.2. Without libnsl2 it can't load, as on ubuntu-latest now that CI no longer installs it. The README says such an installation may need libnsl2 on Ubuntu 24.04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bundled
libxerces-clistslibnsl.so.2as a dependency but imports none of its symbols (0 of its 89 undefined symbols come from libnsl, and it never callsdlopen). The build now drops that entry with patchelf, next to the existing renaming:isolate_linux_libs patchelf --force-rpath --set-rpath $ORIGIN --set-soname <tagged> --replace-needed <lib> <tagged lib> ... + --remove-needed libnsl.so.2CI no longer runs
apt-get install libnsl2infull_test.yml,build_package.ymlortest_mikeio.yml. Those steps were added becauseubuntu-latest(24.04) doesn't ship libnsl2, so passing runs without them prove the fix.Evidence
readelf -d libxerces-c-3.2-mikecore-python.solistsNEEDED libnsl.so.2. On Ubuntu 24.04 withoutlibnsl2,import mikecorefails to load the native libraries.After: the
NEEDEDlist is glibc, libstdc++, libgcc_s and our tagged libs only. The built wheel in a cleanubuntu:24.04container (nolibnsl.so.2): 341 passed, 2 skipped, 8 xfailed.test_eum_conversion:eumICarbonEmmisionFactornot a validEUMType;test_select_area_rotated_UTM_2: last-digit float difference) also fail onmaster(run), and the EUM one fails on Windows too, so they aren't caused by this PR.Merge Danger
Door: two-way
Revert the commit to restore the dependency and the CI install steps.
Blast Radius: Linux users
If Xerces did need libnsl at runtime, Linux users would see unresolved symbols. Symbol analysis and both test suites say it doesn't. Users who set
MIKECORE_PYTHON_BINto a MIKE installation still use that installation's Xerces, which still needs libnsl2. The README now says so, andtest_installation_libraries_read_like_the_bundled_onesskips whenlibnsl.so.2can't be loaded, as onubuntu-latestnow. Windows is unaffected.Fixes #59
🤖 Generated with Claude Code