Skip to content

Commit a3c0788

Browse files
committed
Fix the issue with libgit2sharp blocking newer .NET versions
The single-file build functionality in .NET 5 did not work well with earlier versions of libgit2sharp. Let's see if our build works with this version and .NET 5 or .NET 6. For discussion of the errors we got when trying .NET 5 with earlier versions of libgit2sharp, see libgit2/libgit2sharp#1857, libgit2/libgit2sharp.nativebinaries#111, libgit2/libgit2sharp.nativebinaries#119, dotnet/sdk#3685, and dotnet/runtime#36590
1 parent 14c7582 commit a3c0788

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

.github/workflows/test-and-publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v1
2525
- uses: actions/setup-dotnet@v1
2626
with:
27-
dotnet-version: '3.1.412'
27+
dotnet-version: '5.0.400'
2828
- name: Try use dotnet core 3
2929
run: dotnet --info
3030
- uses: actions/checkout@v1
@@ -37,7 +37,7 @@ jobs:
3737
- name: dotnet publish
3838
env:
3939
PUBLISH_RUNTIME_ID: ${{ matrix.publish-runtime-id }}
40-
run: dotnet publish -c Debug --runtime ${{ env.PUBLISH_RUNTIME_ID }} --self-contained true /p:PublishReadyToRun=true /p:PublishSingleFile=true ./implement/elm-fullstack
40+
run: dotnet publish -c Debug -r ${{ env.PUBLISH_RUNTIME_ID }} --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true ./implement/elm-fullstack
4141
- name: Publish artifacts
4242
uses: actions/upload-artifact@v1
4343
with:

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ steps:
1111
- task: UseDotNet@2
1212
inputs:
1313
packageType: 'sdk' # Options: runtime, sdk
14-
version: '3.1.412'
14+
version: '5.0.400'
1515

1616
- script: dotnet --version
1717

implement/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build dotnet build image
2-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
2+
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
33
WORKDIR /app
44

55
# Copy everything and build
@@ -8,7 +8,7 @@ WORKDIR /app/elm-fullstack
88
RUN dotnet publish -c Debug -o out
99

1010
# Build runtime image
11-
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS binaries
11+
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS binaries
1212

1313
COPY --from=build-env /app/elm-fullstack/out /elm-fullstack/dotnet/
1414

implement/elm-fullstack/elm-fullstack.csproj

+5-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<RootNamespace>elm_fullstack</RootNamespace>
77
<AssemblyName>elm-fs</AssemblyName>
88
<AssemblyVersion>2021.0816.0.0</AssemblyVersion>
@@ -17,17 +17,13 @@
1717
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
1818
</ItemGroup>
1919

20-
<PropertyGroup>
21-
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
22-
</PropertyGroup>
23-
2420
<ItemGroup>
2521
<PackageReference Include="FluffySpoon.AspNet.LetsEncrypt" Version="1.116.0" />
26-
<PackageReference Include="JavaScriptEngineSwitcher.V8" Version="3.12.4" />
27-
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0096" />
22+
<PackageReference Include="JavaScriptEngineSwitcher.V8" Version="3.12.5" />
23+
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0116" />
2824
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
29-
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.1.4" />
30-
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.1.4" />
25+
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.1.5" />
26+
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.1.5" />
3127
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.6.0" />
3228
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
3329
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

implement/test-elm-fullstack/test-elm-fullstack.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
<RootNamespace>test_elm_fullstack</RootNamespace>
66

77
<IsPackable>false</IsPackable>

0 commit comments

Comments
 (0)