Skip to content
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

Linux support #831

Open
wants to merge 22 commits into
base: next
Choose a base branch
from
Open
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
12 changes: 7 additions & 5 deletions .buildkite/block.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ steps:
- label: 'Upload the full test pipeline'
depends_on: 'trigger-full-build'
command: >
buildkite-agent pipeline upload .buildkite/pipeline.android.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml
# buildkite-agent pipeline upload .buildkite/pipeline.android.full.yml &&
# buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml &&
# buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml &&
# buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml &&
buildkite-agent pipeline upload .buildkite/pipeline.linux.full.yml &&
JamesLindsay0 marked this conversation as resolved.
Show resolved Hide resolved
# echo "Waiting on https://smartbear.atlassian.net/browse/PLAT-12563 buildkite-agent pipeline upload .buildkite/pipeline.linux.full.yml" &&
# buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml
214 changes: 214 additions & 0 deletions .buildkite/pipeline.linux.full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
aliases:
- &2020 "2020.3.48f1"
- &2021 "2021.3.36f1"
- &2022 "2022.3.22f1"
- &2023 "2023.2.19f1"

# Waiting on https://smartbear.atlassian.net/browse/PLAT-12563
agents:
queue: macos-14

timeout_in_minutes: 60

steps:
#
# Build Linux test fixtures
#

# Skipped - PLAT-12628
# - label: Build Unity 2020 Linux test fixture
# timeout_in_minutes: 30
# key: "linux-2020-fixture"
# depends_on: "build-artifacts"
# env:
# UNITY_VERSION: *2020
# plugins:
# artifacts#v1.9.0:
# download:
# - Bugsnag.unitypackage
# upload:
# - unity.log
# - features/fixtures/maze_runner/build/linux-release-2020.zip
# commands:
# - scripts/ci-build-linux-fixture.sh release
# retry:
# automatic:
# - exit_status: "*"
# limit: 1

- label: Build Unity 2021 linux test fixture
timeout_in_minutes: 30
key: "linux-2021-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2021
commands:
- scripts/ci-build-linux-fixture.sh release
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- features/fixtures/maze_runner/build/linux-release-2021.zip
retry:
automatic:
- exit_status: "*"
limit: 1

# Skipped - PLAT-12629
# - label: Build Unity 2021 linux DEV test fixture
# timeout_in_minutes: 30
# key: "linux-2021-dev-fixture"
# depends_on: "build-artifacts"
# env:
# UNITY_VERSION: *2021
# commands:
# - scripts/ci-build-linux-fixture.sh dev
# plugins:
# artifacts#v1.9.0:
# download:
# - Bugsnag.unitypackage
# upload:
# - unity.log
# - unity_import.log
# - features/fixtures/maze_runner/build/linux-dev-2021.zip
# retry:
# automatic:
# - exit_status: "*"
# limit: 1

- label: Build Unity 2022 linux test fixture
timeout_in_minutes: 30
key: "linux-2022-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2022
commands:
- scripts/ci-build-linux-fixture.sh release
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- features/fixtures/maze_runner/build/linux-release-2022.zip
retry:
automatic:
- exit_status: "*"
limit: 1

- label: Build Unity 2023 linux test fixture
timeout_in_minutes: 30
key: "linux-2023-fixture"
depends_on: "build-artifacts"
env:
UNITY_VERSION: *2023
commands:
- scripts/ci-build-linux-fixture.sh release
plugins:
artifacts#v1.9.0:
download:
- Bugsnag.unitypackage
upload:
- unity.log
- unity_import.log
- features/fixtures/maze_runner/build/linux-release-2023.zip
retry:
automatic:
- exit_status: "*"
limit: 1

#
# Run linux e2e tests
#

# Skipped - PLAT-12628
# - label: Run linux e2e tests for Unity 2020
# timeout_in_minutes: 30
# depends_on: "linux-2020-fixture"
# env:
# UNITY_VERSION: *2020
# agents:
# queue: "opensource-ubuntu-1804-unity"
# plugins:
# artifacts#v1.9.0:
# download:
# - features/fixtures/maze_runner/build/linux-release-2020.zip
# upload:
# - maze_output/**/*
# - maze_output/metrics.csv
# command:
# - scripts/ci-run-linux-tests.sh release

- label: Run linux e2e tests for Unity 2021
timeout_in_minutes: 30
depends_on: "linux-2021-fixture"
env:
UNITY_VERSION: *2021
DEBUG: "true"
agents:
queue: "opensource-ubuntu-1804-unity"
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-release-2021.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh release

- label: Run linux e2e DEV tests for Unity 2021
timeout_in_minutes: 30
depends_on: "linux-2021-dev-fixture"
env:
UNITY_VERSION: *2021
agents:
queue: "opensource-ubuntu-1804-unity"
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-dev-2021.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh dev

# Skipped - PLAT-12629
# - label: Run linux e2e tests for Unity 2022
# timeout_in_minutes: 30
# depends_on: "linux-2022-fixture"
# env:
# UNITY_VERSION: *2022
# agents:
# queue: "opensource-ubuntu-1804-unity"
# plugins:
# artifacts#v1.9.0:
# download:
# - features/fixtures/maze_runner/build/linux-release-2022.zip
# upload:
# - maze_output/**/*
# - maze_output/metrics.csv
# commands:
# - scripts/ci-run-linux-tests.sh release

