Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/build-sdl-aar-in-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Oct 22, 2024
2 parents 9e0c3c2 + a9c75a6 commit 62eb7e8
Show file tree
Hide file tree
Showing 20 changed files with 660 additions and 152 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/angle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: ANGLE
on:
push:
branches-ignore:
- "ci/**"
- "develop/**"
- "main"
paths:
- build/submodules/ANGLE
- build/nuke/Native/Core.cs
- build/nuke/Native/Angle.cs
- .github/workflows/angle.yml
jobs:
Build:
if: github.repository == 'dotnet/Silk.NET'
strategy:
fail-fast: false
matrix:
env:
- os: macos-13-xlarge
name: Darwin
nuke_invoke: ./build.sh
name: ${{ matrix.env.name }} Build
runs-on: ${{ matrix.env.os }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}

- name: Configure git
run: |
git config --local user.email "9011267+dotnet-bot@users.noreply.github.com"
git config --local user.name "The Silk.NET Automaton"
# Install python
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Build ANGLE
run: ${{ matrix.env.nuke_invoke }} Angle
env:
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
# TODO build native mixins such as BuildLibSilkDroid
run: ./build.sh Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
- name: Upload Unsigned Artifacts to Actions
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v4
with:
name: unsigned_nupkgs
path: "build/output_packages/*nupkg"
Expand All @@ -90,14 +90,14 @@ jobs:
- uses: actions/checkout@v3.5.2
with:
submodules: 'false'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: unsigned_nupkgs
path: build/output_packages
- name: Sign Packages
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 }}
- name: Upload Signed Artifacts to Actions
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v4
with:
name: signed_nupkgs
path: "build/output_packages/*nupkg"
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
</div>

<div>

<h1 align="center">🚧 Silk.NET 3.0 is coming... 🚧</h1>

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.

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.

**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!**

