Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 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
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ jobs:
path: package-dev/Plugins/Linux
wait-timeout: 3600

- name: Download Linux ARM64 SDK
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
with:
name: LinuxArm64-sdk
path: package-dev/Plugins/Linux/arm64
Comment thread
bitsandfoxes marked this conversation as resolved.
Outdated
wait-timeout: 3600

- name: Download Windows SDK
uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
host: ubuntu-latest
- target: Linux
host: ubuntu-latest
- target: LinuxArm64
host: ubuntu-22.04-arm
- target: Windows
host: windows-latest
- target: Cocoa
Expand Down
46 changes: 44 additions & 2 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
if [[ "${{ env.TARGET }}" == "Cocoa" ]]; then
cp -r package-dev/Plugins/iOS sdk-static/ || echo "never mind, no iOS files checked in..."
cp -r package-dev/Plugins/macOS sdk-static/ || echo "never mind, no macOS files checked in..."
elif [[ "${{ env.TARGET }}" == "LinuxArm64" ]]; then
mkdir -p sdk-static/Linux
cp -r package-dev/Plugins/Linux/arm64 sdk-static/Linux/ || echo "never mind, no arm64 files checked in..."
else
cp -r package-dev/Plugins/${{ env.TARGET }} sdk-static || echo "never mind, no files checked in..."
fi
Expand Down Expand Up @@ -80,6 +83,18 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive

