Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Rename --distrorid to --outputrid.
  • Loading branch information
tmds committed Aug 31, 2022
commit d89911f74ac9d8efa4c0447c80d7d614f04eb7b3
9 changes: 4 additions & 5 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ usage()
echo " --os Target operating system: windows, Linux, FreeBSD, OSX, MacCatalyst, tvOS,"
echo " tvOSSimulator, iOS, iOSSimulator, Android, Browser, NetBSD, illumos or Solaris."
echo " [Default: Your machine's OS.]"
echo " --distrorid <rid> Optional argument that overrides the target rid name."
echo " --outputrid <rid> Optional argument that overrides the target rid name."
echo " --projects <value> Project or solution file(s) to build."
echo " --runtimeConfiguration (-rc) Runtime build configuration: Debug, Release or Checked."
echo " Checked is exclusive to the CLR runtime. It is the same as Debug, except code is"
Expand Down Expand Up @@ -403,13 +403,12 @@ while [[ $# > 0 ]]; do
shift 1
;;

-distrorid)
-outputrid)
if [ -z ${2+x} ]; then
echo "No value for distrorid is supplied. See help (--help) for supported values." 1>&2
echo "No value for outputrid is supplied. See help (--help) for supported values." 1>&2
exit 1
fi
__DistroRid="$(echo "$2" | tr "[:upper:]" "[:lower:]")"
arguments="$arguments /p:OutputRid=$__DistroRid"
arguments="$arguments /p:OutputRid=$(echo "$2" | tr "[:upper:]" "[:lower:]")"
shift 2
;;

Expand Down
13 changes: 9 additions & 4 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ usage()
echo "-gccx.y: optional argument to build using gcc version x.y."
echo "-ninja: target ninja instead of GNU make"
echo "-numproc: set the number of build processes."
echo "-distrorid: optional argument that overrides the target rid name."
echo "-outputrid: optional argument that overrides the target rid name."
echo "-portablebuild: pass -portablebuild=false to force a non-portable build."
echo "-skipconfigure: skip build configuration."
echo "-keepnativesymbols: keep native/unmanaged debug symbols."
Expand All @@ -233,6 +233,7 @@ __TargetArch=$arch
__TargetOS=$os
__HostOS=$os
__BuildOS=$os
__OutputRid=''

# Get the number of processors available to the scheduler
# Other techniques such as `nproc` only get the number of
Expand Down Expand Up @@ -397,12 +398,12 @@ while :; do
__TargetArch=wasm
;;

distrorid|-distrorid)
outputrid|-outputrid)
if [[ -n "$2" ]]; then
__DistroRid="$2"
__OutputRid="$2"
shift
else
echo "ERROR: 'distrorid' requires a non-empty option argument"
echo "ERROR: 'outputrid' requires a non-empty option argument"
exit 1
fi
;;
Expand Down Expand Up @@ -489,3 +490,7 @@ fi

# init the target distro name
initTargetDistroRid

if [ -z "$__OutputRid" ]; then
__OutputRid="$(echo $__DistroRid | tr '[:upper:]' '[:lower:]')"
fi
110 changes: 54 additions & 56 deletions eng/native/init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,72 +137,70 @@ initDistroRidGlobal()
rootfsDir="$4"
fi

if [ -z "${__DistroRid:-}" ]; then
if [ -n "${rootfsDir}" ]; then
# We may have a cross build. Check for the existence of the rootfsDir
if [ ! -e "${rootfsDir}" ]; then
echo "Error rootfsDir has been passed, but the location is not valid."
exit 1
fi
if [ -n "${rootfsDir}" ]; then
# We may have a cross build. Check for the existence of the rootfsDir
if [ ! -e "${rootfsDir}" ]; then
echo "Error rootfsDir has been passed, but the location is not valid."
exit 1
fi
fi

initNonPortableDistroRid "${targetOs}" "${buildArch}" "${isPortable}" "${rootfsDir}"
initNonPortableDistroRid "${targetOs}" "${buildArch}" "${isPortable}" "${rootfsDir}"

if [ "$buildArch" = "wasm" ]; then
__DistroRid=browser-wasm
export __DistroRid
fi
if [ "$buildArch" = "wasm" ]; then
__DistroRid=browser-wasm
export __DistroRid
fi

if [ -z "${__DistroRid}" ]; then
# The non-portable build rid was not set. Set the portable rid.
if [ -z "${__DistroRid}" ]; then
# The non-portable build rid was not set. Set the portable rid.

__PortableBuild=1
export __PortableBuild
local distroRid=""
__PortableBuild=1
export __PortableBuild
local distroRid=""

# Check for musl-based distros (e.g Alpine Linux, Void Linux).
if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl ||
strings "${rootfsDir}/usr/bin/ldd" 2>&1 | grep -q musl; then
distroRid="linux-musl-${buildArch}"
fi
# Check for musl-based distros (e.g Alpine Linux, Void Linux).
if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl ||
strings "${rootfsDir}/usr/bin/ldd" 2>&1 | grep -q musl; then
distroRid="linux-musl-${buildArch}"
fi

