Skip to content

Commit 80a09f1

Browse files
authored
Merge pull request #222 from winnerspiros/copilot/fix-build-failure
Investigating build failure and framework issue
2 parents 17bb88f + c037010 commit 80a09f1

17 files changed

Lines changed: 33 additions & 226 deletions

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ concurrency:
66

77
permissions:
88
contents: read # to fetch code (actions/checkout)
9+
packages: read # to restore NuGet packages from GitHub Packages
910
security-events: write # for reporting InspectCode issues
1011

1112
jobs:
@@ -16,7 +17,6 @@ jobs:
1617
- name: Checkout
1718
uses: actions/checkout@v6
1819
with:
19-
submodules: recursive
2020
fetch-depth: 0
2121

2222
- name: Install .NET 10.0.x
@@ -31,6 +31,9 @@ jobs:
3131
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }}
3232
restore-keys: ${{ runner.os }}-nuget-
3333

34+
- name: Authenticate to GitHub Packages
35+
run: dotnet nuget update source winnerspiros-github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
36+
3437
- name: Restore Tools
3538
run: dotnet tool restore
3639

@@ -53,10 +56,6 @@ jobs:
5356
exit_code=0
5457
while read -r line; do
5558
if [[ ! -z "$line" ]]; then
56-
# Skip submodule files — third-party code doesn't use our license header
57-
if [[ "$line" == *"./submodules/"* ]]; then
58-
continue
59-
fi
6059
echo "::error::$line"
6160
exit_code=1
6261
fi
@@ -93,7 +92,6 @@ jobs:
9392
- name: Checkout
9493
uses: actions/checkout@v6
9594
with:
96-
submodules: recursive
9795
fetch-depth: 0
9896

9997
- name: Install .NET 10.0.x
@@ -108,6 +106,9 @@ jobs:
108106
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }}
109107
restore-keys: ${{ runner.os }}-nuget-
110108

109+
- name: Authenticate to GitHub Packages
110+
run: dotnet nuget update source winnerspiros-github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
111+
111112
- name: Compile
112113
run: dotnet build -c Debug -warnaserror osu.Desktop.slnf
113114

@@ -171,7 +172,6 @@ jobs:
171172
- name: Checkout
172173
uses: actions/checkout@v6
173174
with:
174-
submodules: recursive
175175
fetch-depth: 0
176176

177177
- name: Setup JDK 11
@@ -192,6 +192,9 @@ jobs:
192192
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }}
193193
restore-keys: ${{ runner.os }}-nuget-
194194

195+
- name: Authenticate to GitHub Packages
196+
run: dotnet nuget update source winnerspiros-github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
197+
195198
- name: Install .NET workloads
196199
run: dotnet workload install android
197200

@@ -206,7 +209,6 @@ jobs:
206209
- name: Checkout
207210
uses: actions/checkout@v6
208211
with:
209-
submodules: recursive
210212
fetch-depth: 0
211213

212214
- name: Install .NET 10.0.x
@@ -221,6 +223,9 @@ jobs:
221223
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }}
222224
restore-keys: ${{ runner.os }}-nuget-
223225

226+
- name: Authenticate to GitHub Packages
227+
run: dotnet nuget update source winnerspiros-github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
228+
224229
- name: Set Xcode version
225230
run: sudo xcode-select -s /Applications/Xcode_26.3.app
226231

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
name: Pack
4343
runs-on: ubuntu-latest
4444
environment: production
45+
permissions:
46+
contents: read
47+
packages: read
4548
steps:
4649
- name: Checkout
4750
uses: actions/checkout@v6
@@ -55,6 +58,9 @@ jobs:
5558
with:
5659
dotnet-version: "10.0.x"
5760

61+
- name: Authenticate to GitHub Packages
62+
run: dotnet nuget update source winnerspiros-github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
63+
5864
- name: Pack
5965
run: |
6066
# Replace project references in templates with package reference, because they're included as source files.

.github/workflows/release.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
timeout-minutes: 60
4141
permissions:
4242
contents: write
43+
packages: read
4344
steps:
4445
- name: Checkout
4546
uses: actions/checkout@v6
4647
with:
47-
submodules: recursive
4848
fetch-depth: 0
4949

5050
- name: Setup JDK 17
@@ -61,6 +61,9 @@ jobs:
6161
- name: Install .NET Android workload
6262
run: dotnet workload install android
6363