- name: Installing Linux ARM64 Dependencies
if: ${{ env.TARGET == 'LinuxArm64' && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev libcurl4-openssl-dev libssl-dev build-essential cmake curl
set -eo pipefail
curl -sSL --retry 5 https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0 --install-dir /usr/share/dotnet
echo "/usr/share/dotnet" >> $GITHUB_PATH
env:
DEBIAN_FRONTEND: noninteractive

- name: Install .NET SDK
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5
Expand All @@ -92,7 +107,26 @@ jobs:

- name: Build
if: steps.cache.outputs.cache-hit != 'true'
run: dotnet msbuild /t:Build${{ env.TARGET }}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
shell: bash
run: |
if [[ "$TARGET" == "Linux" || "$TARGET" == "LinuxArm64" ]]; then
dotnet msbuild /t:BuildLinuxSDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
else
dotnet msbuild /t:Build${TARGET}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
fi

- name: Move Linux artifacts to arch folder
if: ${{ (env.TARGET == 'Linux' || env.TARGET == 'LinuxArm64') && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
if [[ "$TARGET" == "Linux" ]]; then
ARCH_FOLDER="x86_64"
else
ARCH_FOLDER="arm64"
fi
mkdir -p package-dev/Plugins/Linux/${ARCH_FOLDER}
mv package-dev/Plugins/Linux/libsentry.so package-dev/Plugins/Linux/${ARCH_FOLDER}/
mv package-dev/Plugins/Linux/libsentry.dbg.so package-dev/Plugins/Linux/${ARCH_FOLDER}/
Comment thread
bitsandfoxes marked this conversation as resolved.
Outdated

- name: Upload build logs on failure
# No build logs for Cocoa SDK as we assemble the xcframework from a downloaded release artifact
Expand All @@ -114,7 +148,15 @@ jobs:
retention-days: 14

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ env.TARGET != 'Cocoa' }}
if: ${{ env.TARGET == 'LinuxArm64' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/Linux/arm64
# Lower retention period - we only need this to retry CI.
retention-days: 14

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ env.TARGET != 'Cocoa' && env.TARGET != 'LinuxArm64' }}
with:
name: ${{ env.TARGET }}-sdk
path: package-dev/Plugins/${{ env.TARGET }}
Comment thread
bitsandfoxes marked this conversation as resolved.
Expand Down
17 changes: 11 additions & 6 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<SentryAndroidArtifactsDestination>$(SentryArtifactsDestination)Android/Sentry~/</SentryAndroidArtifactsDestination>
<!-- Native -->
<SentryNativeRoot>$(RepoRoot)modules/sentry-native/</SentryNativeRoot>
<SentryLinuxArtifactsDestination>$(SentryArtifactsDestination)Linux/Sentry/</SentryLinuxArtifactsDestination>
<SentryLinuxArtifactsDestination>$(SentryArtifactsDestination)Linux/</SentryLinuxArtifactsDestination>
<SentryLinuxX64ArtifactsDestination>$(SentryArtifactsDestination)Linux/x86_64/</SentryLinuxX64ArtifactsDestination>
<SentryLinuxArm64ArtifactsDestination>$(SentryArtifactsDestination)Linux/arm64/</SentryLinuxArm64ArtifactsDestination>
<SentryWindowsArtifactsDestination>$(SentryArtifactsDestination)Windows/Sentry/</SentryWindowsArtifactsDestination>
</PropertyGroup>

Expand Down Expand Up @@ -174,8 +176,11 @@ Expected to exist:

<Target Name="CleanLinuxSDK" AfterTargets="Clean" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'">
<RemoveDir Directories="$(SentryNativeRoot)build/" ContinueOnError="true" />
<Delete Files="$(SentryLinuxArtifactsDestination)libsentry.so" ContinueOnError="true" />
<Delete Files="$(SentryLinuxArtifactsDestination)libsentry.dbg.so" ContinueOnError="true" />
<RemoveDir Directories="$(SentryNativeRoot)build-arm64/" ContinueOnError="true" />
<Delete Files="$(SentryLinuxX64ArtifactsDestination)libsentry.so" ContinueOnError="true" />
<Delete Files="$(SentryLinuxX64ArtifactsDestination)libsentry.dbg.so" ContinueOnError="true" />
<Delete Files="$(SentryLinuxArm64ArtifactsDestination)libsentry.so" ContinueOnError="true" />
<Delete Files="$(SentryLinuxArm64ArtifactsDestination)libsentry.dbg.so" ContinueOnError="true" />
Comment thread
bitsandfoxes marked this conversation as resolved.
Outdated
</Target>

<Target Name="CleanWindowsSDK" AfterTargets="Clean" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'">
Expand Down Expand Up @@ -295,12 +300,12 @@ Expected to exist:
</Target>

<!-- Build the Sentry Native SDK for Linux: dotnet msbuild /t:BuildLinuxSDK src/Sentry.Unity -->
<!-- Outputs to Linux/ directory - CI moves to arch-specific folder -->
<Target Name="BuildLinuxSDK" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'
And $([MSBuild]::IsOsPlatform('Linux'))
And !Exists('$(SentryLinuxArtifactsDestination)libsentry.so')" BeforeTargets="BeforeBuild">
And $([MSBuild]::IsOsPlatform('Linux'))">
<Error Condition="!Exists('$(SentryNativeRoot)')" Text="Couldn't find the Native root at $(SentryNativeRoot)."></Error>

<Message Importance="High" Text="Building artifacts of Sentry Native SDK for Linux." />
<Message Importance="High" Text="Building Sentry Native SDK for Linux." />
Comment thread
cursor[bot] marked this conversation as resolved.

<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake -B build -D SENTRY_BACKEND=breakpad -D SENTRY_SDK_NAME=sentry.native.unity -D CMAKE_BUILD_TYPE=RelWithDebInfo -S ." />
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="cmake --build build --target sentry --parallel" />
Expand Down
12 changes: 9 additions & 3 deletions src/Sentry.Unity.Editor/Native/BuildPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,16 @@ private static void UploadDebugSymbols(IDiagnosticLogger logger, BuildTarget tar
}
break;
case BuildTarget.StandaloneLinux64:
var linuxSentryDbg = Path.GetFullPath($"Packages/{SentryPackageInfo.GetName()}/Plugins/Linux/Sentry/libsentry.dbg.so");
if (File.Exists(linuxSentryDbg))
// Add debug symbols for both x86_64 and ARM64 - sentry-cli will match by debug ID
var linuxSentryDbgX64 = Path.GetFullPath($"Packages/{SentryPackageInfo.GetName()}/Plugins/Linux/Sentry/x86_64/libsentry.dbg.so");
if (File.Exists(linuxSentryDbgX64))
{
paths += $" \"{linuxSentryDbg}\"";
paths += $" \"{linuxSentryDbgX64}\"";
}
var linuxSentryDbgArm64 = Path.GetFullPath($"Packages/{SentryPackageInfo.GetName()}/Plugins/Linux/Sentry/arm64/libsentry.dbg.so");
Comment thread
bitsandfoxes marked this conversation as resolved.
if (File.Exists(linuxSentryDbgArm64))
{
paths += $" \"{linuxSentryDbgArm64}\"";
Comment thread
bitsandfoxes marked this conversation as resolved.
}
break;
case BuildTarget.StandaloneOSX:
Expand Down
Loading