Use osx-x64 for mac rid rather than macos. #5288
Merged
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.
I hit an issue today when using the Microsoft.Z3.x64 package in a .NET 5.0 project and running the tests for my project on mac. Specifically it throws the following exception when running the tests.
After probing about in
MyTestProject/bin/x64/Debug/net5.0/runtimes
I noticed that thez3lib.dylib
was under a folder calledmacos
and that theMyTestProject.deps.json
file was pointing to this location for themacos
rid
. However, checking with the Microsoft documentation on which runtime identifiers are officially supported it seems thatmacos
is not a well known value. Insteadosx-x64
is the base rid for mac, as detailed here.Also running
dotnet --info
on my machine reveals my specificrid
to be:It seems that NuGet generates the
MyProject.deps.json
rid mappings based on the folder structure in the NuGet package and that the package is installed at~/.nuget/packages/microsoft.z3.x64/4.8.10/
. Inspecting that location showed again that under theruntimes
folder there was amacos
folder which contained thelibz3.dylib
file. If I copied / renamed this folder toosx-x64
, and then re-ran the tests in my project it was properly able to locateliibz3.dylib
.Therefore, I think the fix is to ensure that when the nuget package is created the
libz3.dylib
file is placed underosx-x64
rather thanmacos
.I've attempted a fix here, but I'm not completely certain I've identified the right places to ensure that the packaging is now done correctly.