64+
- name: Authenticate to GitHub Packages
65+
run: dotnet nuget update source winnerspiros-github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
66+
6467
- name: Ensure Android NDK and CMake are available
6568
run: |
6669
# The ubuntu-latest runner has $ANDROID_HOME pre-installed.
@@ -215,7 +218,6 @@ jobs:
215218
-p:AndroidSigningKeyAlias="${{ steps.keystore.outputs.key_alias }}"
216219
-p:AndroidSigningKeyPass="${{ steps.keystore.outputs.key_pass }}"
217220
-p:AndroidSigningStorePass="${{ steps.keystore.outputs.store_pass }}"
218-
-p:CustomBeforeMicrosoftCommonTargets="${{ github.workspace }}/build/SuppressSubmoduleWarnings.targets"
219221
220222
- name: Find and rename APK
221223
id: find_apk
@@ -256,7 +258,6 @@ jobs:
256258
- name: Verify native libraries in APK
257259
run: |
258260
APK="${{ steps.find_apk.outputs.apk_path }}"
259-
SUBMOD="submodules/osu-framework/osu.Framework.Android/arm64-v8a"
260261
echo "Checking APK for required native libraries..."
261262
262263
NATIVE_LIBS=$(unzip -l "$APK" | grep "lib/arm64-v8a/.*\.so" || true)
@@ -275,31 +276,13 @@ jobs:
275276
276277
if [ "$MISSING" -ne 0 ]; then
277278
echo ""
278-
echo "::error::One or more required native libraries are missing. Check that the osu-framework submodule is initialised and the AndroidNativeLibrary glob in osu.Android.props resolves correctly."
279+
echo "::error::One or more required native libraries are missing from the APK. Ensure ppy.osu.Framework.Android was properly restored from the winnerspiros GitHub Packages feed."
279280
exit 1
280281
fi
281282
282283
echo ""
283284
echo "All required native libraries present ✓"
284285
285-
# Verify the BASS libraries are the Android-built versions, not the Linux desktop
286-
# ones from the NativeLibs NuGet package. The Android libbass.so links against
287-
# libOpenSLES.so (Android audio API); the Linux one links against libc.so.6.
288-
echo ""
289-
echo "Verifying native library ABI compatibility..."
290-
TMPDIR=$(mktemp -d)
291-
unzip -q -o "$APK" "lib/arm64-v8a/libbass.so" -d "$TMPDIR"
292-
if readelf -d "$TMPDIR/lib/arm64-v8a/libbass.so" | grep -q "libOpenSLES.so"; then
293-
echo "✅ libbass.so is the correct Android build (links libOpenSLES.so)"
294-
else
295-
echo "::error::libbass.so in APK is NOT the Android build — it appears to be the Linux desktop version from ppy.osu.Framework.NativeLibs NuGet. The app will crash with DllNotFoundException."
296-
echo "::error::Ensure ppy.osu.Framework.NativeLibs has ExcludeAssets=native in osu.Android.props."
297-
readelf -d "$TMPDIR/lib/arm64-v8a/libbass.so" | grep NEEDED || true
298-
rm -rf "$TMPDIR"
299-
exit 1
300-
fi
301-
rm -rf "$TMPDIR"
302-
303286
- name: Upload APK artifact
304287
uses: actions/upload-artifact@v7
305288
with:

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Directory.Build.props

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
<GenerateAssemblyInfo Condition="'$(Configuration)'=='Debug'">false</GenerateAssemblyInfo>
88
<!-- Required due to the above -->
99
<NoWarn Condition="'$(Configuration)'=='Debug'">$(NoWarn);CA1416</NoWarn>
10-
<!-- NU1605: Suppress package downgrade error for ppy.Veldrid.SPIRV.
11-
We intentionally override the framework's 1.0.15-gfbb03d21c2 with the fork's
12-
1.0.15-gb268bf39ea. NuGet considers this a "downgrade" because 'b' < 'f' in
13-
prerelease suffix comparison, but it's actually a newer fork build. -->
14-
<NoWarn>$(NoWarn);NU1605</NoWarn>
1510
</PropertyGroup>
1611
<PropertyGroup>
1712
<ApplicationManifest>$(MSBuildThisFileDirectory)app.manifest</ApplicationManifest>
@@ -24,16 +19,6 @@
2419
<ItemGroup Label="Resources">
2520
<EmbeddedResource Include="Resources\**\*.*" />
2621
</ItemGroup>
27-
<!-- Override ppy.Veldrid.SPIRV with winnerspiros/veldrid-spirv fork for ALL projects.
28-
The fork (1.0.15-gb268bf39ea) is API-compatible and includes:
29-
- 16KB ELF-aligned Android .so (no PatchElfPageSize workaround needed)
30-
- Modern runtimes/android-arm64/native/ NuGet layout (no MonoAndroid10 workarounds)
31-
- CompileCompute interop bug fix, debug flag passthrough, error diagnostics
32-
The .nupkg is in local-packages/ (see NuGet.Config).
33-
This overrides the framework's transitive reference to 1.0.15-gfbb03d21c2. -->
34-
<ItemGroup Label="Veldrid.SPIRV Override">
35-
<PackageReference Include="ppy.Veldrid.SPIRV" Version="1.0.15-gb268bf39ea" />
36-
</ItemGroup>
3722
<ItemGroup Label="Code Analysis">
3823
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" PrivateAssets="All" />
3924
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />

