Pre-consolidation mop-up fixes part 2 (mostly path shuffles) (dotnet/coreclr#27777)
authorTomáš Rylek <trylek@microsoft.com>
Sat, 9 Nov 2019 07:30:49 +0000 (23:30 -0800)
committerGitHub <noreply@github.com>
Sat, 9 Nov 2019 07:30:49 +0000 (23:30 -0800)
(*) Clean up CoreCLR / root repo considerations in gen-buildsys.sh
(*) Move tryrun.cmake to the root; adjust gen-buildsys.sh accordingly

Commit migrated from https://github.com/dotnet/coreclr/commit/889a1a1abd7dfa4c95c7c5b7455b48c464f03139

eng/pipelines/coreclr/templates/build-job.yml
eng/pipelines/coreclr/templates/build-test-job.yml
eng/pipelines/coreclr/templates/job.yml
src/coreclr/build-test.sh
src/coreclr/build.sh
src/coreclr/src/pal/tools/gen-buildsys.sh
src/coreclr/tryrun.cmake [moved from src/coreclr/src/pal/tools/tryrun.cmake with 100% similarity]

index 367baff..f80391d 100644 (file)
@@ -98,7 +98,7 @@ jobs:
     # and FreeBSD builds use a build agent with dependencies
     # preinstalled, so we only need this step for OSX and Windows.
     - ${{ if eq(parameters.osGroup, 'OSX') }}:
-      - script: sh $(coreClrRepoRoot)/eng/install-native-dependencies.sh $(osGroup)
+      - script: sh $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
         displayName: Install native dependencies
     - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
       # Necessary to install python
index 5347978..880ee29 100644 (file)
@@ -63,7 +63,7 @@ jobs:
 
     # Install test build dependencies
     - ${{ if eq(parameters.osGroup, 'OSX') }}:
-      - script: sh $(coreClrRepoRootDir)eng/install-native-dependencies.sh $(osGroup)
+      - script: sh $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
         displayName: Install native dependencies
     - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
       # Necessary to install correct cmake version
index 757eb87..ecebd0f 100644 (file)
@@ -119,8 +119,7 @@ jobs:
         itemPattern: ${{ coalesce(parameters.artifacts.download.pattern, '**') }}
 
   - ${{ each step in parameters.steps }}:
-    - ${{ if ne(step, '') }}:
-      - ${{ step }}
+    - ${{ step }}
 
   - ${{ if eq(parameters.enableMicrobuild, 'true') }}:
     - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
index 6840ef1..9c1ea07 100755 (executable)
@@ -548,7 +548,7 @@ build_native_projects()
         __versionSourceFile="$intermediatesForBuild/version.c"
         if [ $__SkipGenerateVersion == 0 ]; then
             pwd
-            $__RepoRootDir/eng/common/msbuild.sh $__ProjectRoot/eng/empty.csproj \
+            $__RepoRootDir/eng/common/msbuild.sh $__RepoRootDir/eng/empty.csproj \
                                                  /p:NativeVersionFile=$__versionSourceFile \
                                                  /t:GenerateNativeVersionFile /restore \
                                                  $__CommonMSBuildArgs $__UnprocessedBuildArgs
@@ -580,7 +580,7 @@ build_native_projects()
             extraCmakeArguments="$extraCmakeArguments -DCLR_CMAKE_ENABLE_CODE_COVERAGE=1"
         fi
 
-        nextCommand="CONFIG_DIR=\"$__RepoRootDir/eng/common/cross\" \"$scriptDir/gen-buildsys.sh\" \"$__TestDir\" \"$intermediatesForBuild\" $platformArch $__BuildType $generator $extraCmakeArguments $__cmakeargs"
+        nextCommand="\"$scriptDir/gen-buildsys.sh\" \"$__TestDir\" \"$intermediatesForBuild\" $platformArch $__BuildType $generator $extraCmakeArguments $__cmakeargs"
         echo "Invoking $nextCommand"
         eval $nextCommand
         
index c2faf17..290bb9b 100755 (executable)
@@ -273,7 +273,7 @@ build_native()
             extraCmakeArguments="$extraCmakeArguments -DCLR_CMAKE_ENABLE_CODE_COVERAGE=1"
         fi
 
-        nextCommand="CONFIG_DIR=\"$__RepoRootDir/eng/common/cross\" \"$scriptDir/gen-buildsys.sh\" \"$__ProjectRoot\" \"$intermediatesForBuild\" $platformArch $__BuildType $generator $scan_build $extraCmakeArguments $__cmakeargs"
+        nextCommand="\"$scriptDir/gen-buildsys.sh\" \"$__ProjectRoot\" \"$intermediatesForBuild\" $platformArch $__BuildType $generator $scan_build $extraCmakeArguments $__cmakeargs"
         echo "Invoking $nextCommand"
         eval $nextCommand
     
index 5e34f3d..41c49f0 100755 (executable)
@@ -30,6 +30,15 @@ then
   exit 1
 fi
 
+__CoreClrDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../.."
+__RepoRootDir=${__CoreClrDir}/../..
+
+# BEGIN SECTION to remove after repo consolidation
+if [ ! -f "${__RepoRootDir}/.dotnet-runtime-placeholder" ]; then
+  __RepoRootDir=${__CoreClrDir}
+fi
+# END SECTION to remove after repo consolidation
+
 build_arch="$3"
 buildtype=DEBUG
 code_coverage=OFF
@@ -65,12 +74,9 @@ if [ "$CROSSCOMPILE" == "1" ]; then
         echo "ROOTFS_DIR not set for crosscompile"
         exit 1
     fi
-    if [[ -z $CONFIG_DIR ]]; then
-        CONFIG_DIR="$1/eng/common/cross"
-    fi
     export TARGET_BUILD_ARCH=$build_arch
-    cmake_extra_defines="$cmake_extra_defines -C $scriptroot/tryrun.cmake"
-    cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$CONFIG_DIR/toolchain.cmake"
+    cmake_extra_defines="$cmake_extra_defines -C ${__CoreClrDir}/tryrun.cmake"
+    cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=${__RepoRootDir}/eng/common/cross/toolchain.cmake"
 fi
 
 cmake_command=$(command -v cmake)