Skip to content
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

add FreeBSD build #34521

Merged
merged 39 commits into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
76a623a
try to add FreeBSD to the build
Apr 3, 2020
b5e3195
s/FreeBSD/FReeBSD_x64
Apr 3, 2020
85b0e5f
more fixes to pass -os FreeBSD
Apr 3, 2020
335c178
add missing :
Apr 4, 2020
6e4c21d
more fixes and feedback from review
Apr 4, 2020
60cab5a
pull in new container
Apr 7, 2020
bd9bb0d
fix corelib-nativecorelib-tools-packages as well
Apr 7, 2020
4693f88
add crossrootfsDir
Apr 7, 2020
b8e356c
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
Apr 7, 2020
5aabdda
pass crossrootfsDir
Apr 7, 2020
c75f5c6
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
Apr 7, 2020
5c44318
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
Apr 8, 2020
2782bc1
fix installr
Apr 8, 2020
f02c986
fix compilation on freebsd
wfurt Apr 8, 2020
a924fea
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
Apr 8, 2020
ace6144
fix test build on freebsd
wfurt Apr 8, 2020
03c21e3
update to match new layout
Apr 8, 2020
635c411
fix native tests
Apr 8, 2020
77646fd
CrossBuild?
Apr 8, 2020
968704e
rootfsDir debug
Apr 8, 2020
3b6b2fd
merge with linux to get container support
Apr 8, 2020
7b8c144
fix proc_maps
Apr 8, 2020
b8080ef
fix up buildCommandSourcesDirectory
Apr 9, 2020
78292ea
remove debug
Apr 9, 2020
2853216
more fixup for buildCommandSourcesDirectory
Apr 9, 2020
932c0bc
use TargetOS instead of os
Apr 9, 2020
8c74998
remove old section
Apr 9, 2020
e50567c
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
Apr 9, 2020
46ae15d
rever changes to get_loaded_library_from_proc_maps
Apr 9, 2020
1cc171a
fix compilation with missing getline
wfurt Apr 10, 2020
df609f6
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
Apr 11, 2020
163b9af
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
wfurt Apr 13, 2020
5c08c0c
add official build
wfurt Apr 13, 2020
d0149df
Merge branch 'fbuild' of https://github.com/wfurt/runtime into fbuild
wfurt Apr 13, 2020
dc9ca03
use arch
wfurt Apr 13, 2020
098dc35
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
wfurt Apr 14, 2020
bf3743e
remove special pool for freebsd
wfurt Apr 14, 2020
6f17e46
Merge branch 'master' of https://github.com/dotnet/runtime into fbuild
wfurt Apr 16, 2020
327dc63
roll-back runtime-official.yml
wfurt Apr 17, 2020
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
36 changes: 19 additions & 17 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,25 @@ jobs:
${{ insert }}: ${{ parameters.jobParameters }}

# FreeBSD

# FreeBSD machines are currently offline. Re-enable in the official build when
# the machines are healthy.

# - template: xplat-setup.yml
# parameters:
# jobTemplate: ${{ parameters.jobTemplate }}
# osGroup: FreeBSD
# archType: x64
# jobParameters:
# runtimeFlavor: ${{ parameters.runtimeFlavor }}
# buildConfig: ${{ parameters.buildConfig }}
# # There are no FreeBSD helix queues, so we don't run tests at the moment.
# helixQueues:
# asString: ''
# asArray: []
# ${{ insert }}: ${{ parameters.jobParameters }}
- ${{ if containsValue(parameters.platforms, 'FreeBSD_x64') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: FreeBSD
archType: x64
platform: FreeBSD_x64
container:
image: ubuntu-18.04-cross-freebsd-11-20200407092345-a84b0d2
registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
buildConfig: ${{ parameters.buildConfig }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
crossrootfsDir: '/crossrootfs/x64'
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
${{ insert }}: ${{ parameters.jobParameters }}

# Android x64

Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/coreclr/templates/build-corelib-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- template: /eng/pipelines/common/restore-internal-tools.yml

# Build Private CoreLib
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib $(crossArg) -arch $(archType) -c $(buildConfig) $(officialBuildIdArg) -ci
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci
wfurt marked this conversation as resolved.
Show resolved Hide resolved
displayName: Build System.Private.CoreLib


Expand Down
10 changes: 3 additions & 7 deletions eng/pipelines/coreclr/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ jobs:
- ${{ if and(ne(parameters.osGroup, 'Windows_NT'), eq(parameters.compilerName, 'clang')) }}:
- name: compilerArg
value: '-clang9'
# Our FreeBSD doesn't yet detect available clang versions, so pass it explicitly.
- ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
- name: compilerArg
value: '-clang6.0'
# Building for x64 MUSL happens on Alpine Linux and we need to use the stable version available there
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubgroup, '_musl'), eq(parameters.archType, 'x64')) }}:
- name: compilerArg
Expand Down Expand Up @@ -128,7 +124,7 @@ jobs:

