Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions eng/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</PropertyGroup>

<PropertyGroup>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('OSX'))">OSX</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('NETBSD'))">NetBSD</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSUnixLike())">Linux</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('WINDOWS'))">Windows_NT</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('OSX'))">osx</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('FREEBSD'))">freebsd</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('NETBSD'))">netbsd</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSUnixLike())">linux</__TargetOS>
<__TargetOS Condition="'$(__TargetOS)' == '' and $([MSBuild]::IsOSPlatform('WINDOWS'))">win</__TargetOS>
<TargetOS Condition="'$(TargetOS)' == ''">$(__TargetOS)</TargetOS>
<CoreCLRTargetOS Condition="'$(CoreCLRTargetOS)' == ''">$(TargetOS)</CoreCLRTargetOS>
<MonoTargetOS Condition="'$(MonoTargetOS)' == ''">$(TargetOS)</MonoTargetOS>
Expand Down
4 changes: 2 additions & 2 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<PropertyGroup>
<DefaultSubsetCategories>libraries-installer-coreclr-mono</DefaultSubsetCategories>
<DefaultSubsetCategories Condition="'$(TargetOS)' == 'iOS'">libraries-mono</DefaultSubsetCategories>
<DefaultSubsetCategories Condition="'$(TargetOS)' == 'ios'">libraries-mono</DefaultSubsetCategories>
<DefaultInstallerSubsets>corehost-managed-depproj-pkgproj-bundle-installers-test</DefaultInstallerSubsets>
<!-- TODO: Split into multiple sets. -->
<DefaultLibrariesSubsets>all</DefaultLibrariesSubsets>
Expand All @@ -78,7 +78,7 @@
</PropertyGroup>

<PropertyGroup>
<RuntimeFlavor Condition="'$(TargetOS)' == 'iOS'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(TargetOS)' == 'ios'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and $(_subsetCategory.Contains('mono')) and !$(_subsetCategory.Contains('coreclr'))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Get-Help() {
Write-Host " -subset Build a subset, print available subsets with -subset help"
Write-Host " -subsetCategory Build a subsetCategory, print available subsetCategories with -subset help"
Write-Host " -vs Open the solution with VS for Test Explorer support. Path or solution name (ie -vs Microsoft.CSharp)"
Write-Host " -os Build operating system: Windows_NT or Unix"
Write-Host " -os Build operating system: win or unix"
Write-Host " -arch Build platform: x86, x64, arm or arm64 (short: -a). Pass a comma-separated list to build for multiple architectures."
Write-Host " -configuration Build configuration: Debug, Release or [CoreCLR]Checked (short: -c). Pass a comma-separated list to build for multiple configurations"
Write-Host " -runtimeConfiguration Runtime build configuration: Debug, Release or [CoreCLR]Checked"
Expand Down Expand Up @@ -89,8 +89,8 @@ if ($vs) {
$archTestHost = if ($arch) { $arch } else { "x64" }

# This tells .NET Core to use the same dotnet.exe that build scripts use
$env:DOTNET_ROOT="$PSScriptRoot\..\artifacts\bin\testhost\netcoreapp5.0-Windows_NT-$configuration-$archTestHost";
$env:DEVPATH="$PSScriptRoot\..\artifacts\bin\testhost\net472-Windows_NT-$configuration-$archTestHost";
$env:DOTNET_ROOT="$PSScriptRoot\..\artifacts\bin\testhost\netcoreapp5.0-win-$configuration-$archTestHost";
$env:DEVPATH="$PSScriptRoot\..\artifacts\bin\testhost\net472-win-$configuration-$archTestHost";
}