NuGet.Config

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<configuration>
33
<packageSources>
44
<clear />
5-
<!-- winnerspiros/veldrid-spirv fork NuGet package (included in local-packages/).
6-
Source: https://github.com/winnerspiros/veldrid-spirv/releases -->
7-
<add key="local-packages" value="local-packages" />
5+
<!-- winnerspiros/osu-framework fork NuGet packages (published to GitHub Packages) -->
6+
<add key="winnerspiros-github" value="https://nuget.pkg.github.com/winnerspiros/index.json" />
87
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
98
</packageSources>
109
</configuration>

build/SuppressSubmoduleWarnings.targets

Lines changed: 0 additions & 8 deletions
This file was deleted.

local-packages/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
-45.3 MB
Binary file not shown.

osu.Android.props

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -69,41 +69,9 @@
6969
</ItemGroup>
7070

7171
<ItemGroup>
72-
<!-- Use winnerspiros/osu-framework fork (net10.0-android, optimized) via submodule instead of ppy NuGet package -->
73-
<ProjectReference Include="$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/osu.Framework.Android.csproj" />
74-
75-
<!-- Suppress native assets from the desktop NativeLibs NuGet package.
76-
ppy.osu.Framework.NativeLibs (transitive via osu.Framework.csproj) ships
77-
runtimes/linux-arm64/native/libbass.so and friends built for GNU/Linux (they link
78-
libc.so.6, libpthread.so.0, etc.). The .NET RID fallback chain for android-arm64
79-
(android-arm64 → android → unix → any) causes the Linux ARM64 .so files to leak
80-
into the APK even though the NuGet has an android/native/_._ placeholder.
81-
The result: the APK ends up with a Linux libbass.so that cannot load on Android
82-
(DllNotFoundException at startup).
83-
ExcludeAssets="native" prevents NuGet from contributing any .so files;
84-
the correct Android-built libraries are supplied by AndroidNativeLibrary below. -->
85-
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2025.806.0-nativelibs" ExcludeAssets="native" PrivateAssets="all" />
86-
</ItemGroup>
87-
88-
<!-- Include framework native libraries (BASS audio, FFmpeg, etc.) from the submodule.
89-
When using a NuGet package these are bundled automatically; with a ProjectReference
90-
they must be declared explicitly or the app crashes at startup with
91-
System.DllNotFoundException: bass (or similar).
92-
Use forward slashes — backslash globs silently match zero files on Linux CI runners,
93-
which produces an APK without libbass.so (and the other native libs). -->
94-
<ItemGroup>
95-
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/arm64-v8a/*.so" Abi="arm64-v8a" />
72+
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.420.3" />
9673
</ItemGroup>
9774

98-
<!-- Fail the build early if critical native libraries are missing.
99-
A missing .so means the app will crash on startup with DllNotFoundException.
100-
This catches silent glob failures (e.g. uninitialised submodule, wrong path)
101-
and NuGet restore failures for Veldrid.SPIRV. -->
102-
<Target Name="ValidateFrameworkNativeLibraries" BeforeTargets="Build">
103-
<Error Condition="!Exists('$(MSBuildThisFileDirectory)submodules/osu-framework/osu.Framework.Android/arm64-v8a/libbass.so')"
104-
Text="libbass.so not found in submodules/osu-framework/osu.Framework.Android/arm64-v8a/. Ensure the osu-framework submodule is initialised: git submodule update --init --recursive" />
105-
</Target>
106-
10775
<PropertyGroup>
10876
<!-- Fody does not handle Android build well, and warns when unchanged.
10977
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->

0 commit comments

Comments
 (0)