3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-14 21:01:49 +00:00

Fix test-nuget on macOS by rewriting csproj with proper configuration

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-12 21:22:30 +00:00
parent d5fdcb8fcd
commit 7e452d9379

View file

@ -165,10 +165,23 @@ jobs:
cd test-nuget
dotnet new console
dotnet add package Microsoft.Z3 --source ../nuget-packages --prerelease
# Add RuntimeIdentifier to ensure native library is loaded correctly
sed -i '' '/<\/PropertyGroup>/i\
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>\
' test-nuget.csproj
# Configure project to properly load native dependencies on macOS x64
# Use full csproj rewrite to avoid sed escaping issues and ensure correct configuration
cat > test-nuget.csproj << 'CSPROJ'
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Z3" Version="*" />
</ItemGroup>
</Project>
CSPROJ
- name: Create test code
run: |
@ -224,10 +237,23 @@ jobs:
cd test-nuget
dotnet new console
dotnet add package Microsoft.Z3 --source ../nuget-packages --prerelease
# Add RuntimeIdentifier to ensure native library is loaded correctly
sed -i '' '/<\/PropertyGroup>/i\
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>\
' test-nuget.csproj
# Configure project to properly load native dependencies on macOS ARM64
# Use full csproj rewrite to avoid sed escaping issues and ensure correct configuration
cat > test-nuget.csproj << 'CSPROJ'
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Z3" Version="*" />
</ItemGroup>
</Project>
CSPROJ
- name: Create test code
run: |