Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions patches/aspnetcore/0011-Add-FreeBSD.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 457e4bcc40228d64bb98c4e35937d31b4cc76599 Mon Sep 17 00:00:00 2001
From: Tomas Weinfurt <[email protected]>
Date: Wed, 13 Nov 2019 22:32:02 -0800
Subject: [PATCH] Add FreeBSD

---
Directory.Build.props | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Directory.Build.props b/Directory.Build.props
index 80e6bb14f0..76b1b4451b 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -115,6 +115,7 @@
<PropertyGroup>
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Windows'))">win</TargetOsName>
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</TargetOsName>
+ <TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('FreeBSD'))">freebsd</TargetOsName>
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Linux'))">linux</TargetOsName>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
<TargetRuntimeIdentifier>$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
@@ -125,6 +126,7 @@
win-x86;
win-arm;
osx-x64;
+ freebsd-x64;
linux-musl-x64;
linux-musl-arm64;
linux-x64;
--
2.23.0

40 changes: 40 additions & 0 deletions patches/core-setup/0005-Add-FreeBSD-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 9847f667b05b577cf98f92cb32f38beff95ea504 Mon Sep 17 00:00:00 2001
From: Tomas Weinfurt <[email protected]>
Date: Wed, 13 Nov 2019 00:53:31 -0800
Subject: [PATCH] add freebsd support

---
src/Directory.Build.props | 4 ++--
src/pkg/projects/netcoreappRIDs.props | 1 +
3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index c22e11fa..1fc24b41 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -12,7 +12,7 @@
<CrossGenSymbolExtension>.map</CrossGenSymbolExtension>
<CrossGenSymbolExtension Condition="'$(OSGroup)' == 'Windows_NT'">.ni.pdb</CrossGenSymbolExtension>
<!-- OSX doesn't have crossgen symbols, yet -->
- <CrossGenSymbolExtension Condition="'$(OSGroup)' == 'OSX'"></CrossGenSymbolExtension>
+ <CrossGenSymbolExtension Condition="'$(OSGroup)' == 'OSX' OR '$(OSGroup)' == 'FreeBSD'"></CrossGenSymbolExtension>
</PropertyGroup>

-</Project>
\ No newline at end of file
+</Project>
diff --git a/src/pkg/projects/netcoreappRIDs.props b/src/pkg/projects/netcoreappRIDs.props
index 7483d182..5561842f 100644
--- a/src/pkg/projects/netcoreappRIDs.props
+++ b/src/pkg/projects/netcoreappRIDs.props
@@ -35,6 +35,7 @@
<!-- The following RIDs are not officically supported and are not
built during official builds, however we wish to include them
in our runtime.json to enable others to provide them. -->
+ <UnofficialBuildRID Include="freebsd-x64" />
<UnofficialBuildRID Include="tizen.4.0.0-armel">
<Platform>armel</Platform>
</UnofficialBuildRID>
--
2.23.0

24 changes: 24 additions & 0 deletions patches/core-setup/0006-Fix-OSGroup-on-FreeBSD.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 63218afeff61a044c6482c5cd119a17bdb59de09 Mon Sep 17 00:00:00 2001
From: Tomas Weinfurt <[email protected]>
Date: Wed, 13 Nov 2019 14:07:57 -0800
Subject: [PATCH] Fix OSGroup on FreeBSD

---
Directory.Build.props | 1 +
1 file changed, 1 insertion(+)

diff --git a/Directory.Build.props b/Directory.Build.props
index 890012bf..a2539d51 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -111,6 +111,7 @@
-->
<PropertyGroup>
<OSGroup Condition="'$(OS)'=='Unix' AND Exists('/Applications')">OSX</OSGroup>
+ <OSGroup Condition="'$(OS)'=='Unix' and $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</OSGroup>
<OSGroup Condition="'$(OSGroup)' == ''">$(OS)</OSGroup>
</PropertyGroup>

--
2.23.0