Learn more about Silk.NET 3.0:
- [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)
- [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)
- [Silk.NET 3.0 Meeting 1](https://www.youtube.com/watch?v=dac3t0oh3VU)
- [Silk.NET 3.0 Meeting 2](https://www.youtube.com/watch?v=yXNDZDE3AHE)
- [SilkX (Silk.NET 3.0) Design Discussion](https://www.youtube.com/live/N7qcETE4X_I?t=1799)

<h1 align="center">About Silk.NET 2.X</h1>

<!-- End exclude from NuGet readme. -->
<!-- Begin include in NuGet readme.
![Silk.NET Logo](https://raw.githubusercontent.com/dotnet/Silk.NET/main/documentation/readme/silkdotnet_v3_horizontal_96.svg)
Expand Down
15 changes: 15 additions & 0 deletions Silk.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.
EndProject
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}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3757,6 +3759,18 @@ Global
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x64.Build.0 = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x86.ActiveCfg = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x86.Build.0 = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|Any CPU.Build.0 = Debug|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x64.ActiveCfg = Debug|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x64.Build.0 = Debug|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x86.ActiveCfg = Debug|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Debug|x86.Build.0 = Debug|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|Any CPU.ActiveCfg = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|Any CPU.Build.0 = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x64.ActiveCfg = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x64.Build.0 = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.ActiveCfg = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -4057,6 +4071,7 @@ Global
{B70533BB-FB84-4BC3-888C-88E5F40FD22D} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{12D0A556-7DDF-4902-8911-1DA3F6331149} = {6EADA376-E83F-40B7-9539-71DD17AEF7A4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}
Expand Down
220 changes: 125 additions & 95 deletions build/nuke/Native/Angle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,112 +2,142 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.Git;
using Nuke.Common.IO;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.Git;
using Octokit;
using Octokit.Internal;
using static Nuke.Common.IO.CompressionTasks;
using Nuke.Common.Utilities.Collections;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.HttpTasks;
using static Nuke.Common.Tooling.ProcessTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.Git.GitTasks;
using static Nuke.Common.Tools.GitHub.GitHubTasks;

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

// AbsolutePath AnglePath => RootDirectory / "build" / "submodules" / "ANGLE";
Target Angle => CommonTarget
(
x => x.Before(Compile)
.After(Clean)
.Executes
(
() =>
{
var tempDir = (AbsolutePath)Directory.CreateTempSubdirectory("silkDotNetAngleBuild").FullName;
InheritedShell($"git clone --depth 1 --single-branch https://chromium.googlesource.com/chromium/tools/depot_tools.git", tempDir).AssertZeroExitCode();
AddToPath(tempDir / "depot_tools");
// Target Angle => CommonTarget
// (
// x => x.Before(Compile)
// .After(Clean)
// .Executes
// (
// () =>
// {
// var @out = AnglePath / "out" / "Release";
// EnsureCleanDirectory(@out);
// var zip = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
// var unzip = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
// HttpDownloadFile("https://storage.googleapis.com/chrome-infra/depot_tools.zip", zip);
// UncompressZip(zip, unzip);
// if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
// {
// InheritedShell($"chmod -R 777 \"{unzip}\"");
// }
if (OperatingSystem.IsWindows())
{
Environment.SetEnvironmentVariable("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
}
// AddToPath(unzip);
// if (OperatingSystem.IsWindows())
// {
// Environment.SetEnvironmentVariable("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
// }
var angleSourceDir = tempDir / "angle_source";
EnsureCleanDirectory(angleSourceDir);
InheritedShell("fetch --no-history angle", angleSourceDir).AssertZeroExitCode();
// InheritedShell("python scripts/bootstrap.py", AnglePath).AssertZeroExitCode();
// InheritedShell("gclient sync", AnglePath).AssertZeroExitCode();
// if (OperatingSystem.IsLinux())
// {
// InheritedShell("sudo ./build/install-build-deps.sh", AnglePath).AssertZeroExitCode();
// }
// save space
// DeleteDirectory takes too long (it deletes individual files)
Directory.Delete(angleSourceDir / "third_party"/ "VK-GL-CTS", true); // this is only possible because we disable tests below
Directory.Delete(angleSourceDir / "third_party"/ "dawn", true); // this is only possible because we disable wgpu below
(angleSourceDir / "third_party").GlobDirectories("*.git").ForEach(DeleteDirectory);
if (OperatingSystem.IsLinux())
{
InheritedShell("sudo ./build/install-build-deps.sh", angleSourceDir).AssertZeroExitCode();
}
// var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.OpenGLES.ANGLE.Native" / "runtimes";
// if (OperatingSystem.IsWindows())
// {
// InheritedShell
// (
// "gn gen out/Release " +
// "--args='is_component_build=false target_cpu=\"\"x86\"\" is_debug=false'",
// AnglePath
// )
// .AssertZeroExitCode();
// InheritedShell($"autoninja -C \"{@out}\"", AnglePath).AssertZeroExitCode();
// CopyAll
// (
// // libANGLE might not exist, this is fine
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
// runtimes / "win-x64" / "native"
// );
// CopyAll
// (
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
// runtimes / "win-x86" / "native"
// );
// }
// else
// {
// InheritedShell
// (
// $"gn gen \"{@out}\" " +
// "--args=\"is_component_build=false is_debug=false\"",
// AnglePath
// )
// .AssertZeroExitCode();
// InheritedShell($"autoninja -C \"{@out}\"", AnglePath).AssertZeroExitCode();
// CopyAll
// (
// @out.GlobFiles
// (
// "libGLESv2.so", "libEGL.so", "libANGLE.so",
// "libGLESv2.dylib", "libEGL.dylib", "libANGLE.dylib"
// ),
// runtimes / (OperatingSystem.IsMacOS() ? "osx-x64" : "linux-x64") / "native"
// );
// }
var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.OpenGLES.ANGLE.Native" / "runtimes";
// if (OperatingSystem.IsWindows())
// {
// var @out = angleSourceDir / "out" / "Release";
// EnsureCleanDirectory(@out);
// InheritedShell
// (
// "gn gen out/Release " +
// "--args='is_component_build=false target_cpu=\"\"x86\"\" is_debug=false'",
// angleSourceDir
// )
// .AssertZeroExitCode();
// InheritedShell($"autoninja -C \"{@out}\"", angleSourceDir).AssertZeroExitCode();
// CopyAll
// (
// // libANGLE might not exist, this is fine
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
// runtimes / "win-x64" / "native"
// );
// CopyAll
// (
// @out.GlobFiles("libGLESv2.dll", "libEGL.dll", "libANGLE.dll"),
// runtimes / "win-x86" / "native"
// );
// }
// else
if (OperatingSystem.IsMacOS())
{
foreach (var arch in new [] { "arm64", "x64" })
{
var @out = angleSourceDir / "out" / $"Release_{arch}";
EnsureCleanDirectory(@out);
var args = new[]
{
("target_cpu", $"\"{arch}\""),
("is_debug", "false"),
// ("angle_assert_always_on", "true"),
("angle_build_tests", "false"),
("angle_enable_null", "false"),
("angle_enable_vulkan", "false"),
("angle_enable_wgpu", "false"),
// ("angle_enable_abseil", "false"),
("angle_enable_gl", "false"),
};
InheritedShell
(
$"gn gen \"{@out}\" --args='{string.Join(" ", args.Select(arg => $"{arg.Item1} = {arg.Item2}"))}'",
angleSourceDir
)
.AssertZeroExitCode();
InheritedShell($"autoninja -C \"{@out}\"", angleSourceDir).AssertZeroExitCode();
}
// create universal mac binaries
var universalNativeRuntimes = runtimes / "osx" / "native";
EnsureCleanDirectory(universalNativeRuntimes);
foreach (var lib in new[] { "libGLESv2.dylib", "libEGL.dylib" })
{
var x64Lib = angleSourceDir / "out" / "Release_x64" / lib;
var arm64Lib = angleSourceDir / "out" / "Release_arm64" / lib;
InheritedShell
(
$"lipo -create \"{arm64Lib}\" \"{x64Lib}\" -output \"{universalNativeRuntimes / lib}\"",
angleSourceDir
)
.AssertZeroExitCode();
}
}
// else
// if (OperatingSystem.IsLinux())
// {
// var @out = angleSourceDir / "out" / "Release";
// EnsureCleanDirectory(@out);
// InheritedShell
// (
// $"gn gen \"{@out}\" " +
// "--args=\"is_component_build=false is_debug=false\"",
// angleSourceDir
// )
// .AssertZeroExitCode();
// InheritedShell($"autoninja -C \"{@out}\"", angleSourceDir).AssertZeroExitCode();
// CopyAll
// (
// @out.GlobFiles
// (
// "libGLESv2.so", "libEGL.so", "libANGLE.so"
// ),
// runtimes / "linux-x64" / "native"
// );
// }
// PrUpdatedNativeBinary("ANGLE");
// }
// )
// );
}
PrUpdatedNativeBinary("ANGLE");
}
)
);
}
1 change: 1 addition & 0 deletions src/Assimp/Silk.NET.Assimp.Tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!Model.zip
Loading

0 comments on commit 62eb7e8

Please sign in to comment.