- label: Run linux e2e tests for Unity 2023
timeout_in_minutes: 30
depends_on: "linux-2023-fixture"
env:
UNITY_VERSION: *2023
agents:
queue: "opensource-ubuntu-1804-unity"
plugins:
artifacts#v1.9.0:
download:
- features/fixtures/maze_runner/build/linux-release-2023.zip
upload:
- maze_output/**/*
- maze_output/metrics.csv
commands:
- scripts/ci-run-linux-tests.sh release
2 changes: 0 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ steps:
- exit_status: "*"
limit: 1



# - label: ':android: Build Android EDM test fixture for Unity 2021'
# timeout_in_minutes: 30
# key: 'build-edm-fixture-2021'
Expand Down
11 changes: 6 additions & 5 deletions .buildkite/pipeline_trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ if [[ "$BUILDKITE_MESSAGE" == *"[full ci]"* ||
! -z "$FULL_SCHEDULED_BUILD" ||
"$BUILDKITE_PULL_REQUEST_BASE_BRANCH" == "master" ]]; then
echo "Running full build"
buildkite-agent pipeline upload .buildkite/pipeline.android.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml
# buildkite-agent pipeline upload .buildkite/pipeline.android.full.yml
# buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml
# buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml
# buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml
buildkite-agent pipeline upload .buildkite/pipeline.linux.full.yml
# buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml
else
# Basic build, but allow a full build to be triggered
echo "Running basic build"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Gemfile.lock
build
.DS_store
.gradle
Expand Down
6 changes: 6 additions & 0 deletions BugsnagUnity.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BugsnagUnity.MacOS", "src\B
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BugsnagUnity.Windows", "src\BugsnagUnity\BugsnagUnity.Windows.csproj", "{B8C265A4-657B-4378-8726-0BEC774108D1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BugsnagUnity.Linux", "src\BugsnagUnity\BugsnagUnity.Linux.csproj", "{B8C265A4-657B-4378-8726-0BEC774108D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -56,6 +58,10 @@ Global
{B8C265A4-657B-4378-8726-0BEC774108D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8C265A4-657B-4378-8726-0BEC774108D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8C265A4-657B-4378-8726-0BEC774108D1}.Release|Any CPU.Build.0 = Release|Any CPU
{B8C265A4-657B-4378-8726-0BEC774108D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8C265A4-657B-4378-8726-0BEC774108D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8C265A4-657B-4378-8726-0BEC774108D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8C265A4-657B-4378-8726-0BEC774108D2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
39 changes: 35 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,44 @@

## Set up a development environment

- Clone the repo including submodules
Clone the repo including submodules

```
git clone --recursive [email protected]:bugsnag/bugsnag-unity
```
```
git clone --recursive [email protected]:bugsnag/bugsnag-unity
```

### OSX

- Install Unity
- Set up your Xcode (requires being a member of the Apple Developer Program)
- Set up the Android SDK (using [instructions](https://github.com/bugsnag/bugsnag-android/blob/master/CONTRIBUTING.md) from bugsnag-android)
- Open the example app in Unity
- You can build the app for iPhone or Android using the custom Build menu.

### Ubuntu 22.04

- Set up Unity
- Download Unity Hub with the custom repository using https://docs.unity3d.com/hub/manual/InstallHub.html. Note that Ubuntu 24.04 doesn't work currently.
- Install a Unity version.
- Set the `UNITY_VERSION` environment variables based on the Unity version; for example:
```
export UNITY_VERSION=2021.3.40f1
```
- Install the required libssl version with https://stackoverflow.com/a/72137153
- Install .NET with `sudo apt install dotnet-sdk-8.0`. The snap release doesn't work.
- Install Ruby 3.3.4 and bundler via https://stackoverflow.com/a/37956249. The snap release doesn't work.
- Setup Android
- `sudo apt-get install openjdk-11-jdk`
- `sudo snap install android-studio --classic`
- Use Android Studio open any project, click the hamburger menu -> Tools -> SDK -> SDK Tools. Then select and download NDK (side by side) and Android SDK Command-line Tools.
- Set `ANDROID_SDK_ROOT` to the path from Android Studio's hamburger menu -> Tools -> SDK -> Path. For example:
```
export ANDROID_SDK_ROOT=/home/username/Android/Sdk
```
- `bundle install`
- `bundle exec rake plugin:export`


## Installing and using multiple versions of Unity

You can install as many versions of Unity as you like on the same computer. On a Mac the installer creates a folder
Expand Down Expand Up @@ -72,6 +98,11 @@ The plugin can be built with a cache using `rake plugin:quick_export`.
bundle exec rake plugin:rebuild
```

To compile and export without the Android and iOS plugins (which is much faster), use:
```
bundle exec rake plugin:export_minimal
``

List available tasks using `rake -T`.

## Building Example
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ gem 'rake'
gem 'xcpretty'
gem 'xcodeproj'
gem 'cocoapods'
gem 'rake'

unless Gem.win_platform?
# Use official Maze Runner release
gem 'bugsnag-maze-runner', '~>9.0'

# Use a specific Maze Runner branch
# gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'master'
# gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'main'

# Use a local copy of Maze Runner for development purposes
#gem 'bugsnag-maze-runner', path: '../maze-runner'
Expand Down
Loading