# This tells MSBuild to load the SDK from the directory of the bootstrapped SDK
Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ usage()
echo "Common settings:"
echo " --subset Build a subset, print available subsets with -subset help"
echo " --subsetCategory Build a subsetCategory, print available subsetCategories with -subset help"
echo " --os Build operating system: Windows_NT or Unix"
echo " --os Build operating system: win or unix"
echo " --arch Build platform: x86, x64, arm or arm64"
echo " --configuration Build configuration: Debug, Release or [CoreCLR]Checked (short: -c)"
echo " --runtimeConfiguration Runtime build configuration: Debug, Release or [CoreCLR]Checked"
Expand Down
4 changes: 2 additions & 2 deletions eng/codeOptimization.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
Condition="'$(IsEligibleForNgenOptimization)' == 'true'"
BeforeTargets="CoreCompile">
<PropertyGroup>
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'Unix' or '$(TargetOS)' == 'Linux'">$(IbcOptimizationDataDir)Linux\</IbcOptimizationDataDir>
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'Windows_NT'">$(IbcOptimizationDataDir)Windows\</IbcOptimizationDataDir>
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'unix' or '$(TargetOS)' == 'linux'">$(IbcOptimizationDataDir)Linux\</IbcOptimizationDataDir>
<IbcOptimizationDataDir Condition="'$(TargetOS)' == 'win'">$(IbcOptimizationDataDir)Windows\</IbcOptimizationDataDir>
</PropertyGroup>
<ItemGroup>
<_optimizationDataAssembly Include="$(IbcOptimizationDataDir)**\$(TargetFileName)" />
Expand Down
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk.windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
ARG TFM=netcoreapp5.0
ARG OS=Windows_NT
ARG OS=win
ARG ARCH=x64
ARG CONFIGURATION=Release

Expand Down
6 changes: 3 additions & 3 deletions eng/install-native-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

if [ "$1" = "Linux" ]; then
if [ "$1" = "linux" ]; then
sudo apt update
if [ "$?" != "0" ]; then
exit 1;
Expand All @@ -9,7 +9,7 @@ if [ "$1" = "Linux" ]; then
if [ "$?" != "0" ]; then
exit 1;
fi
elif [ "$1" = "OSX" ]; then
elif [ "$1" = "osx" ]; then
brew update
brew upgrade
if [ "$?" != "0" ]; then
Expand All @@ -34,7 +34,7 @@ elif [ "$1" = "iOS" ]; then
exit 1;
fi
else
echo "Must pass \"Linux\", \"iOS\" or \"OSX\" as first argument."
echo "Must pass \"linux\", \"ios\" or \"osx\" as first argument."
exit 1
fi

6 changes: 0 additions & 6 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
'$(AllArtifactsDownloadPath)' != ''">
<!-- Convert the OS component in the RID into names that match the job IDs. -->
<ArtifactPlatform>$(RuntimeIdentifier)</ArtifactPlatform>
<ArtifactPlatform>$(ArtifactPlatform.Replace('win-', 'Windows_NT-'))</ArtifactPlatform>
<ArtifactPlatform>$(ArtifactPlatform.Replace('unix-', 'Unix-'))</ArtifactPlatform>
<ArtifactPlatform>$(ArtifactPlatform.Replace('linux-', 'Linux-'))</ArtifactPlatform>
<ArtifactPlatform>$(ArtifactPlatform.Replace('osx-', 'OSX-'))</ArtifactPlatform>
<ArtifactPlatform>$(ArtifactPlatform.Replace('freebsd-', 'FreeBSD-'))</ArtifactPlatform>
<ArtifactPlatform>$(ArtifactPlatform.Replace('netbsd-', 'NetBSD-'))</ArtifactPlatform>
<!-- Artifact name uses '_' rather than '-'. -->
<ArtifactPlatform>$(ArtifactPlatform.Replace('-', '_'))</ArtifactPlatform>

Expand Down
4 changes: 2 additions & 2 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ isMSBuildOnNETCoreSupported()
return
fi

if [[ ( "$__HostOS" == "Linux" ) && ( "$__HostArch" == "x64" || "$__HostArch" == "arm" || "$__HostArch" == "armel" || "$__HostArch" == "arm64" ) ]]; then
if [[ ( "$__HostOS" == "linux" ) && ( "$__HostArch" == "x64" || "$__HostArch" == "arm" || "$__HostArch" == "armel" || "$__HostArch" == "arm64" ) ]]; then
__IsMSBuildOnNETCoreSupported=1
elif [[ ( "$__HostOS" == "OSX" || "$__HostOS" == "FreeBSD" ) && "$__HostArch" == "x64" ]]; then
elif [[ ( "$__HostOS" == "osx" || "$__HostOS" == "freebsd" ) && "$__HostArch" == "x64" ]]; then
__IsMSBuildOnNETCoreSupported=1
fi
}
Expand Down
40 changes: 24 additions & 16 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux OR CLR_CMAKE_HOST_OS STREQUAL Android)
clr_unknown_arch()
endif()
endif()
set(CLR_CMAKE_HOST_OS linux)
set(CLR_CMAKE_HOST_LINUX 1)

