sillsdev / TheCombine

This is a tool for supporting the rapid word collection workshop and post workshop clean-up
https://sillsdev.github.io/TheCombine/
MIT License
16 stars 13 forks source link

LIFT import/export fails for dev on mac #927

Open imnasnainaec opened 3 years ago

imnasnainaec commented 3 years ago

Recreate issue:

Test run for ~/TheCombine/Backend.Tests/bin/Debug/netcoreapp3.1/Backend.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
  X TestExportDeleted [105ms]
  Error Message:
   SIL.PlatformUtilities.NativeException : An error with the number, 13, ocurred.
  Stack Trace:
     at SIL.Threading.GlobalMutex.LinuxGlobalMutexAdapter.Init(Boolean initiallyOwned)
   at SIL.Threading.GlobalMutex.Initialize()
   at SIL.WritingSystems.Sldr.Initialize(Boolean offlineMode, String sldrCachePath, DateTime embeddedAllTagsTime)
   at SIL.WritingSystems.Sldr.Initialize(Boolean offlineMode, String sldrCachePath)
   at SIL.WritingSystems.Sldr.Initialize(Boolean offlineMode)
   at BackendFramework.Services.LiftService..ctor() in ~/TheCombine/Backend/Services/LiftApiServices.cs:line 98
   at Backend.Tests.Controllers.LiftControllerTests.Setup() in ~/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 39
  X TestRoundtrip(Backend.Tests.Controllers.LiftControllerTests+RoundTripObj) [2s 48ms]
  Error Message:
     Expected: True
  But was:  False

  Stack Trace:
     at Backend.Tests.Controllers.LiftControllerTests.TestRoundtrip(RoundTripObj roundTripObj) in ~/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 315

The SIL GlobalMutex has been written for Windows and Linux, and defaults to Linux when Windows isn't detected: https://github.com/sillsdev/libpalaso/blob/d2d16493c4680d052f940f4b0ff9afc6fc7798b5/SIL.Core/Threading/GlobalMutex.cs#L25-L35

imnasnainaec commented 3 years ago

At least part of the problem is that it needs permission to write to /var/lock.

jasonleenaylor commented 3 years ago

Addressed in libpalaso PR#1056: (https://github.com/sillsdev/libpalaso/pull/1056)

imnasnainaec commented 3 years ago

Related: #471

imnasnainaec commented 3 years ago

The error is now:

% npm run test-backend

> thecombine@0.6.8 test-backend ~/TheCombine
> dotnet test Backend.Tests/Backend.Tests.csproj

Test run for ~/TheCombine/Backend.Tests/bin/Debug/netcoreapp3.1/Backend.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
  X TestRoundtrip(Backend.Tests.Controllers.LiftControllerTests+RoundTripObj) [5s 524ms]
  Error Message:
   System.AggregateException : One or more errors occurred. (Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibdl.so, 1): image not found)
  ----> System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibdl.so, 1): image not found
  Stack Trace:
     at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Backend.Tests.Controllers.LiftControllerTests.TestRoundtrip(RoundTripObj roundTripObj) in ~/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 337
--DllNotFoundException
   at Icu.NativeMethods.dlopen(String file, Int32 mode)
   at Icu.NativeMethods.GetIcuLibHandle(String basename, Int32 icuVersion)
   at Icu.NativeMethods.LoadIcuLibrary(String libraryName)
   at Icu.NativeMethods.get_IcuCommonLibHandle()
   at Icu.NativeMethods.uset_open(Char start, Char end)
   at Icu.UnicodeSet.ToPattern(IEnumerable`1 set)
   at SIL.WritingSystems.LdmlDataMapper.WriteCharactersElement(XElement charactersElem, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.WriteLdml(XmlWriter writer, XElement element, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.Write(String filePath, WritingSystemDefinition ws, Stream oldFile)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.SaveDefinition(T ws)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.Save()
   at BackendFramework.Services.LiftService.LdmlExport(String filePath, String vernacularBcp47, List`1 validChars) in ~/TheCombine/Backend/Services/LiftApiServices.cs:line 464
   at BackendFramework.Services.LiftService.LiftExport(String projectId, IWordRepository wordRepo, IProjectService projService) in ~/TheCombine/Backend/Services/LiftApiServices.cs:line 341
   at BackendFramework.Controllers.LiftController.CreateLiftExport(String projectId) in ~/TheCombine/Backend/Controllers/LiftController.cs:line 260
