summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyd Haselton <chaselton@gmail.com>2017-06-08 17:34:04 -0500
committerGaurav Khanna <gkhanna@microsoft.com>2017-06-08 15:34:04 -0700
commitb4cbd9dbdc9f1850e5953bc785d2abb6cf0f69c3 (patch)
treeb5cb2fa3c8c09423dc3cfff4dda8b5cfa14d4ec8
parent0060a37d80d8164a2454557213832348c7bd85ec (diff)
downloadcoreclr-b4cbd9dbdc9f1850e5953bc785d2abb6cf0f69c3.tar.gz
coreclr-b4cbd9dbdc9f1850e5953bc785d2abb6cf0f69c3.tar.bz2
coreclr-b4cbd9dbdc9f1850e5953bc785d2abb6cf0f69c3.zip
First steps for generating nuget packages for ARM64/Android. (#10286)
* First steps for generating nuget packages for ARM64/Android. Adds Android RIDS and related conditionals to appropriate files * Additional changes for Android package build * Revert addition of Android to supported packages * Allow Android .nuget package build Adding runtime.Android files for package generation Adding TODO for reliable generation of __DistroRid for Android * Added/corrected logic for detecting __DistroRid at commandline Removed hack and TODO * Removed newline * Revert unintentional change to osx rid * Removed commenting of __DistroRid initialization * Latest fixes for __DistroRid cmdline detection Removed __DistroRid initialization (clobbers value set at cmdline) Removed echo test of __DistroRid in generate nuget pkg function (Hopefully) fixed cross-build os-release detection * Removed android.21-arm from supported RIDs Removed arm32 from supported RIDs until test build can be done or CI for arm32 added (?) * Fixes for package generation for android Modified build-android-rootfs.sh so it would generate file w/platform info Reverted all prior changes to initTargetDistroRid, added new android platform detection * Fixed conditional for Android * Added platform generation for Android portable build, if ever needed * Added information about android_platform Added help info about android_platform file Added TODO for dynamic generation of RID based on $__ApiLevel and $__BuildArch * Syntax cleanup for build.sh Removed extra space in initTargetDistroRid() logic * Recommended review changes removed Android-specific runtime files for packaging added conditional to have Android use Linux runtime files * Updated topic branch from master, resolving SPC.ni.dll file nuget pkg issue * ericstj review changes Fixed accidental fedora version change Fixed indenting * Removed TODO comment; logic already in place, added in earlier commit * Removed Android OfficialBuildRID
-rwxr-xr-xbuild.sh12
-rw-r--r--config.json6
-rwxr-xr-xcross/build-android-rootfs.sh4
-rw-r--r--src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props4
-rw-r--r--src/.nuget/dir.props22
5 files changed, 38 insertions, 10 deletions
diff --git a/build.sh b/build.sh
index 3385a8760a..a85b137789 100755
--- a/build.sh
+++ b/build.sh
@@ -73,8 +73,13 @@ initTargetDistroRid()
if [ $__CrossBuild == 1 ]; then
if [ "$__BuildOS" == "Linux" ]; then
if [ ! -e $ROOTFS_DIR/etc/os-release ]; then
- echo "WARNING: Can not determine runtime id for current distro."
- export __DistroRid=""
+ if [ -e $ROOTFS_DIR/android_platform ]; then
+ source $ROOTFS_DIR/android_platform
+ export __DistroRid="$RID"
+ else
+ echo "WARNING: Can not determine runtime id for current distro."
+ export __DistroRid=""
+ fi
else
source $ROOTFS_DIR/etc/os-release
export __DistroRid="$ID.$VERSION_ID-$__BuildArch"
@@ -484,7 +489,8 @@ generate_NugetPackages()
fi
echo "Generating nuget packages for "$__BuildOS
-
+ echo "DistroRid is "$__DistroRid
+ echo "ROOTFS_DIR is "$ROOTFS_DIR
# Build the packages
$__ProjectRoot/run.sh build -Project=$__SourceDir/.nuget/packages.builds -MsBuildLog="/flp:Verbosity=normal;LogFile=$__LogsDir/Nuget_$__BuildOS__$__BuildArch__$__BuildType.log" -BuildTarget -__IntermediatesDir=$__IntermediatesDir -__RootBinDir=$__RootBinDir -BuildNugetPackage=false -UseSharedCompilation=false $__RunArgs $__UnprocessedBuildArgs
diff --git a/config.json b/config.json
index a85dcd5ecd..8f3a58b8ec 100644
--- a/config.json
+++ b/config.json
@@ -51,7 +51,7 @@
"FilterToOSGroup": {
"description": "Specifies the OSGroup.",
"valueType": "property",
- "values": [ "Windows_NT", "Linux", "Unix", "OSX" ],
+ "values": [ "Windows_NT", "Linux", "Unix", "OSX", "Android" ],
"defaultValue": "${OSName}"
},
"RestoreNETCorePlatforms": {
@@ -93,7 +93,7 @@
"__BuildOS": {
"description": "Specifies the OS to publish packages.",
"valueType": "property",
- "values": [ "Linux", "OSX", "FreeBSD", "OpenBSD", "NetBSD", "SunOS", "Windows_NT" ],
+ "values": [ "Linux", "OSX", "FreeBSD", "OpenBSD", "NetBSD", "SunOS", "Windows_NT", "Android" ],
"defaultValue": "${OSName}"
},
"__DistroRid": {
@@ -357,7 +357,7 @@
"RuntimeId": {
"description": "Specifies the OS to build Core_Root for",
"valueType": "property",
- "values": [ "debian.8-x64", "fedora.24-x64", "fedora.25-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64" ],
+ "values": [ "debian.8-x64", "fedora.24-x64", "fedora.25-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64", "android.21-arm64" ],
"defaultValue": "${__RuntimeId}"
},
"BatchRestorePackages": {
diff --git a/cross/build-android-rootfs.sh b/cross/build-android-rootfs.sh
index 703083764c..636618c864 100755
--- a/cross/build-android-rootfs.sh
+++ b/cross/build-android-rootfs.sh
@@ -15,6 +15,7 @@ usage()
echo.
echo "By default, the NDK will be downloaded into the cross/android-rootfs/android-ndk-$__NDK_Version directory. If you already have an NDK installation,"
echo "you can set the NDK_DIR environment variable to have this script use that installation of the NDK."
+ echo "By default, this script will generate a file, android_platform, in the root of the ROOTFS_DIR directory that contains the RID for the supported and tested Android build: android.21-arm64. This file is to replace '/etc/os-release', which is not available for Android."
exit 1
}
@@ -136,7 +137,10 @@ dpkg -x $__Android_Cross_Dir/deb/libunwind_1.2.20170304_$__AndroidArch.deb $__An
cp -R $__Android_Cross_Dir/tmp/$__AndroidArch/data/data/com.termux/files/usr/* $__ToolchainDir/sysroot/usr/
+# Generate platform file for build.sh script to assign to __DistroRid
+echo "Generating platform file..."
+echo "RID=android.21-arm64" > $__ToolchainDir/sysroot/android_platform
echo Now run:
echo CONFIG_DIR=\`realpath cross/android/$__BuildArch\` ROOTFS_DIR=\`realpath $__ToolchainDir/sysroot\` ./build.sh cross $__BuildArch skipgenerateversion skipnuget cmakeargs -DENABLE_LLDBPLUGIN=0
diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props
index 5f244a911b..d62f4d645c 100644
--- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props
+++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props
@@ -6,7 +6,9 @@
<_PlatformDoesNotSupportCreatedump Condition="'$(Platform)' == 'x86'">true</_PlatformDoesNotSupportCreatedump>
<_PlatformDoesNotSupportCreatedump Condition="'$(_runtimeOSFamily)' == 'tizen'">true</_PlatformDoesNotSupportCreatedump>
<_PlatformDoesNotSupportEventTrace Condition="'$(_runtimeOSFamily)' == 'tizen'">true</_PlatformDoesNotSupportEventTrace>
+ <_PlatformDoesNotSupportEventTrace Condition="'$(Platform)' == 'arm64'">true</_PlatformDoesNotSupportEventTrace>
<_PlatformDoesNotSupportEventTrace Condition="'$(Platform)' == 'x86'">true</_PlatformDoesNotSupportEventTrace>
+ <_PlatformDoesNotSupportSosPlugin Condition="'$(_runtimeOSFamily)' == 'android'">true</_PlatformDoesNotSupportSosPlugin>
</PropertyGroup>
<ItemGroup>
<NativeBinary Include="$(BinDir)libcoreclr.so" />
@@ -15,7 +17,7 @@
<NativeBinary Include="$(BinDir)libmscordaccore.so" />
<NativeBinary Include="$(BinDir)libmscordbi.so" />
<NativeBinary Include="$(BinDir)libsos.so" />
- <NativeBinary Include="$(BinDir)libsosplugin.so" />
+ <NativeBinary Condition="'$(_PlatformDoesNotSupportSosPlugin)' != 'true'" Include="$(BinDir)libsosplugin.so" />
<NativeBinary Include="$(BinDir)System.Globalization.Native.so" />
<NativeBinary Include="$(BinDir)sosdocsunix.txt" />
<NativeBinary Include="$(BinDir)System.Private.CoreLib.dll" />
diff --git a/src/.nuget/dir.props b/src/.nuget/dir.props
index 2ff88d9bcf..52e94365dc 100644
--- a/src/.nuget/dir.props
+++ b/src/.nuget/dir.props
@@ -23,7 +23,7 @@
<RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS>
- <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Linux</SupportedPackageOSGroups>
+ <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux</SupportedPackageOSGroups>
<SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>
<!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or
@@ -38,6 +38,7 @@
<!-- derive an OS Group based on the OS Family -->
<PropertyGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'osx'">OSX</_derivedPackageTargetOSGroup>
+ <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'android'">Android</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(__BuildOS)' != ''">$(__BuildOS)</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>
@@ -48,9 +49,10 @@
<!-- _packageTargetOSGroup is used to control the runtime package imports, don't import runtime package targets for
an unsupported OS Group -->
<PropertyGroup Condition="'$(PackageTargetRuntime)' != '' and '$(_isSupportedOSGroup)' == 'true'">
+ <!-- Android will use Linux package definitions -->
<_packageTargetOSGroup>$(_derivedPackageTargetOSGroup)</_packageTargetOSGroup>
+ <_packageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == 'Android'">Linux</_packageTargetOSGroup>
</PropertyGroup>
-
<PropertyGroup>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<OutputPath>$(PackageOutputPath)</OutputPath>
@@ -81,6 +83,13 @@
<PackageRID Condition="'$(PortableBuild)' == 'true'">osx-$(ArchGroup)</PackageRID>
</PropertyGroup>
</When>
+ <When Condition="'$(_runtimeOSFamily)' == 'android'">
+ <PropertyGroup>
+ <PackageRID>android.21-$(ArchGroup)</PackageRID>
+ <!-- Set the platform part of the RID if we are doing a portable build -->
+ <PackageRID Condition="'$(PortableBuild)' == '1'">android-$(ArchGroup)</PackageRID>
+ </PropertyGroup>
+ </When>
<When Condition="'$(_runtimeOSFamily)' == 'rhel'">
<PropertyGroup>
<PackageRID>rhel.7-$(ArchGroup)</PackageRID>
@@ -106,6 +115,13 @@
<SymbolFileExtension>.dwarf</SymbolFileExtension>
</PropertyGroup>
</When>
+ <When Condition="'$(_runtimeOSFamily)' == 'android'">
+ <PropertyGroup>
+ <LibraryFileExtension>.so</LibraryFileExtension>
+ <!--symbols included in .so, like Linux, but can be generated externally and if so, uses .debug ext-->
+ <SymbolFileExtension>.debug</SymbolFileExtension>
+ </PropertyGroup>
+ </When>
<Otherwise>
<PropertyGroup>
<LibraryFileExtension>.so</LibraryFileExtension>
@@ -165,4 +181,4 @@
<!-- Include project references for a lineup package to generate the runtime.json file -->
<ProjectReference Include="@(_buildRidProjects)" />
</ItemGroup>
-</Project> \ No newline at end of file
+</Project>