Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 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
25 changes: 24 additions & 1 deletion .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 Down Expand Up @@ -114,7 +129,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
42 changes: 33 additions & 9 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 @@ -297,20 +302,39 @@ Expected to exist:
<!-- Build the Sentry Native SDK for Linux: dotnet msbuild /t:BuildLinuxSDK src/Sentry.Unity -->
<Target Name="BuildLinuxSDK" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'
And $([MSBuild]::IsOsPlatform('Linux'))
And !Exists('$(SentryLinuxArtifactsDestination)libsentry.so')" BeforeTargets="BeforeBuild">
And !Exists('$(SentryLinuxX64ArtifactsDestination)libsentry.so')" BeforeTargets="BeforeBuild">
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
<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." />
<!-- ===== x86_64 Build ===== -->
<Message Importance="High" Text="Building Sentry Native SDK for Linux x86_64." />

<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" />

<MakeDir Directories="$(SentryLinuxArtifactsDestination)"/>
<MakeDir Directories="$(SentryLinuxX64ArtifactsDestination)"/>

<!-- strip all, including exported symbols except those starting with 'sentry_', except for 'sentry__' -->
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="strip -s build/libsentry.so -w -K sentry_[^_]* -o $(SentryLinuxArtifactsDestination)libsentry.so" />
<Copy SourceFiles="$(SentryNativeRoot)build/libsentry.so" DestinationFiles="$(SentryLinuxArtifactsDestination)libsentry.dbg.so" />
<Exec WorkingDirectory="$(SentryLinuxArtifactsDestination)" Command="objcopy --add-gnu-debuglink=libsentry.dbg.so libsentry.so" />
<Exec WorkingDirectory="$(SentryNativeRoot)" Command="strip -s build/libsentry.so -w -K sentry_[^_]* -o $(SentryLinuxX64ArtifactsDestination)libsentry.so" />
<Copy SourceFiles="$(SentryNativeRoot)build/libsentry.so" DestinationFiles="$(SentryLinuxX64ArtifactsDestination)libsentry.dbg.so" />
<Exec WorkingDirectory="$(SentryLinuxX64ArtifactsDestination)" Command="objcopy --add-gnu-debuglink=libsentry.dbg.so libsentry.so" />
</Target>

<!-- Build the Sentry Native SDK for Linux ARM64: dotnet msbuild /t:BuildLinuxArm64SDK src/Sentry.Unity -->
<Target Name="BuildLinuxArm64SDK" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'
And $([MSBuild]::IsOsPlatform('Linux'))
And !Exists('$(SentryLinuxArm64ArtifactsDestination)libsentry.so')">
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
<Error Condition="!Exists('$(SentryNativeRoot)')" Text="Couldn't find the Native root at $(SentryNativeRoot)."></Error>

<Message Importance="High" Text="Building Sentry Native SDK for Linux ARM64." />

<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" />

<MakeDir Directories="$(SentryLinuxArm64ArtifactsDestination)"/>

<Exec WorkingDirectory="$(SentryNativeRoot)" Command="strip -s build/libsentry.so -w -K sentry_[^_]* -o $(SentryLinuxArm64ArtifactsDestination)libsentry.so" />
<Copy SourceFiles="$(SentryNativeRoot)build/libsentry.so" DestinationFiles="$(SentryLinuxArm64ArtifactsDestination)libsentry.dbg.so" />
<Exec WorkingDirectory="$(SentryLinuxArm64ArtifactsDestination)" Command="objcopy --add-gnu-debuglink=libsentry.dbg.so libsentry.so" />
</Target>

<!-- Even with a successful build, Unity will error on 'usbmuxd' or log out to std-error which breaks msbuild.
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