# Detect Linux ID
Expand Down Expand Up @@ -86,6 +87,7 @@ if(CLR_CMAKE_HOST_OS STREQUAL Darwin)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
set(CLR_CMAKE_HOST_DARWIN 1)
set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_C_COMPILER} <FLAGS> <DEFINES> <INCLUDES> -o <OBJECT> -c <SOURCE>")
set(CLR_CMAKE_HOST_OS osx)

@jkotas jkotas Mar 18, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the convention for CLR_CMAKE_HOST_OS ? This line has it lower cased RID, and the very next line has it upped cased human readable?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Again, this feels pretty unnatural to use the lower-cased shortened OS names in CMake. The convention in CMake is to use Linux, Windows, etc.

endif(CLR_CMAKE_HOST_OS STREQUAL Darwin)

if(CLR_CMAKE_HOST_OS STREQUAL iOS)
Expand All @@ -100,24 +102,28 @@ if(CLR_CMAKE_HOST_OS STREQUAL iOS)
else()
clr_unknown_arch()
endif()
set(CLR_CMAKE_HOST_OS ios)
endif(CLR_CMAKE_HOST_OS STREQUAL iOS)

if(CLR_CMAKE_HOST_OS STREQUAL FreeBSD)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
set(CLR_CMAKE_HOST_FREEBSD 1)
set(CLR_CMAKE_HOST_OS freebsd)
endif(CLR_CMAKE_HOST_OS STREQUAL FreeBSD)

if(CLR_CMAKE_HOST_OS STREQUAL OpenBSD)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
set(CLR_CMAKE_HOST_OPENBSD 1)
set(CLR_CMAKE_HOST_OS openbsd)
endif(CLR_CMAKE_HOST_OS STREQUAL OpenBSD)

if(CLR_CMAKE_HOST_OS STREQUAL NetBSD)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
set(CLR_CMAKE_HOST_NETBSD 1)
set(CLR_CMAKE_HOST_OS netbsd)
endif(CLR_CMAKE_HOST_OS STREQUAL NetBSD)

if(CLR_CMAKE_HOST_OS STREQUAL SunOS)
Expand All @@ -134,15 +140,17 @@ if(CLR_CMAKE_HOST_OS STREQUAL SunOS)
endif()

set(CLR_CMAKE_HOST_SUNOS 1)
set(CLR_CMAKE_HOST_OS sunos)
endif(CLR_CMAKE_HOST_OS STREQUAL SunOS)

if(CLR_CMAKE_HOST_OS STREQUAL Windows)
set(CLR_CMAKE_HOST_OS Windows_NT)
set(CLR_CMAKE_HOST_OS win)
set(CLR_CMAKE_HOST_WIN32 1)
endif(CLR_CMAKE_HOST_OS STREQUAL Windows)

if(CLR_CMAKE_HOST_OS STREQUAL Emscripten)
set(CLR_CMAKE_HOST_ARCH_WASM 1)
set(CLR_CMAKE_HOST_OS emscripten)
endif(CLR_CMAKE_HOST_OS STREQUAL Emscripten)

#--------------------------------------------
Expand Down Expand Up @@ -224,10 +232,10 @@ if (NOT DEFINED CLR_CMAKE_TARGET_OS OR CLR_CMAKE_TARGET_OS STREQUAL "" )
set(CLR_CMAKE_TARGET_OS ${CLR_CMAKE_HOST_OS})
endif()

if(CLR_CMAKE_TARGET_OS STREQUAL Linux)
if(CLR_CMAKE_TARGET_OS STREQUAL linux)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_LINUX 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Linux)
endif(CLR_CMAKE_TARGET_OS STREQUAL linux)

if(CLR_CMAKE_TARGET_OS STREQUAL tizen)
set(CLR_CMAKE_TARGET_UNIX 1)
Expand All @@ -247,35 +255,35 @@ if(CLR_CMAKE_TARGET_OS STREQUAL Android)
set(CLR_CMAKE_TARGET_ANDROID 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Android)

if(CLR_CMAKE_TARGET_OS STREQUAL Darwin)
if(CLR_CMAKE_TARGET_OS STREQUAL osx)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_DARWIN 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Darwin)
endif(CLR_CMAKE_TARGET_OS STREQUAL osx)

if(CLR_CMAKE_TARGET_OS STREQUAL iOS)
if(CLR_CMAKE_TARGET_OS STREQUAL ios)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_IOS 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL iOS)
endif(CLR_CMAKE_TARGET_OS STREQUAL ios)

