Skip to content

Commit 62eb7e8

Browse files
authored
Merge branch 'main' into hotfix/build-sdl-aar-in-ci
2 parents 9e0c3c2 + a9c75a6 commit 62eb7e8

File tree

20 files changed

+660
-152
lines changed

20 files changed

+660
-152
lines changed

.github/workflows/angle.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ANGLE
2+
on:
3+
push:
4+
branches-ignore:
5+
- "ci/**"
6+
- "develop/**"
7+
- "main"
8+
paths:
9+
- build/submodules/ANGLE
10+
- build/nuke/Native/Core.cs
11+
- build/nuke/Native/Angle.cs
12+
- .github/workflows/angle.yml
13+
jobs:
14+
Build:
15+
if: github.repository == 'dotnet/Silk.NET'
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
env:
20+
- os: macos-13-xlarge
21+
name: Darwin
22+
nuke_invoke: ./build.sh
23+
name: ${{ matrix.env.name }} Build
24+
runs-on: ${{ matrix.env.os }}
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
29+
30+
- name: Configure git
31+
run: |
32+
git config --local user.email "9011267+dotnet-bot@users.noreply.github.com"
33+
git config --local user.name "The Silk.NET Automaton"
34+
35+
# Install python
36+
- uses: actions/setup-python@v4
37+
with:
38+
python-version: "3.10"
39+
40+
- name: Build ANGLE
41+
run: ${{ matrix.env.nuke_invoke }} Angle
42+
env:
43+
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
# TODO build native mixins such as BuildLibSilkDroid
7070
run: ./build.sh Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
7171
- name: Upload Unsigned Artifacts to Actions
72-
uses: actions/upload-artifact@v2.2.4
72+
uses: actions/upload-artifact@v4
7373
with:
7474
name: unsigned_nupkgs
7575
path: "build/output_packages/*nupkg"
@@ -90,14 +90,14 @@ jobs:
9090
- uses: actions/checkout@v3.5.2
9191
with:
9292
submodules: 'false'
93-
- uses: actions/download-artifact@v3
93+
- uses: actions/download-artifact@v4
9494
with:
9595
name: unsigned_nupkgs
9696
path: build/output_packages
9797
- name: Sign Packages
9898
run: .\build.cmd SignPackages --akv-certificate ${{ secrets.AKV_CERTIFICATE }} --akv-client-id ${{ secrets.AKV_CLIENT_ID }} --akv-client-secret ${{ secrets.AKV_CLIENT_SECRET }} --akv-tenant ${{ secrets.AKV_TENANT }} --akv-vault-url ${{ secrets.AKV_VAULT_URL }}
9999
- name: Upload Signed Artifacts to Actions
100-
uses: actions/upload-artifact@v2.2.4
100+
uses: actions/upload-artifact@v4
101101
with:
102102
name: signed_nupkgs
103103
path: "build/output_packages/*nupkg"

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@
1313
</div>
1414

