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

Support building a mono-based .NET Runtime on x64 #68424

Merged
merged 1 commit into from
May 3, 2023
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
2 changes: 1 addition & 1 deletion eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(OfficialBuildId)' != ''">$(InnerBuildArgs) /p:OfficialBuildId=$(OfficialBuildId)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(ContinuousIntegrationBuild)' != ''">$(InnerBuildArgs) /p:ContinuousIntegrationBuild=$(ContinuousIntegrationBuild)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:PrimaryRuntimeFlavor=Mono /p:RuntimeFlavor=Mono</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) --usemonoruntime</InnerBuildArgs>
</PropertyGroup>
</Target>

Expand Down
8 changes: 6 additions & 2 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
platforms (like s390x) where only Mono is supported. The primary runtime
flavor is used to decide when to build the hosts and installers. -->
<PropertyGroup>
<PrimaryRuntimeFlavor>CoreCLR</PrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'ppc64le' or '$(TargetArchitecture)' == 'armv6' or '$(TargetsLinuxBionic)' == 'true'">Mono</PrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor>CoreCLR</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 'armv6'">Mono</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 'ppc64le'">Mono</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x'">Mono</DefaultPrimaryRuntimeFlavor>
<DefaultPrimaryRuntimeFlavor Condition="'$(TargetsLinuxBionic)' == 'true'">Mono</DefaultPrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(PrimaryRuntimeFlavor)' == ''">$(DefaultPrimaryRuntimeFlavor)</PrimaryRuntimeFlavor>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Param(
[ValidateSet("Debug","Release")][string][Alias('lc')]$librariesConfiguration,
[ValidateSet("CoreCLR","Mono")][string][Alias('rf')]$runtimeFlavor,
[ValidateSet("Debug","Release","Checked")][string][Alias('hc')]$hostConfiguration,
[switch]$usemonoruntime = $false,
[switch]$ninja,
[switch]$msbuild,
[string]$cmakeargs,
Expand Down Expand Up @@ -51,6 +52,7 @@ function Get-Help() {
Write-Host " -subset (-s) Build a subset, print available subsets with -subset help."
Write-Host " '-subset' can be omitted if the subset is given as the first argument."
Write-Host " [Default: Builds the entire repo.]"
Write-Host " -usemonoruntime Product a .NET runtime with Mono as the underlying runtime."
Write-Host " -verbosity (-v) MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]."
Write-Host " [Default: Minimal]"
Write-Host " -vs Open the solution with Visual Studio using the locally acquired SDK."
Expand Down Expand Up @@ -251,6 +253,7 @@ foreach ($argument in $PSBoundParameters.Keys)
{
"runtimeConfiguration" { $arguments += " /p:RuntimeConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
"runtimeFlavor" { $arguments += " /p:RuntimeFlavor=$($PSBoundParameters[$argument].ToLowerInvariant())" }
"usemonoruntime" { $arguments += " /p:PrimaryRuntimeFlavor=Mono" }
"librariesConfiguration" { $arguments += " /p:LibrariesConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
"hostConfiguration" { $arguments += " /p:HostConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
"framework" { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
Expand Down
6 changes: 6 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ usage()
echo " --subset (-s) Build a subset, print available subsets with -subset help."
echo " '--subset' can be omitted if the subset is given as the first argument."
echo " [Default: Builds the entire repo.]"
echo " --usemonoruntime Product a .NET runtime with Mono as the underlying runtime."
echo " --verbosity (-v) MSBuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]."
echo " [Default: Minimal]"
echo ""
Expand Down Expand Up @@ -360,6 +361,11 @@ while [[ $# > 0 ]]; do
shift 2
;;

-usemonoruntime)
Copy link
Member

Choose a reason for hiding this comment

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

The vmr option is --use-mono-runtime. Can you use the exact same name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! The rest of the options in the runtime build.sh use a completely different convention, though (eg outputrid, keepnativesymbols). Whatever I go with, it will look out of place with the other convention :(

Since this option lives in build.sh, I tried to keep it consistent with the other options in build.sh.

I am happy to change it if it's okay with the runtime maintainers.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds reasonable to me

Copy link
Member Author

Choose a reason for hiding this comment

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

Is that a "keeping it with current runtime convention sounds reasonable to me" or a "making it match the option in vmr sounds reasonable to me" ? 😄

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine leaving out the dashes. I didn't realize you had done it to be consistent with the other arguments.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with the current state too.

arguments="$arguments /p:PrimaryRuntimeFlavor=Mono"
shift 1
;;

-librariesconfiguration|-lc)
if [ -z ${2+x} ]; then
echo "No libraries configuration supplied. See help (--help) for supported libraries configurations." 1>&2
Expand Down