imnasnainaec commented 3 years ago

Addressed in libpalaso PR#1056: (sillsdev/libpalaso#1056)

Also partially addressed in https://github.com/sillsdev/icu-dotnet/pull/142

imnasnainaec commented 2 years ago

This issue is awaiting a fix for https://github.com/sillsdev/icu-dotnet/issues/141

imnasnainaec commented 1 year ago

We've updated to icu-dotnet v2.9 and the error is still multiple occurrences of System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies., such as:

  Failed TestDeletedWordsExportToLift [175 ms]
  Error Message:
   System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibdl.so, 0x0001): tried: 'liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibdl.so' (no such file), '/usr/lib/liblibdl.so' (no such file, not in dyld cache), 'liblibdl.so' (no such file), '/usr/local/lib/liblibdl.so' (no such file), '/usr/lib/liblibdl.so' (no such file, not in dyld cache)
TearDown : System.InvalidOperationException : Sequence contains no matching element
  Stack Trace:
     at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError)
   at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
   at Icu.DllResolver.MapAndLoad(String libraryName, Assembly assembly, Nullable`1 dllImportSearchPath)
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
   at Icu.NativeMethods.dlopen(String file, Int32 mode)
   at Icu.NativeMethods.GetIcuLibHandle(String basename, Int32 icuVersion)
   at Icu.NativeMethods.LoadIcuLibrary(String libraryName)
   at Icu.NativeMethods.get_IcuCommonLibHandle()
   at Icu.NativeMethods.u_getUnicodeVersion(VersionInfo& versionArray)
   at Icu.Wrapper.get_UnicodeVersion()
   at SIL.WritingSystems.Sldr.InitializeGetUnicodeCategoryBasedOnIcu()
   at SIL.WritingSystems.Sldr.Initialize(Boolean offlineMode, String sldrCachePath, DateTime embeddedAllTagsTime)
   at SIL.WritingSystems.Sldr.Initialize(Boolean offlineMode, String sldrCachePath)
   at SIL.WritingSystems.Sldr.Initialize(Boolean offlineMode)
   at BackendFramework.Services.LiftService..ctor() in /Users/dror/sil/TheCombine/Backend/Services/LiftService.cs:line 96
   at Backend.Tests.Controllers.LiftControllerTests.Setup() in /Users/dror/sil/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 42
--TearDown
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Backend.Tests.Mocks.ProjectRepositoryMock.Delete(String id) in /Users/dror/sil/TheCombine/Backend.Tests/Mocks/ProjectRepositoryMock.cs:line 64
   at Backend.Tests.Controllers.LiftControllerTests.TearDown() in /Users/dror/sil/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 56
imnasnainaec commented 1 year ago

After manually copying icu.net.dll.config to Backend.Tests/bin/Debug/net6.0/, when I run npm run test-backend, the error is now multiple occurrences of:

  Error Message:
   System.AggregateException : One or more errors occurred. (Can't load ICU library (version 0))
  ----> System.IO.FileLoadException : Can't load ICU library (version 0)
  Stack Trace:
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Backend.Tests.Controllers.LiftControllerTests.TestRoundtrip(RoundTripObj roundTripObj) in /Users/dror/sil/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 332
--FileLoadException
   at Icu.NativeMethods.LoadIcuLibrary(String libraryName)
   at Icu.NativeMethods.get_IcuCommonLibHandle()
   at Icu.NativeMethods.uset_open(Char start, Char end)
   at Icu.UnicodeSet.ToPattern(IEnumerable`1 set)
   at SIL.WritingSystems.LdmlDataMapper.WriteCharactersElement(XElement charactersElem, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.WriteLdml(XmlWriter writer, XElement element, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.Write(String filePath, WritingSystemDefinition ws, Stream oldFile)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.SaveDefinition(T ws)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.Save()
   at BackendFramework.Services.LiftService.LdmlExport(String filePath, String vernacularBcp47, List`1 validChars) in /Users/dror/sil/TheCombine/Backend/Services/LiftService.cs:line 489
   at BackendFramework.Services.LiftService.LiftExport(String projectId, IWordRepository wordRepo, IProjectRepository projRepo) in /Users/dror/sil/TheCombine/Backend/Services/LiftService.cs:line 345
   at BackendFramework.Controllers.LiftController.CreateLiftExport(String projectId) in /Users/dror/sil/TheCombine/Backend/Controllers/LiftController.cs:line 259
imnasnainaec commented 5 months ago

With <PackageReference Include="icu.net" Version="2.9.1-beta.6" /> in Backend/BackendFramework.csproj, the error is as in the previous comment. However, when updated to Version="2.9.1-beta.8" (incorporating https://github.com/sillsdev/icu-dotnet/pull/194), the error regresses to System.AggregateException : One or more errors occurred. (Unable to load shared library 'libdl.so' or one of its dependencies. as before.

imnasnainaec commented 5 months ago

Updated The Combine to .NET 8 and tried again with Version="2.9.1-beta.8" but failed to copy icu.net.dll.config to Backend.Tests/bin/Debug/net8.0/. The error message was as below. When I copied over the config file, I once again got System.AggregateException : One or more errors occurred. (Can't load ICU library (version 0)).

  Failed TestRoundtrip(Backend.Tests.Controllers.LiftControllerTests+RoundTripObj) [499 ms]
  Error Message:
   System.AggregateException : One or more errors occurred. (Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: 
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib' (no such file)
dlopen(libdl.so.dylib, 0x0001): tried: 'libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibdl.so.dylib' (no such file), '/usr/lib/libdl.so.dylib' (no such file, not in dyld cache), 'libdl.so.dylib' (no such file), '/usr/local/lib/libdl.so.dylib' (no such file), '/usr/lib/libdl.so.dylib' (no such file, not in dyld cache)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib' (no such file)
dlopen(liblibdl.so.dylib, 0x0001): tried: 'liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibdl.so.dylib' (no such file), '/usr/lib/liblibdl.so.dylib' (no such file, not in dyld cache), 'liblibdl.so.dylib' (no such file), '/usr/local/lib/liblibdl.so.dylib' (no such file), '/usr/lib/liblibdl.so.dylib' (no such file, not in dyld cache)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so' (no such file)
dlopen(libdl.so, 0x0001): tried: 'libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibdl.so' (no such file), '/usr/lib/libdl.so' (no such file, not in dyld cache), 'libdl.so' (no such file), '/usr/local/lib/libdl.so' (no such file), '/usr/lib/libdl.so' (no such file, not in dyld cache)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so' (no such file)
dlopen(liblibdl.so, 0x0001): tried: 'liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibdl.so' (no such file), '/usr/lib/liblibdl.so' (no such file, not in dyld cache), 'liblibdl.so' (no such file), '/usr/local/lib/liblibdl.so' (no such file), '/usr/lib/liblibdl.so' (no such file, not in dyld cache)
)
  ----> System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: 
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so.dylib' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so.dylib' (no such file)
dlopen(libdl.so.dylib, 0x0001): tried: 'libdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibdl.so.dylib' (no such file), '/usr/lib/libdl.so.dylib' (no such file, not in dyld cache), 'libdl.so.dylib' (no such file), '/usr/local/lib/libdl.so.dylib' (no such file), '/usr/lib/libdl.so.dylib' (no such file, not in dyld cache)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so.dylib' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so.dylib' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so.dylib' (no such file)
dlopen(liblibdl.so.dylib, 0x0001): tried: 'liblibdl.so.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibdl.so.dylib' (no such file), '/usr/lib/liblibdl.so.dylib' (no such file, not in dyld cache), 'liblibdl.so.dylib' (no such file), '/usr/local/lib/liblibdl.so.dylib' (no such file), '/usr/lib/liblibdl.so.dylib' (no such file, not in dyld cache)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/libdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/libdl.so' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/libdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/libdl.so' (no such file)
dlopen(libdl.so, 0x0001): tried: 'libdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibdl.so' (no such file), '/usr/lib/libdl.so' (no such file, not in dyld cache), 'libdl.so' (no such file), '/usr/local/lib/libdl.so' (no such file), '/usr/lib/libdl.so' (no such file, not in dyld cache)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx/native/liblibdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/runtimes/osx-x64/native/liblibdl.so' (no such file)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.6/liblibdl.so' (no such file)
dlopen(/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so, 0x0001): tried: '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so' (no such file), '/Users/dror/sil/TheCombine/Backend.Tests/bin/Debug/net8.0/liblibdl.so' (no such file)
dlopen(liblibdl.so, 0x0001): tried: 'liblibdl.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibdl.so' (no such file), '/usr/lib/liblibdl.so' (no such file, not in dyld cache), 'liblibdl.so' (no such file), '/usr/local/lib/liblibdl.so' (no such file), '/usr/lib/liblibdl.so' (no such file, not in dyld cache)

  Stack Trace:
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Backend.Tests.Controllers.LiftControllerTests.TestRoundtrip(RoundTripObj roundTripObj) in /Users/dror/sil/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 595
   at InvokeStub_LiftControllerTests.TestRoundtrip(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--DllNotFoundException
   at System.Runtime.InteropServices.NativeLibrary.<LoadByName>g____PInvoke|2_0(UInt16* __libraryName_native, QCallAssembly __callingAssembly_native, Int32 __hasDllImportSearchPathFlag_native, UInt32 __dllImportSearchPathFlag_native, Int32 __throwOnError_native)
   at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
   at Icu.DllResolver.MapAndLoad(String libraryName, Assembly assembly, Nullable`1 dllImportSearchPath)
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
   at Icu.NativeMethods.dlopen(String file, Int32 mode)
   at Icu.NativeMethods.GetIcuLibHandle(String basename, Int32 icuVersion)
   at Icu.NativeMethods.LoadIcuLibrary(String libraryName)
   at Icu.NativeMethods.get_IcuCommonLibHandle()
   at Icu.NativeMethods.uset_open(Char start, Char end)
   at Icu.UnicodeSet.ToPattern(IEnumerable`1 set)
   at SIL.WritingSystems.LdmlDataMapper.WriteCharactersElement(XElement charactersElem, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.WriteLdml(XmlWriter writer, XElement element, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.Write(String filePath, WritingSystemDefinition ws, Stream oldFile)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.SaveDefinition(T ws)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.Save()
   at BackendFramework.Services.LiftService.LdmlExport(String filePath, WritingSystem vernacularWS, List`1 validChars) in /Users/dror/sil/TheCombine/Backend/Services/LiftService.cs:line 606
   at BackendFramework.Services.LiftService.LiftExport(String projectId, IWordRepository wordRepo, IProjectRepository projRepo) in /Users/dror/sil/TheCombine/Backend/Services/LiftService.cs:line 382
   at BackendFramework.Controllers.LiftController.CreateLiftExport(String projectId) in /Users/dror/sil/TheCombine/Backend/Controllers/LiftController.cs:line 357
imnasnainaec commented 4 months ago

Solved with https://github.com/sillsdev/icu-dotnet/pull/198 (https://www.nuget.org/packages/icu.net/2.9.1-beta.9, <PackageReference Include="icu.net" Version="2.9.1-beta.9" />)!