# Build CoreCLR Runtime
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- script: $(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) $(officialBuildIdArg)
- script: $(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(officialBuildIdArg)
displayName: Build CoreCLR Runtime
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- script: set __TestIntermediateDir=int&&$(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(enforcePgoArg) $(officialBuildIdArg)
Expand All @@ -139,11 +135,11 @@ jobs:
displayName: Build Cross OS Linux DAC for Windows

# Build CoreCLR Managed Components
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.tools+clr.packages $(crossArg) -arch $(archType) -c $(buildConfig) $(officialBuildIdArg) -ci
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.tools+clr.packages $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci
displayName: Build managed product components and packages

# Build native test components
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(compilerArg) skipgeneratelayout
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged $(buildConfig) $(archType) $(crossArg) $(osArg) $(priorityArg) $(compilerArg) skipgeneratelayout
displayName: Build native test components

# Sign on Windows
Expand Down
7 changes: 7 additions & 0 deletions eng/pipelines/coreclr/templates/xplat-pipeline-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,11 @@ jobs:
- ${{ each variable in parameters.variables }}:
- ${{insert}}: ${{ variable }}

- name: osArg
value: ''

- ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
- name: osArg
wfurt marked this conversation as resolved.
Show resolved Hide resolved
value: -os FreeBSD

steps: ${{ parameters.steps }}
11 changes: 4 additions & 7 deletions eng/pipelines/installer/jobs/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:
value: /p:OfficialBuildId=$(Build.BuildNumber)

- name: buildCommandSourcesDirectory
${{ if ne(parameters.osGroup, 'Linux') }}:
${{ if not(in(parameters.osGroup, 'Linux', 'FreeBSD')) }}:
value: '$(Build.SourcesDirectory)/'
# This job runs within Docker containers, so Build.SourcesDirectory is not accurate.
${{ if eq(parameters.osGroup, 'Linux') }}:
${{ if in(parameters.osGroup, 'Linux', 'FreeBSD') }}:
value: '/root/runtime/'

###
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
$(CommonMSBuildArgs)
$(OfficialBuildArg)

- ${{ if eq(parameters.osGroup, 'Linux') }}:
- ${{ if in(parameters.osGroup, 'Linux', 'FreeBSD') }}:

# Preserve the NuGet authentication env vars into the Docker container.
# The 'NuGetAuthenticate' build step may have set these.
Expand All @@ -165,10 +165,6 @@ jobs:
-e ROOTFS_DIR=${{ parameters.crossrootfsDir }}
${{ parameters.container }}

- ${{ if eq(parameters.name, 'FreeBSD_x64') }}:
- name: RunArguments
value: export DotNetBootstrapCliTarPath=/dotnet-sdk-freebsd-x64.tar &&

- name: BuildScript
value: ./build.sh
- name: MSBuildScript
Expand All @@ -183,6 +179,7 @@ jobs:
- name: CommonMSBuildArgs
value: >-
/p:Configuration=$(_BuildConfig)
/p:TargetOS=${{ parameters.osGroup }}
/p:TargetArchitecture=${{ parameters.archType }}
$(OfficialBuildArg)

Expand Down
18 changes: 3 additions & 15 deletions eng/pipelines/libraries/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- ${{ if ne(parameters.testScope, '') }}:
- _testScopeArg: -testscope ${{ parameters.testScope }}

- ${{ if eq(parameters.osGroup, 'Linux') }}:
- ${{ if in(parameters.osGroup, 'Linux', 'FreeBSD') }}:
- _crossBuildPropertyArg: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }}

- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, '_musl')) }}:
Expand All @@ -63,20 +63,8 @@ jobs:
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, ''), eq(parameters.archType, 'arm')) }}:
- _runtimeOSArg: /p:RuntimeOS=ubuntu.16.04

# force a value for OS when cross-building WebAssembly
- ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

# force a value for OS when cross-building tvOS on OSX
- ${{ if eq(parameters.osGroup, 'tvOS') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

# force a value for OS when cross-building iOS on OSX
- ${{ if eq(parameters.osGroup, 'iOS') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

# force a value for OS when cross-building Android on Linux
- ${{ if eq(parameters.osGroup, 'Android') }}:
# force a value for OS when cross-building
- ${{ if in(parameters.osGroup, 'WebAssembly', 'iOS', 'tvOS', 'Android', 'FreeBSD') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

- ${{ if ne(parameters.framework, '') }}:
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
- Windows_NT_x86
- Windows_NT_arm
- Windows_NT_arm64
- FreeBSD_x64
wfurt marked this conversation as resolved.
Show resolved Hide resolved
jobParameters:
testGroup: innerloop

Expand Down Expand Up @@ -218,6 +219,7 @@ jobs:
- Windows_NT_x86
- Windows_NT_arm
- Windows_NT_arm64
- FreeBSD_x64
jobParameters:
testGroup: innerloop

Expand Down Expand Up @@ -401,6 +403,7 @@ jobs:
- Linux_x64
- OSX_x64
- Windows_NT_x64
- FreeBSD_x64
jobParameters:
liveRuntimeBuildConfig: release

Expand Down Expand Up @@ -525,6 +528,7 @@ jobs:
- Linux_arm64
- Linux_musl_x64
- Windows_NT_x64
- FreeBSD_x64
jobParameters:
liveRuntimeBuildConfig: release
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
Expand Down
4 changes: 4 additions & 0 deletions src/installer/corehost/cli/hostmisc/pal.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if defined(TARGET_FREEBSD)
#define _WITH_GETLINE
#endif

#include "pal.h"
#include "utils.h"
#include "trace.h"
Expand Down