if [ -z "${distroRid}" ]; then
if [ "$targetOs" = "Linux" ]; then
distroRid="linux-$buildArch"
elif [ "$targetOs" = "linux-bionic" ]; then
distroRid="linux-bionic-$buildArch"
elif [ "$targetOs" = "OSX" ]; then
distroRid="osx-$buildArch"
elif [ "$targetOs" = "MacCatalyst" ]; then
distroRid="maccatalyst-$buildArch"
elif [ "$targetOs" = "tvOS" ]; then
distroRid="tvos-$buildArch"
elif [ "$targetOs" = "tvOSSimulator" ]; then
distroRid="tvossimulator-$buildArch"
elif [ "$targetOs" = "iOS" ]; then
distroRid="ios-$buildArch"
elif [ "$targetOs" = "iOSSimulator" ]; then
distroRid="iossimulator-$buildArch"
elif [ "$targetOs" = "Android" ]; then
distroRid="android-$buildArch"
elif [ "$targetOs" = "Browser" ]; then
distroRid="browser-$buildArch"
elif [ "$targetOs" = "FreeBSD" ]; then
distroRid="freebsd-$buildArch"
elif [ "$targetOs" = "illumos" ]; then
distroRid="illumos-$buildArch"
elif [ "$targetOs" = "Solaris" ]; then
distroRid="solaris-$buildArch"
fi
if [ -z "${distroRid}" ]; then
if [ "$targetOs" = "Linux" ]; then
distroRid="linux-$buildArch"
elif [ "$targetOs" = "linux-bionic" ]; then
distroRid="linux-bionic-$buildArch"
elif [ "$targetOs" = "OSX" ]; then
distroRid="osx-$buildArch"
elif [ "$targetOs" = "MacCatalyst" ]; then
distroRid="maccatalyst-$buildArch"
elif [ "$targetOs" = "tvOS" ]; then
distroRid="tvos-$buildArch"
elif [ "$targetOs" = "tvOSSimulator" ]; then
distroRid="tvossimulator-$buildArch"
elif [ "$targetOs" = "iOS" ]; then
distroRid="ios-$buildArch"
elif [ "$targetOs" = "iOSSimulator" ]; then
distroRid="iossimulator-$buildArch"
elif [ "$targetOs" = "Android" ]; then
distroRid="android-$buildArch"
elif [ "$targetOs" = "Browser" ]; then
distroRid="browser-$buildArch"
elif [ "$targetOs" = "FreeBSD" ]; then
distroRid="freebsd-$buildArch"
elif [ "$targetOs" = "illumos" ]; then
distroRid="illumos-$buildArch"
elif [ "$targetOs" = "Solaris" ]; then
distroRid="solaris-$buildArch"
fi

__DistroRid="${distroRid}"
fi

if [ -z "$__DistroRid" ]; then
echo "DistroRid is not set. This is almost certainly an error"
exit 1
fi
__DistroRid="${distroRid}"
fi

if [ -z "$__DistroRid" ]; then
echo "DistroRid is not set. This is almost certainly an error"
exit 1
fi

export __DistroRid
Expand Down
7 changes: 3 additions & 4 deletions src/native/corehost/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,13 @@ __LogsDir="$__RootBinDir/log"
__MsbuildDebugLogsDir="$__LogsDir/MsbuildDebugLogs"

# Set the remaining variables based upon the determined build configuration
__DistroRidLower="$(echo $__DistroRid | tr '[:upper:]' '[:lower:]')"
__BinDir="$__RootBinDir/bin/$__DistroRidLower.$__BuildType"
__IntermediatesDir="$__RootBinDir/obj/$__DistroRidLower.$__BuildType"
__BinDir="$__RootBinDir/bin/$__OutputRid.$__BuildType"
__IntermediatesDir="$__RootBinDir/obj/$__OutputRid.$__BuildType"

export __BinDir __IntermediatesDir __RuntimeFlavor

__CMakeArgs="-DCLI_CMAKE_HOST_VER=\"$__host_ver\" -DCLI_CMAKE_COMMON_HOST_VER=\"$__apphost_ver\" -DCLI_CMAKE_HOST_FXR_VER=\"$__fxr_ver\" $__CMakeArgs"
__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__DistroRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs"
__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__OutputRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs"
__CMakeArgs="-DRUNTIME_FLAVOR=\"$__RuntimeFlavor\" $__CMakeArgs"
__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs"

Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/corehost.proj
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<BuildArgs Condition="'$(Ninja)' == 'true'">$(BuildArgs) -ninja</BuildArgs>
<BuildArgs>$(BuildArgs) -runtimeflavor $(RuntimeFlavor)</BuildArgs>
<BuildArgs Condition="'$(OfficialBuildId)' != ''">$(BuildArgs) /p:OfficialBuildId="$(OfficialBuildId)"</BuildArgs>
<BuildArgs>$(BuildArgs) -distrorid $(OutputRid)</BuildArgs>
<BuildArgs>$(BuildArgs) -outputrid $(OutputRid)</BuildArgs>
</PropertyGroup>

<!--
Expand Down