if(CLR_CMAKE_TARGET_OS STREQUAL FreeBSD)
if(CLR_CMAKE_TARGET_OS STREQUAL freebsd)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_FREEBSD 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL FreeBSD)
endif(CLR_CMAKE_TARGET_OS STREQUAL freebsd)

if(CLR_CMAKE_TARGET_OS STREQUAL OpenBSD)
if(CLR_CMAKE_TARGET_OS STREQUAL openbsd)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_OPENBSD 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL OpenBSD)
endif(CLR_CMAKE_TARGET_OS STREQUAL openbsd)

if(CLR_CMAKE_TARGET_OS STREQUAL NetBSD)
if(CLR_CMAKE_TARGET_OS STREQUAL netbsd)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_NETBSD 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL NetBSD)
endif(CLR_CMAKE_TARGET_OS STREQUAL netbsd)

if(CLR_CMAKE_TARGET_OS STREQUAL SunOS)
if(CLR_CMAKE_TARGET_OS STREQUAL sunos)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_SUNOS 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL SunOS)
endif(CLR_CMAKE_TARGET_OS STREQUAL sunos)

if(CLR_CMAKE_TARGET_UNIX)
if(CLR_CMAKE_TARGET_ARCH STREQUAL x64)
Expand Down Expand Up @@ -303,7 +311,7 @@ if (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS)
endif()
endif()
else()
if(NOT (CLR_CMAKE_HOST_OS STREQUAL Windows_NT))
if(NOT (CLR_CMAKE_HOST_OS STREQUAL win))

@akoeplinger akoeplinger Mar 9, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All the other CLR_CMAKE_HOST_OS values on other platforms are initialized to longer names that start with upper case so this makes it inconsistent.

You could change it to Windows on L117 instead.

message(FATAL_ERROR "Invalid host and target os/arch combination. Host OS: ${CLR_CMAKE_HOST_OS}")
endif()
if(NOT (CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_ALPINE_LINUX))
Expand Down
14 changes: 3 additions & 11 deletions eng/native/init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ initNonPortableDistroRid()
local rootfsDir="$4"
local nonPortableBuildID=""

if [ "$targetOs" = "Linux" ]; then
if [ "$targetOs" = "linux" ]; then
if [ -e "${rootfsDir}/etc/os-release" ]; then
source "${rootfsDir}/etc/os-release"

Expand All @@ -69,7 +69,7 @@ initNonPortableDistroRid()
fi
fi

if [ "$targetOs" = "FreeBSD" ]; then
if [ "$targetOs" = "freebsd" ]; then
__freebsd_major_version=$(freebsd-version | { read v; echo "${v%%.*}"; })
nonPortableBuildID="freebsd.$__freebsd_major_version-${buildArch}"
fi
Expand Down Expand Up @@ -157,15 +157,7 @@ initDistroRidGlobal()
fi

if [ -z "${distroRid}" ]; then
if [ "$targetOs" = "Linux" ]; then
distroRid="linux-$buildArch"
elif [ "$targetOs" = "OSX" ]; then
distroRid="osx-$buildArch"
elif [ "$targetOs" = "iOS" ]; then
distroRid="ios-$buildArch"
elif [ "$targetOs" = "FreeBSD" ]; then
distroRid="freebsd-$buildArch"
fi
distroRid="$targetOs-$buildArch"
fi

__DistroRid="${distroRid}"
Expand Down
16 changes: 12 additions & 4 deletions eng/native/init-os-and-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
# Use uname to determine what the OS is.
OSName=$(uname -s)
case "$OSName" in
FreeBSD|Linux|NetBSD|OpenBSD|SunOS)
os=$OSName ;;
FreeBSD)
os=freebsd ;;
Linux)
os=linux ;;
NetBSD)
os=netbsd ;;
OpenBSD)
os=openbsd ;;
SunOS)
os=sunos ;;
Darwin)
os=OSX ;;
os=osx ;;
*)
echo "Unsupported OS $OSName detected, configuring as if for Linux"
os=Linux ;;
os=linux ;;
esac

# Use uname to determine what the CPU is.
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
variables: ${{ parameters.variables }}

steps:
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- ${{ if eq(parameters.osGroup, 'osx') }}:
- script: |
$(setScriptToEchoAndFailOnNonZero)
brew install pkgconfig icu4c openssl autoconf automake libtool pkg-config python3
Expand Down
Loading