Skip to content

build: fix Visual Studio build #4300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,46 @@ jobs:
with:
path: integration-test

msbuild:
needs: build-sentry-native
name: MSBuild
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Download sentry-native (Windows)
uses: actions/cache/restore@v4
with:
path: src/Sentry/Platforms/Native/sentry-native
key: sentry-native-Windows-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Setup Environment
uses: ./.github/actions/environment

- name: Build Native Dependencies
uses: ./.github/actions/buildnative

- name: Setup MSBuild
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2

- name: Run MSBuild
id: msbuild
run: msbuild Sentry-CI-Build-Windows.slnf -t:Restore,Build -p:Configuration=Release --nologo -v:minimal -flp:logfile=msbuild.log -p:CopyLocalLockFileAssemblies=true -bl:msbuild.binlog

- name: Upload logs
if: ${{ steps.msbuild.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target || runner.os }}-msbuild-logs
path: |
msbuild.log
msbuild.binlog

trim-analysis:
needs: build-sentry-native
Expand Down
10 changes: 5 additions & 5 deletions src/Sentry/Platforms/Native/Sentry.Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@
</ItemGroup>

<!-- Packaging the native library (NOTE: $(RuntimeIdentifier) is not set) -->
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'win-x64'">
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'win-x64'">
<None Include="$(SentryNativeOutputDirectory-win-x64)$(SentryNativeLibraryName).lib">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-win-x64)</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'win-arm64'">
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'win-arm64'">
<None Include="$(SentryNativeOutputDirectory-win-arm64)$(SentryNativeLibraryName).lib">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-win-arm64)</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'linux-x64'">
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-x64'">
<None Include="$(SentryNativeOutputDirectory-linux-x64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-x64)</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'linux-musl-x64'">
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-musl-x64'">
<None Include="$(SentryNativeOutputDirectory-linux-musl-x64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-musl-x64)</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'linux-arm64'">
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(NETCoreSdkRuntimeIdentifier)' == 'linux-arm64'">
<None Include="$(SentryNativeOutputDirectory-linux-arm64)lib$(SentryNativeLibraryName).a">
<Pack>true</Pack>
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-arm64)</PackagePath>
Expand Down
Loading