196 changes: 196 additions & 0 deletions patches/corefx/0005-Add-FreeBSD-RIDs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
From 32d103eecf9d1e9648e6b1ed063860fed00bcc8f Mon Sep 17 00:00:00 2001
From: Tomas Weinfurt <[email protected]>
Date: Thu, 24 Oct 2019 10:19:39 -0700
Subject: [PATCH] add entries for new FreeBSD releases (#41794)

---
.../runtime.compatibility.json | 81 +++----------------
pkg/Microsoft.NETCore.Platforms/runtime.json | 38 ++-------
.../runtimeGroups.props | 2 +-
3 files changed, 22 insertions(+), 99 deletions(-)

diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
index 1e5c380a7a6a..2a196ecc9fc7 100644
--- a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
+++ b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
@@ -984,17 +984,17 @@
"any",
"base"
],
- "freebsd.11.0": [
- "freebsd.11.0",
+ "freebsd.12": [
+ "freebsd.12",
"freebsd.11",
"freebsd",
"unix",
"any",
"base"
],
- "freebsd.11.0-x64": [
- "freebsd.11.0-x64",
- "freebsd.11.0",
+ "freebsd.12-x64": [
+ "freebsd.12-x64",
+ "freebsd.12",
"freebsd.11-x64",
"freebsd.11",
"freebsd-x64",
@@ -1004,75 +1004,20 @@
"any",
"base"
],
- "freebsd.11.1": [
- "freebsd.11.1",
- "freebsd.11.0",
+ "freebsd.13": [
+ "freebsd.13",
+ "freebsd.12",
"freebsd.11",
"freebsd",
"unix",
"any",
"base"
],
- "freebsd.11.1-x64": [
- "freebsd.11.1-x64",
- "freebsd.11.1",
- "freebsd.11.0-x64",
- "freebsd.11.0",
- "freebsd.11-x64",
- "freebsd.11",
- "freebsd-x64",
- "freebsd",
- "unix-x64",
- "unix",
- "any",
- "base"
- ],
- "freebsd.11.2": [
- "freebsd.11.2",
- "freebsd.11.1",
- "freebsd.11.0",
- "freebsd.11",
- "freebsd",
- "unix",
- "any",
- "base"
- ],
- "freebsd.11.2-x64": [
- "freebsd.11.2-x64",
- "freebsd.11.2",
- "freebsd.11.1-x64",
- "freebsd.11.1",
- "freebsd.11.0-x64",
- "freebsd.11.0",
- "freebsd.11-x64",
- "freebsd.11",
- "freebsd-x64",
- "freebsd",
- "unix-x64",
- "unix",
- "any",
- "base"
- ],
- "freebsd.11.3": [
- "freebsd.11.3",
- "freebsd.11.2",
- "freebsd.11.1",
- "freebsd.11.0",
- "freebsd.11",
- "freebsd",
- "unix",
- "any",
- "base"
- ],
- "freebsd.11.3-x64": [
- "freebsd.11.3-x64",
- "freebsd.11.3",
- "freebsd.11.2-x64",
- "freebsd.11.2",
- "freebsd.11.1-x64",
- "freebsd.11.1",
- "freebsd.11.0-x64",
- "freebsd.11.0",
+ "freebsd.13-x64": [
+ "freebsd.13-x64",
+ "freebsd.13",
+ "freebsd.12-x64",
+ "freebsd.12",
"freebsd.11-x64",
"freebsd.11",
"freebsd-x64",
diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.json b/pkg/Microsoft.NETCore.Platforms/runtime.json
index b2f286ea2479..e70f2da7e668 100644
--- a/pkg/Microsoft.NETCore.Platforms/runtime.json
+++ b/pkg/Microsoft.NETCore.Platforms/runtime.json
@@ -510,48 +510,26 @@
"freebsd-x64"
]
},
- "freebsd.11.0": {
+ "freebsd.12": {
"#import": [
"freebsd.11"
]
},
- "freebsd.11.0-x64": {
+ "freebsd.12-x64": {
"#import": [
- "freebsd.11.0",
+ "freebsd.12",
"freebsd.11-x64"
]
},
- "freebsd.11.1": {
+ "freebsd.13": {
"#import": [
- "freebsd.11.0"
+ "freebsd.12"
]
},
- "freebsd.11.1-x64": {
+ "freebsd.13-x64": {
"#import": [
- "freebsd.11.1",
- "freebsd.11.0-x64"
- ]
- },
- "freebsd.11.2": {
- "#import": [
- "freebsd.11.1"
- ]
- },
- "freebsd.11.2-x64": {
- "#import": [
- "freebsd.11.2",
- "freebsd.11.1-x64"
- ]
- },
- "freebsd.11.3": {
- "#import": [
- "freebsd.11.2"
- ]
- },
- "freebsd.11.3-x64": {
- "#import": [
- "freebsd.11.3",
- "freebsd.11.2-x64"
+ "freebsd.13",
+ "freebsd.12-x64"
]
},
"gentoo": {
diff --git a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props
index eeb8130b54fb..6c95b67819be 100644
--- a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props
+++ b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props
@@ -99,7 +99,7 @@
<RuntimeGroup Include="freebsd">
<Parent>unix</Parent>
<Architectures>x64</Architectures>
- <Versions>11;11.0;11.1;11.2;11.3</Versions>
+ <Versions>11;12;13</Versions>
</RuntimeGroup>

<!-- rhel 6 is independent -->
25 changes: 25 additions & 0 deletions patches/corefx/0006-Do-not-fail-on-test-chmod.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From ef90f9473a5b2b24d9c1a523aefa7d6478bd3335 Mon Sep 17 00:00:00 2001
From: Tomas Weinfurt <[email protected]>
Date: Tue, 12 Nov 2019 13:24:37 -0800
Subject: [PATCH] do not fail on test chmod

---
external/runtime/runtime.depproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external/runtime/runtime.depproj b/external/runtime/runtime.depproj
index 3ce0ed89bc..1298019efd 100644
--- a/external/runtime/runtime.depproj
+++ b/external/runtime/runtime.depproj
@@ -60,7 +60,7 @@
SkipUnchangedFiles="true"
UseHardlinksIfPossible="$(UseHardlink)" />

- <Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension)" Condition="'$(OS)' != 'Windows_NT'"/>
+ <Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension) || true" Condition="'$(OS)' != 'Windows_NT'"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has someone from corefx looked at this change? We are (or were) hitting this on Fedora 32 and Arch Linux as well: #1310 (comment). Maybe this should be merged into corefx if it's the correct general fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that is my plan. but I'll do it after repo merge. I did testing and we don't need it at all any more. The dotnet is executable as it should on its own.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the build work without this change? I wouldn't expect test code to be getting hit in our normal build.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crummel The build fails here for Fedora 32 and Arch Linux too: #1310 (comment). This code path is definitely invoked in source-build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it does not build @crummel
It seems like it got moved to Arcade in master.
I'll take a look after repo merge is over.
cc: @safern

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW I think this is old time paranoia when we did not know how to set and preserve executable bits on Unix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(In foreseeable future) Would it be possible to prepare TestHostRoot directory before executing the build.sh? How do the other platforms acquire it?

I had to figure out what constituents are required in this directory to execute corefx tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This normally comes from TestHost and matching runtime entry. The problem is that if you get standard package (or if it lives in your nuget cache) it does not have platform reference and then dotnet is not restored and chmod fails.
At this point you may not even want to run tests but it breaks build it self. Conceptually I feel that is not correct.
To get to point where you can run tests on FreeBSD, I copy bootstrap dotnet over. (and related native libraries) You can pass --buildtests to top level script to build but not run tests @am11. This will go away and everything will work as other platforms once we have builds and packages flowing.


<Copy SourceFiles="@(HostSdkFile)"
DestinationFolder="$(TestHostRootPath)sdk\$(DotNetVersion)\%(RecursiveDir)"
--
2.23.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 1e30a5ac24a020a16848d535a5905b192371203b Mon Sep 17 00:00:00 2001
From: Adeel Mujahid <[email protected]>
Date: Fri, 15 Nov 2019 02:33:07 +0200
Subject: [PATCH] P/invoke Kernel32.dll only on Windows (#7858)

---
src/fsharp/lib.fs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs
index 6c4599f8a..2cec1e666 100755
--- a/src/fsharp/lib.fs
+++ b/src/fsharp/lib.fs
@@ -4,6 +4,7 @@ module internal FSharp.Compiler.Lib

open System.IO
open System.Collections.Generic
+open System.Runtime.InteropServices
open Internal.Utilities
open FSharp.Compiler.AbstractIL
open FSharp.Compiler.AbstractIL.Internal
@@ -515,7 +516,7 @@ module UnmanagedProcessExecutionOptions =
// Translation of C# from http://swikb/v1/DisplayOnlineDoc.aspx?entryID=826 and copy in bug://5018
[<System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)>]
let EnableHeapTerminationOnCorruption() =
- if (System.Environment.OSVersion.Version.Major >= 6 && // If OS is Vista or higher
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && System.Environment.OSVersion.Version.Major >= 6 && // If OS is Vista or higher
System.Environment.Version.Major < 3) then // and CLR not 3.0 or higher
// "The flag HeapSetInformation sets is available in Windows XP SP3 and later.
// The data structure used for heap information is available on earlier versions of Windows.
@@ -544,4 +545,4 @@ module StackGuard =

let EnsureSufficientExecutionStack recursionDepth =
if recursionDepth > MaxUncheckedRecursionDepth then
- RuntimeHelpers.EnsureSufficientExecutionStack ()
\ No newline at end of file
+ RuntimeHelpers.EnsureSufficientExecutionStack ()
--
2.23.0

5 changes: 4 additions & 1 deletion repos/aspnetcore.proj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))/dir.props" />

<PropertyGroup>
<OverrideTargetRid>$(TargetRid)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'FreeBSD'">freebsd-x64</OverrideTargetRid>

<BuildCommandArgs>$(BuildCommandArgs) --restore --build --pack</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) --configuration $(Configuration)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) --ci</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) -bl</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:BuildNodeJs=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:SourceBuildRuntimeIdentifier=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:SourceBuildRuntimeIdentifier=$(OverrideTargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:UseAppHost=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:CrossgenOutput=false</BuildCommandArgs>

Expand Down
4 changes: 3 additions & 1 deletion repos/core-sdk.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:AspNetCoreSharedFxInstallerRid=linux-x64</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:OSName=$(OSNameOverride)</BuildCommandArgs>
<!-- core-sdk always wants to build portable on OSX -->
<!-- core-sdk always wants to build portable on OSX and FreeBSD -->
<BuildCommandArgs Condition="'$(TargetOS)' == 'FreeBSD'">$(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'OSX'">$(BuildCommandArgs) /p:CoreSetupRid=osx-x64</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:CoreSetupRid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) -c $(Configuration)</BuildCommandArgs>
Expand Down Expand Up @@ -39,6 +40,7 @@

<PackageOutputRid Condition="'$(TargetOS)' == 'Windows_NT'">win-x64</PackageOutputRid>
<PackageOutputRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</PackageOutputRid>
<PackageOutputRid Condition="'$(TargetOS)' == 'FreeBSD'">freebsd-x64</PackageOutputRid>
<PackageOutputRid Condition="'$(PackageOutputRid)' == ''">$(TargetRid)</PackageOutputRid>
<PackagesOutput>$(ProjectDirectory)artifacts/packages/$(Configuration)/Shipping/</PackagesOutput>
<TarBallOutput>$(PackagesOutput)</TarBallOutput>
Expand Down
Loading