-
Notifications
You must be signed in to change notification settings - Fork 11
Introduce cross-platform compatibility and pipeline #205
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
Conversation
…pgraded to CppSharp 0.10.2
This is a big change because it includes cached binaries and headers from the release versions of Mac and Linux LLVM along with the cached build output for Windows. The default behavior of the pipeline is now to use the cached binaries, resulting in about a 20 min build time, while the full 3 hour build of LLVM is still an option. Lots of clean-up on the scripts is still left to do, as well as creating a multistage pipeline that can actually produce and test the fully formed nuget package, but this is a big chunk of the way there.
Enable multi-stage pipeline with skipped tests.
58b8ab5
to
697a364
Compare
Converting this PR to draft in favor of breaking it up into smaller chunks to make reviewing easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is awesome!!!
@@ -18,7 +18,7 @@ namespace LlvmBindingsGenerator.Templates | |||
/// Class to produce the template output | |||
/// </summary> | |||
|
|||
#line 1 "D:\GitHub\Ubiquity.NET\Ubiquity.NET.Llvm\src\Interop\LlvmBindingsGenerator\Templates\T4\ExportsTemplate.tt" | |||
#line 1 "D:\github\Llvm.NET\src\Interop\LlvmBindingsGenerator\Templates\T4\ExportsTemplate.tt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change to match the new build scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated by T4 (https://docs.microsoft.com/en-us/visualstudio/modeling/code-generation-and-t4-text-templates) and inherits line numbers from the system where they were generated. At some point it might be worth adding these files to the gitignore and then incorporating T4 generation into the build instead of relying on a developer opening the project in VS to regenerate them, but I didn’t find an easy way to do that, so deferred to the existing process.
@@ -19,61 +19,6 @@ namespace Ubiquity.NET.Llvm.Interop | |||
/// <summary>Interop methods for the Ubiquity.NET LibLLVM library</summary> | |||
public static partial class NativeMethods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to delete this file? It looks empty...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The static string in there is needed by the infrastructure that uses the dll name, but I can put that into another file to avoid the seemingly empty file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if that const string is all that is left, it can move easy enough
@@ -6,11 +6,11 @@ Param( | |||
[System.String]$BuildMode = 'All' | |||
) | |||
|
|||
pushd $PSScriptRoot | |||
Push-Location $PSScriptRoot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please retain the original alias forms, they are standard powershell commands
@@ -26,19 +26,31 @@ try | |||
if((Test-Path -PathType Container $buildInfo['BuildOutputPath']) -and $ForceClean ) | |||
{ | |||
Write-Information "Cleaning output folder from previous builds" | |||
rd -Recurse -Force -Path $buildInfo['BuildOutputPath'] | |||
Remove-Item -Recurse -Force -Path $buildInfo['BuildOutputPath'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the alias names, the style for this project prefers the alias names.
md $buildInfo['NuGetOutputPath'] -ErrorAction SilentlyContinue | Out-Null | ||
$includePath = (Join-Path $PSScriptRoot llvm include) | ||
$libPath = (Join-Path $PSScriptRoot llvm lib) | ||
if ((Test-Path -PathType Container $includePath) -and $ForceClean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code style for this project places braces on a new line for all languages
@@ -0,0 +1,31 @@ | |||
Param( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this script needed? It's mostly overhead compared to what it does. This functionality is better suited inlined as it was.
pushd (Join-Path $buildInfo.BuildOutputPath 'bin\PatchVsForLibClang\Release\netcoreapp3.1') | ||
try | ||
{ | ||
Write-Information "Patching VS CRT for parsing with LibClang..." | ||
.\PatchVsForLibClang.exe $vs.InstallationPath | ||
if ($LASTEXITCODE -ne 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style, please follow style of this repo regarding braces on a new line
@@ -157,7 +157,6 @@ | |||
<ClInclude Include="targetver.h" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this if CMAKE is used to build the DLL, shouldn't this just be deleted?
@@ -18,6 +18,7 @@ | |||
#include <llvm/IR/Module.h> | |||
#include <llvm/Transforms/Instrumentation.h> | |||
#include <llvm/PassRegistry.h> | |||
#include <llvm/LinkAllPasses.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added? It wasn't needed to build the code before this change...
@@ -2,6 +2,7 @@ | |||
#include <llvm/ADT/Triple.h> | |||
#include <llvm/Support/CBindingWrapping.h> | |||
#include <llvm/Support/TargetParser.h> | |||
#include <llvm/Config/llvm-config.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this added?
@@ -11,8 +11,8 @@ | |||
Due to current limitations of the CppSharp library NUGET package, this only supports the Windows Desktop .NET Framework (64 bit) | |||
This means that this project can't use language features > 7.3 (Limits for .NET Framework) | |||
--> | |||
<TargetFramework>net47</TargetFramework> | |||
<Nullable /> | |||
<TargetFramework>net48</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change the TFM for this? It can't run on anything other than windows .NET framework anyway so why make this change?
@@ -72,13 +72,15 @@ public static void Initialize( TestContext ctx ) | |||
tm.EmitToFile( module, TestObjFileName, CodeGenFileType.ObjectFile ); | |||
} | |||
|
|||
[TestCategory("ObjFiles")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all of these tests need to be skipped on some target, then something is either fundamentally wrong with the tests, or the object file support. so a bug should be filed for this as disabling these all for a platform is cutting off a big chunk of functionality of the library.
@smaillet Thanks for all the feedback. I'll respond to a few key repeated points here, and then work on different PRs that focus on specific parts of the infrastructure to hopefully allow for more targeted discussion.
I should have a fresh PR with just first incremental step available for review shortly, and to avoid confusion I will just submit one PR at a time instead of using drafts to imply readiness. |
This change introduces infrastructure for cross-platform build of native components in LibLlvm, allowing the eventual .NET core package to build in all the binaries and enable execution on Linux and MacOS. This also updates the GitHub Actions workflow as a first attempt to support the full cross-platform build and test.
This addresses #193