1515
<div>
16+
17+
<h1 align="center">🚧 Silk.NET 3.0 is coming... 🚧</h1>
18+
19+
We are currently hard at work on Silk.NET 3.0 - the latest and greatest Silk.NET, laser-focused on addressing pain points and reimagining how C# bindings libraries can be done.
20+
21+
Because of this, Silk.NET 2.X investment is currently limited by the Silk.NET team, who consist entirely of volunteers working in their free time. Silk.NET 2.X updates are now released ad-hoc when development effort is justified and available.
22+
23+
**If you're reading this and would like to step up to keep Silk.NET 2.X going, be that as a contributor or a maintainer, please do not hesitate to reach out to the Silk.NET team in our official Discord server!**
24+
25+
Learn more about Silk.NET 3.0:
26+
- [Silk.NET 3.0 Plan](https://github.com/dotnet/Silk.NET/blob/14ee3f16a1c1b7c5f561c307b956f769c5e89474/documentation/proposals/Proposal%20-%203.0%20%26%203.X%20Software%20Development%20Plan.md)
27+
- [Silk.NET 3.0 Bindings Design](https://github.com/dotnet/Silk.NET/blob/main/documentation/proposals/Proposal%20-%20Generation%20of%20Library%20Sources%20and%20PInvoke%20Mechanisms.md)
28+
- [Silk.NET 3.0 Meeting 1](https://www.youtube.com/watch?v=dac3t0oh3VU)
29+
- [Silk.NET 3.0 Meeting 2](https://www.youtube.com/watch?v=yXNDZDE3AHE)
30+
- [SilkX (Silk.NET 3.0) Design Discussion](https://www.youtube.com/live/N7qcETE4X_I?t=1799)
31+
32+
<h1 align="center">About Silk.NET 2.X</h1>
33+
1634
<!-- End exclude from NuGet readme. -->
1735
<!-- Begin include in NuGet readme.
1836
![Silk.NET Logo](https://raw.githubusercontent.com/dotnet/Silk.NET/main/documentation/readme/silkdotnet_v3_horizontal_96.svg)

Silk.NET.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.
616616
EndProject
617617
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.ANDROIDSYS", "src\OpenXR\Extensions\Silk.NET.OpenXR.Extensions.ANDROIDSYS\Silk.NET.OpenXR.Extensions.ANDROIDSYS.csproj", "{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}"
618618
EndProject
619+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Assimp.Tests", "src\Assimp\Silk.NET.Assimp.Tests\Silk.NET.Assimp.Tests.csproj", "{12D0A556-7DDF-4902-8911-1DA3F6331149}"
620+
EndProject
619621
Global
620622
GlobalSection(SolutionConfigurationPlatforms) = preSolution
621623
Debug|Any CPU = Debug|Any CPU
@@ -3757,6 +3759,18 @@ Global
37573759
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x64.Build.0 = Release|Any CPU
37583760
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x86.ActiveCfg = Release|Any CPU
37593761
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x86.Build.0 = Release|Any CPU
3762+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3763+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|Any CPU.Build.0 = Debug|Any CPU
3764+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x64.ActiveCfg = Debug|Any CPU
3765+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x64.Build.0 = Debug|Any CPU
3766+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x86.ActiveCfg = Debug|Any CPU
3767+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x86.Build.0 = Debug|Any CPU
3768+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|Any CPU.ActiveCfg = Release|Any CPU
3769+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|Any CPU.Build.0 = Release|Any CPU
3770+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x64.ActiveCfg = Release|Any CPU
3771+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x64.Build.0 = Release|Any CPU
3772+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.ActiveCfg = Release|Any CPU
3773+
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.Build.0 = Release|Any CPU
37603774
EndGlobalSection
37613775
GlobalSection(SolutionProperties) = preSolution
37623776
HideSolutionNode = FALSE
@@ -4057,6 +4071,7 @@ Global
40574071
{B70533BB-FB84-4BC3-888C-88E5F40FD22D} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
40584072
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
40594073
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
4074+
{12D0A556-7DDF-4902-8911-1DA3F6331149} = {6EADA376-E83F-40B7-9539-71DD17AEF7A4}
40604075
EndGlobalSection
40614076
GlobalSection(ExtensibilityGlobals) = postSolution
40624077
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}

build/nuke/Native/Angle.cs

Lines changed: 125 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -2,112 +2,142 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5-
using System.Collections;
6-
using System.Collections.Generic;
75
using System.IO;
86
using System.Linq;
9-
using System.Runtime.InteropServices;
10-
using JetBrains.Annotations;
117
using Nuke.Common;
12-
using Nuke.Common.CI.GitHubActions;
13-
using Nuke.Common.Git;
148
using Nuke.Common.IO;
159
using Nuke.Common.Tooling;
16-
using Nuke.Common.Tools.DotNet;
17-
using Nuke.Common.Tools.Git;
18-
using Octokit;
19-
using Octokit.Internal;
20-
using static Nuke.Common.IO.CompressionTasks;
10+
using Nuke.Common.Utilities.Collections;
2111
using static Nuke.Common.IO.FileSystemTasks;
22-
using static Nuke.Common.IO.HttpTasks;
23-
using static Nuke.Common.Tooling.ProcessTasks;
24-
using static Nuke.Common.Tools.DotNet.DotNetTasks;
25-
using static Nuke.Common.Tools.Git.GitTasks;
26-
using static Nuke.Common.Tools.GitHub.GitHubTasks;
2712

2813
partial class Build {
29-
// NOTE: Disabled until space issues are resolved! If you are a user who needs this please submit a PR!
14+
// NOTE: Enabled only on MacOS until space issues are resolved! If you are a user who needs this please submit a PR!
3015

31-
// AbsolutePath AnglePath => RootDirectory / "build" / "submodules" / "ANGLE";
16+
Target Angle => CommonTarget
17+
(
18+
x => x.Before(Compile)
19+
.After(Clean)
20+
.Executes
21+
(
22+
() =>
23+
{
24+
var tempDir = (AbsolutePath)Directory.CreateTempSubdirectory("silkDotNetAngleBuild").FullName;
25+
InheritedShell($"git clone --depth 1 --single-branch https://chromium.googlesource.com/chromium/tools/depot_tools.git", tempDir).AssertZeroExitCode();
26+
AddToPath(tempDir / "depot_tools");
3227

33-
// Target Angle => CommonTarget
34-
// (
35-
// x => x.Before(Compile)
36-
// .After(Clean)
37-
// .Executes
38-
// (
39-
// () =>
40-
// {
41-
// var @out = AnglePath / "out" / "Release";
42-
// EnsureCleanDirectory(@out);
43-
// var zip = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
44-
// var unzip = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
45-
// HttpDownloadFile("https://storage.googleapis.com/chrome-infra/depot_tools.zip", zip);
46-
// UncompressZip(zip, unzip);
47-
// if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
48-
// {
49-
// InheritedShell($"chmod -R 777 \"{unzip}\"");
50-
// }
28+
if (OperatingSystem.IsWindows())
29+
{
30+
Environment.SetEnvironmentVariable("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
31+
}
5132

52-
// AddToPath(unzip);
53-
// if (OperatingSystem.IsWindows())
54-
// {
55-
// Environment.SetEnvironmentVariable("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
56-
// }
33+
var angleSourceDir = tempDir / "angle_source";
34+
EnsureCleanDirectory(angleSourceDir);
35+
InheritedShell("fetch --no-history angle", angleSourceDir).AssertZeroExitCode();
5736

58-
// InheritedShell("python scripts/bootstrap.py", AnglePath).AssertZeroExitCode();
59-
// InheritedShell("gclient sync", AnglePath).AssertZeroExitCode();
60-
// if (OperatingSystem.IsLinux())
61-
// {
62-
// InheritedShell("sudo ./build/install-build-deps.sh", AnglePath).AssertZeroExitCode();
63-
// }
37+
// save space
38+
// DeleteDirectory takes too long (it deletes individual files)
39+
Directory.Delete(angleSourceDir / "third_party"/ "VK-GL-CTS", true); // this is only possible because we disable tests below
40+
Directory.Delete(angleSourceDir / "third_party"/ "dawn", true); // this is only possible because we disable wgpu below
41+
(angleSourceDir / "third_party").GlobDirectories("*.git").ForEach(DeleteDirectory);
42+
43+
if (OperatingSystem.IsLinux())
44+
{
45+
InheritedShell("sudo ./build/install-build-deps.sh", angleSourceDir).AssertZeroExitCode();
46+
}
6447

65-
// var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.OpenGLES.ANGLE.Native" / "runtimes";
66-
// if (OperatingSystem.IsWindows())
67-
// {
68-
// InheritedShell
69-
// (
70-
// "gn gen out/Release " +
71-
// "--args='is_component_build=false target_cpu=\"\"x86\"\" is_debug=false'",
72-
// AnglePath
73-
// )
74-
// .AssertZeroExitCode();
75-
// InheritedShell($"autoninja -C \"{@out}\"", AnglePath).AssertZeroExitCode();
76-
// CopyAll
77-
// (
78-
// // libANGLE might not exist, this is fine
79-
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
80-
// runtimes / "win-x64" / "native"
81-
// );
82-
// CopyAll
83-
// (
84-
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
85-
// runtimes / "win-x86" / "native"
86-
// );
87-
// }
88-
// else
89-
// {
90-
// InheritedShell
91-
// (
92-
// $"gn gen \"{@out}\" " +
93-
// "--args=\"is_component_build=false is_debug=false\"",
94-
// AnglePath
95-
// )
96-
// .AssertZeroExitCode();
97-
// InheritedShell($"autoninja -C \"{@out}\"", AnglePath).AssertZeroExitCode();
98-
// CopyAll
99-
// (
100-
// @out.GlobFiles
101-
// (
102-
// "libGLESv2.so", "libEGL.so", "libANGLE.so",
103-
// "libGLESv2.dylib", "libEGL.dylib", "libANGLE.dylib"
104-
// ),
105-
// runtimes / (OperatingSystem.IsMacOS() ? "osx-x64" : "linux-x64") / "native"
106-
// );
107-
// }
48+
var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.OpenGLES.ANGLE.Native" / "runtimes";
49+
// if (OperatingSystem.IsWindows())
50+
// {
51+
// var @out = angleSourceDir / "out" / "Release";
52+
// EnsureCleanDirectory(@out);
53+
// InheritedShell
54+
// (
55+
// "gn gen out/Release " +
56+
// "--args='is_component_build=false target_cpu=\"\"x86\"\" is_debug=false'",
57+
// angleSourceDir
58+
// )
59+
// .AssertZeroExitCode();
60+
// InheritedShell($"autoninja -C \"{@out}\"", angleSourceDir).AssertZeroExitCode();
61+
// CopyAll
62+
// (
63+
// // libANGLE might not exist, this is fine
64+
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
65+
// runtimes / "win-x64" / "native"
66+
// );
67+
// CopyAll
68+
// (
69+
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
70+
// runtimes / "win-x86" / "native"
71+
// );
72+
// }
73+
// else
74+
if (OperatingSystem.IsMacOS())
75+
{
76+
foreach (var arch in new [] { "arm64", "x64" })
77+
{
78+
var @out = angleSourceDir / "out" / $"Release_{arch}";
79+
EnsureCleanDirectory(@out);
80+
var args = new[]
81+
{
82+
("target_cpu", $"\"{arch}\""),
83+
("is_debug", "false"),
84+
// ("angle_assert_always_on", "true"),
85+
("angle_build_tests", "false"),
86+
("angle_enable_null", "false"),
87+
("angle_enable_vulkan", "false"),
88+
("angle_enable_wgpu", "false"),
89+
// ("angle_enable_abseil", "false"),
90+
("angle_enable_gl", "false"),
91+
};
92+
InheritedShell
93+
(
94+
$"gn gen \"{@out}\" --args='{string.Join(" ", args.Select(arg => $"{arg.Item1} = {arg.Item2}"))}'",
95+
angleSourceDir
96+
)
97+
.AssertZeroExitCode();
98+
InheritedShell($"autoninja -C \"{@out}\"", angleSourceDir).AssertZeroExitCode();
99+
}
100+
101+
// create universal mac binaries
102+
var universalNativeRuntimes = runtimes / "osx" / "native";
103+
EnsureCleanDirectory(universalNativeRuntimes);
104+
foreach (var lib in new[] { "libGLESv2.dylib", "libEGL.dylib" })
105+
{
106+
var x64Lib = angleSourceDir / "out" / "Release_x64" / lib;
107+
var arm64Lib = angleSourceDir / "out" / "Release_arm64" / lib;
108+
InheritedShell
109+
(
110+
$"lipo -create \"{arm64Lib}\" \"{x64Lib}\" -output \"{universalNativeRuntimes / lib}\"",
111+
angleSourceDir
112+
)
113+
.AssertZeroExitCode();
114+
}
115+
}
116+
// else
117+
// if (OperatingSystem.IsLinux())
118+
// {
119+
// var @out = angleSourceDir / "out" / "Release";
120+
// EnsureCleanDirectory(@out);
121+
// InheritedShell
122+
// (
123+
// $"gn gen \"{@out}\" " +
124+
// "--args=\"is_component_build=false is_debug=false\"",
125+
// angleSourceDir
126+
// )
127+
// .AssertZeroExitCode();
128+
// InheritedShell($"autoninja -C \"{@out}\"", angleSourceDir).AssertZeroExitCode();
129+
// CopyAll
130+
// (
131+
// @out.GlobFiles
132+
// (
133+
// "libGLESv2.so", "libEGL.so", "libANGLE.so"
134+
// ),
135+
// runtimes / "linux-x64" / "native"
136+
// );
137+
// }
108138

109-
// PrUpdatedNativeBinary("ANGLE");
110-
// }
111-
// )
112-
// );
113-
}
139+
PrUpdatedNativeBinary("ANGLE");
140+
}
141+
)
142+
);
143+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!Model.zip

0 commit comments

Comments
 (0)