sbom-tool: Unable to load shared library 'MonoPosixHelper' or one of its dependencies
I’m unable to use the sbom-tool on macOS Ventura 13.2.1 as the tool immediately fails with the latest version of 0.3.3 with the following message:
Encountered error while running ManifestTool generation workflow. Error: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 22 (10 by maintainers)
@shawnfunke “Unable to load shared library ‘Mono.Unix’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libMono.Unix: No such file or directory” When running on an alpine docker image. It seems like it is currently not supported by the Mono.Unix library so we will be reverting back to Mono.Posix.NETStandard until we find a solution.
@sebasgomez238 I’ve replaced the package
Mono.PosixwithMono.Unixdirectly, that seems to fix the issue, see the output below:PS: You’ve used tabs instead of spaces in the
Directory.Packages.propsfile.@sebasgomez238 this error occurs if the incorrect runtime was specified during the build process. This issue only affects ARM based Macs.
If the above command is used to build the CLI it will result in the error below. I’ve set the
DYLD_PRINT_LIBRARIESenvironment variable to1for the output below.If instead of the runtime being set to
osx-arm64its set asosx-x64the CLI will output the expected result as seen below.The issue here is that the
Mono.Posix.NETStandard^1 NuGet package that is being used here does only include aosxruntime, no specific ARM runtime exist. This results in the dynamic library not being included in the final executable even ifIncludeNativeLibrariesForSelfExtractis set totruewhenever the runtime is set to ARM during the build process.Here’s some more details. Might be ARM/m1 related.
Apple M1 Max macOS 13.2.1
Reproduction:
dotnet tool install --global Microsoft.Sbom.DotNetToolsbom-tool generate -b <drop path> -bc <build components path> -pn <package name> -pv <package version> -ps <package supplier> -nsb <namespace uri base>Encountered error while running ManifestTool generation workflow. Error: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)