From 465fd1d2ab4bf3ed088ad07362696908c89ef50d Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Mon, 3 Dec 2018 14:51:28 -0800 Subject: [PATCH] Remove Hostx86/arm CrossGen from building and Simplify build.sh command line arguments for Linux/arm cross build (Part 2) (dotnet/coreclr#21034) * Stop building and publishing Hostx86/arm crossgen on Linux/arm * Remove -crosscomponent argument and stop using CAC_ROOTFS_DIR environment variable in build.sh * Simplify the related logic in build.sh * Don't need to specify crosscomponent in tests/scripts/run-pmi-diffs.py * Don't set CAC_ROOTFS_DIR in buildpipeline, Jenkins files and in tests/scripts/run-pmi-diffs.py * Adjust documentation Commit migrated from https://github.com/dotnet/coreclr/commit/20c6bc555319aa635e0e490c82aebf0bb370d6c1 --- docs/coreclr/building/linux-instructions.md | 2 +- src/coreclr/build.sh | 51 +++------------------- .../DotNet-CoreClr-Trusted-Linux-Crossbuild.json | 6 +-- src/coreclr/buildpipeline/pipelines.json | 4 +- src/coreclr/dir.props | 2 - src/coreclr/netci.groovy | 7 +-- src/coreclr/perf.groovy | 3 +- .../runtime.Linux.Microsoft.NETCore.Jit.props | 1 - ...e.Linux.Microsoft.NETCore.Runtime.CoreCLR.props | 1 - src/coreclr/src/.nuget/dir.targets | 9 ---- src/coreclr/tests/scripts/run-pmi-diffs.py | 4 +- 11 files changed, 14 insertions(+), 76 deletions(-) diff --git a/docs/coreclr/building/linux-instructions.md b/docs/coreclr/building/linux-instructions.md index 5f68791..cd22b6b 100644 --- a/docs/coreclr/building/linux-instructions.md +++ b/docs/coreclr/building/linux-instructions.md @@ -121,7 +121,7 @@ The CI system and official builds use Docker to build ARM for Linux (for example ``` ROOT=/Users/me/git/coreclr -DOCKER_ARGS="run -i --rm -v ${ROOT}:/mnt/coreclr -w /mnt/coreclr -e ROOTFS_DIR=/crossrootfs/arm -e CAC_ROOTFS_DIR=/crossrootfs/x86 microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-e435274-20180426002420" +DOCKER_ARGS="run -i --rm -v ${ROOT}:/mnt/coreclr -w /mnt/coreclr -e ROOTFS_DIR=/crossrootfs/arm microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-e435274-20180426002420" docker ${DOCKER_ARGS} /mnt/coreclr/build.sh arm checked cross docker ${DOCKER_ARGS} /mnt/coreclr/build-test.sh arm checked cross generatelayoutonly ``` diff --git a/src/coreclr/build.sh b/src/coreclr/build.sh index e9b5d06..7e3f5bf 100755 --- a/src/coreclr/build.sh +++ b/src/coreclr/build.sh @@ -13,7 +13,6 @@ if [ "$PYTHON" == "" ] ; then exit 1 fi fi - # validate python-dependency # useful in case of explicitly set option. if ! command -v $PYTHON > /dev/null @@ -337,10 +336,8 @@ build_native() build_cross_architecture_components() { - local crossArch="$1" - - local intermediatesForBuild="$__IntermediatesDir/Host$crossArch/crossgen" - local crossArchBinDir="$__BinDir/$crossArch" + local intermediatesForBuild="$__IntermediatesDir/Host$__CrossArch/crossgen" + local crossArchBinDir="$__BinDir/$__CrossArch" mkdir -p "$intermediatesForBuild" mkdir -p "$crossArchBinDir" @@ -348,21 +345,10 @@ build_cross_architecture_components() generate_event_logging_sources "$intermediatesForBuild" "the crossarch build system" __SkipCrossArchBuild=1 - TARGET_ROOTFS="" # check supported cross-architecture components host(__HostArch)/target(__BuildArch) pair - if [[ ("$__BuildArch" == "arm" || "$__BuildArch" == "armel") && "$crossArch" == "x86" ]]; then - export CROSSCOMPILE=0 + if [[ ("$__BuildArch" == "arm" || "$__BuildArch" == "armel") && ("$__CrossArch" == "x86" || "$__CrossArch" == "x64") ]]; then __SkipCrossArchBuild=0 - - # building x64-host/arm-target cross-architecture component need to use cross toolchain of x86 - if [ "$__HostArch" == "x64" ]; then - export CROSSCOMPILE=1 - fi - elif [[ ("$__BuildArch" == "arm64") && "$crossArch" == "x64" ]]; then - export CROSSCOMPILE=0 - __SkipCrossArchBuild=0 - elif [[ ("$__BuildArch" == "arm" || "$__BuildArch" == "armel") && "$crossArch" == "x64" ]]; then - export CROSSCOMPILE=0 + elif [[ "$__BuildArch" == "arm64" && "$__CrossArch" == "x64" ]]; then __SkipCrossArchBuild=0 else # not supported @@ -370,24 +356,11 @@ build_cross_architecture_components() fi export __CMakeBinDir="$crossArchBinDir" - export CROSSCOMPONENT=1 - - if [ $CROSSCOMPILE == 1 ]; then - TARGET_ROOTFS="$ROOTFS_DIR" - if [ -n "$CAC_ROOTFS_DIR" ]; then - export ROOTFS_DIR="$CAC_ROOTFS_DIR" - else - export ROOTFS_DIR="$__ProjectRoot/cross/rootfs/$__CrossArch" - fi - fi + export CROSSCOMPILE=0 __ExtraCmakeArgs="-DCLR_CMAKE_TARGET_ARCH=$__BuildArch -DCLR_CMAKE_TARGET_OS=$__BuildOS -DCLR_CMAKE_PACKAGES_DIR=$__PackagesDir -DCLR_CMAKE_PGO_INSTRUMENT=$__PgoInstrument -DCLR_CMAKE_OPTDATA_VERSION=$__PgoOptDataVersion -DCLR_CMAKE_PGO_OPTIMIZE=$__PgoOptimize -DCLR_CROSS_COMPONENTS_BUILD=1" - build_native $__SkipCrossArchBuild "$crossArch" "$intermediatesForBuild" "$__ExtraCmakeArgs" "cross-architecture components" + build_native $__SkipCrossArchBuild "$__CrossArch" "$intermediatesForBuild" "$__ExtraCmakeArgs" "cross-architecture components" - # restore ROOTFS_DIR and CROSSCOMPILE - if [ -n "$TARGET_ROOTFS" ]; then - export ROOTFS_DIR="$TARGET_ROOTFS" - fi export CROSSCOMPILE=1 } @@ -840,11 +813,6 @@ while :; do __SkipCoreCLR=1 ;; - crosscomponent|-crosscomponent) - # Accept "crosscomponent" for backward-compatibility but ignore it. - echo "WARNING: 'crosscomponent' is obsolete and should not be used" - ;; - skipmanaged|-skipmanaged) __SkipManaged=1 ;; @@ -1049,12 +1017,7 @@ build_native $__SkipCoreCLR "$__BuildArch" "$__IntermediatesDir" "$__ExtraCmakeA # Build cross-architecture components if [[ $__CrossBuild == 1 ]]; then - build_cross_architecture_components "$__CrossArch" - - # For now, continue building Hostx86/arm crossgen - if [[ "$__HostArch" == "x64" && "$__BuildArch" == "arm" ]]; then - build_cross_architecture_components "x86" - fi + build_cross_architecture_components fi # Build System.Private.CoreLib. diff --git a/src/coreclr/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json b/src/coreclr/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json index 4538fb5..c39362c 100644 --- a/src/coreclr/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json +++ b/src/coreclr/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json @@ -179,7 +179,7 @@ }, "inputs": { "filename": "docker", - "arguments": "run --rm -e ROOTFS_DIR=$(ROOTFS_DIR) -e CAC_ROOTFS_DIR=$(CAC_ROOTFS_DIR) $(DockerCommonRunArgs) ./build.sh $(PB_BuildType) $(Architecture) skipnuget cross -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /flp:\"v=diag\"", + "arguments": "run --rm -e ROOTFS_DIR=$(ROOTFS_DIR) $(DockerCommonRunArgs) ./build.sh $(PB_BuildType) $(Architecture) skipnuget cross -skiprestore stripSymbols -OfficialBuildId=$(OfficialBuildId) -- /flp:\"v=diag\"", "workingFolder": "", "failOnStandardError": "false" } @@ -520,10 +520,6 @@ "ROOTFS_DIR": { "value": "/crossrootfs/$(Architecture)" }, - "CAC_ROOTFS_DIR": { - "value": "", - "allowOverride": true - }, "DockerVolumeName": { "value": "coreclr-cross-$(Build.BuildId)" }, diff --git a/src/coreclr/buildpipeline/pipelines.json b/src/coreclr/buildpipeline/pipelines.json index 6f6e076..8c618c1 100644 --- a/src/coreclr/buildpipeline/pipelines.json +++ b/src/coreclr/buildpipeline/pipelines.json @@ -148,9 +148,7 @@ "DockerTag": "ubuntu-14.04-cross-e435274-20180426002420", "Architecture": "arm", "Rid": "linux", - "CrossArchitecture": "x86", - "CrossArchBuildPackagesArgs": "-__DoCrossArchBuild=1", - "CAC_ROOTFS_DIR": "/crossrootfs/$(CrossArchitecture)" + "CrossArchBuildPackagesArgs": "-__DoCrossArchBuild=1" }, "ReportingParameters": { "OperatingSystem": "Linux", diff --git a/src/coreclr/dir.props b/src/coreclr/dir.props index b9ebad4..06cec2a 100644 --- a/src/coreclr/dir.props +++ b/src/coreclr/dir.props @@ -164,8 +164,6 @@ x64 x86 x64 - <_HasObsoleteCrossTargetComponents Condition="'$(TargetsLinux)' == 'true' and '$(PackagePlatform)' =='arm' and '$(__DoCrossArchBuild)' == '1'">true - <_ObsoleteCrossTargetComponentFolder Condition="'$(PackagePlatform)' == 'arm'">x86 $(PackagesBinDir)/pkg/ $(PackagesBinDir)/symbolpkg/ diff --git a/src/coreclr/netci.groovy b/src/coreclr/netci.groovy index 2de56bb..b8016e7 100755 --- a/src/coreclr/netci.groovy +++ b/src/coreclr/netci.groovy @@ -2508,11 +2508,6 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR // Add some useful information to the log file. Ignore return codes. buildCommands += "uname -a || true" - def additionalOpts = "" - if (architecture == 'arm') { - additionalOpts = "-e CAC_ROOTFS_DIR=/crossrootfs/x86" - } - // Cross build the Ubuntu/arm product using docker with a docker image that contains the correct // Ubuntu cross-compilation toolset (running on a Ubuntu x64 host). // For CoreFX testing, we only need the product build; we don't need to generate the layouts. The product @@ -2520,7 +2515,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR // ZIP up the generated CoreFX runtime and tests. def dockerImage = getDockerImageName(architecture, os, true) - def dockerCmd = "docker run -i --rm -v \${WORKSPACE}:\${WORKSPACE} -w \${WORKSPACE} -e ROOTFS_DIR=/crossrootfs/${architecture} ${additionalOpts} ${dockerImage} " + def dockerCmd = "docker run -i --rm -v \${WORKSPACE}:\${WORKSPACE} -w \${WORKSPACE} -e ROOTFS_DIR=/crossrootfs/${architecture} ${dockerImage} " buildCommands += "${dockerCmd}\${WORKSPACE}/build.sh ${lowerConfiguration} ${architecture} cross" diff --git a/src/coreclr/perf.groovy b/src/coreclr/perf.groovy index 9e932de..ac7222d 100644 --- a/src/coreclr/perf.groovy +++ b/src/coreclr/perf.groovy @@ -463,9 +463,8 @@ def static getFullThroughputJobName(def project, def os, def arch, def isPR) { python = "python3.6" def buildCommands = [] def newBuildJob = job(fullBuildJobName) { - def additionalOpts = "-e CAC_ROOTFS_DIR=/crossrootfs/x86" def dockerImage = getDockerImageName(architecture, 'Ubuntu', true) - def dockerCmd = "docker run -i --rm -v \${WORKSPACE}:\${WORKSPACE} -w \${WORKSPACE} -e ROOTFS_DIR=/crossrootfs/${architecture} ${additionalOpts} ${dockerImage} " + def dockerCmd = "docker run -i --rm -v \${WORKSPACE}:\${WORKSPACE} -w \${WORKSPACE} -e ROOTFS_DIR=/crossrootfs/${architecture} ${dockerImage} " buildCommands += "${dockerCmd}\${WORKSPACE}/build.sh release ${architecture} cross" diff --git a/src/coreclr/src/.nuget/Microsoft.NETCore.Jit/runtime.Linux.Microsoft.NETCore.Jit.props b/src/coreclr/src/.nuget/Microsoft.NETCore.Jit/runtime.Linux.Microsoft.NETCore.Jit.props index 6414d06..b00b1d0 100644 --- a/src/coreclr/src/.nuget/Microsoft.NETCore.Jit/runtime.Linux.Microsoft.NETCore.Jit.props +++ b/src/coreclr/src/.nuget/Microsoft.NETCore.Jit/runtime.Linux.Microsoft.NETCore.Jit.props @@ -3,6 +3,5 @@ - <_ObsoleteCrossArchitectureSpecificNativeFileAndSymbol Condition="'$(_HasObsoleteCrossTargetComponents)' == 'true'" Include="$(BinDir)$(_ObsoleteCrossTargetComponentFolder)\libclrjit.so" /> diff --git a/src/coreclr/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props b/src/coreclr/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props index 00277d7..f618a4f 100644 --- a/src/coreclr/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props +++ b/src/coreclr/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Linux.Microsoft.NETCore.Runtime.CoreCLR.props @@ -26,6 +26,5 @@ - <_ObsoleteCrossArchitectureSpecificToolFile Condition="'$(_HasObsoleteCrossTargetComponents)' == 'true'" Include="$(BinDir)$(_ObsoleteCrossTargetComponentFolder)\crossgen" /> diff --git a/src/coreclr/src/.nuget/dir.targets b/src/coreclr/src/.nuget/dir.targets index 20a8430..4d4883b 100644 --- a/src/coreclr/src/.nuget/dir.targets +++ b/src/coreclr/src/.nuget/dir.targets @@ -39,15 +39,6 @@ - - - runtimes/$(_ObsoleteCrossTargetComponentFolder)_$(Platform)/native - - - tools/$(_ObsoleteCrossTargetComponentFolder)_$(Platform) - - - diff --git a/src/coreclr/tests/scripts/run-pmi-diffs.py b/src/coreclr/tests/scripts/run-pmi-diffs.py index 6033ed9..acf15fc 100644 --- a/src/coreclr/tests/scripts/run-pmi-diffs.py +++ b/src/coreclr/tests/scripts/run-pmi-diffs.py @@ -44,7 +44,7 @@ Jitutils_url = 'https://github.com/dotnet/jitutils.git' # The Docker file and possibly options should be hoisted out to a text file to be shared between scripts. Docker_name_arm32 = 'microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-e435274-20180426002420' -Docker_opts_arm32 = '-e ROOTFS_DIR=/crossrootfs/arm -e CAC_ROOTFS_DIR=/crossrootfs/x86' +Docker_opts_arm32 = '-e ROOTFS_DIR=/crossrootfs/arm' Docker_name_arm64 = 'microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921' Docker_opts_arm64 = '-e ROOTFS_DIR=/crossrootfs/arm64' @@ -313,7 +313,7 @@ def baseline_build(): dockerOpts = Docker_opts_arm64 dockerCmd = 'docker run -i --rm -v %s:%s -w %s %s %s ' % (baseCoreClrPath, baseCoreClrPath, baseCoreClrPath, dockerOpts, dockerFile) - buildOpts = 'cross crosscomponent' + buildOpts = 'cross' scriptPath = baseCoreClrPath # Build a checked baseline jit -- 2.7.4