From f6c4fc79207338d117f80ca8427034f30785eef3 Mon Sep 17 00:00:00 2001
From: Bruce Forstall <brucefo@microsoft.com>
Date: Fri, 5 Nov 2021 18:02:38 -0700
Subject: [PATCH 1/2] Remove jitutils tool wrapper scripts

---
 build.cmd            | 3 ---
 build.sh             | 6 ------
 src/pmi/PMIDriver.cs | 1 -
 wrapper.bat          | 2 --
 wrapper.sh           | 3 ---
 5 files changed, 15 deletions(-)
 delete mode 100644 wrapper.bat
 delete mode 100755 wrapper.sh

diff --git a/build.cmd b/build.cmd
index cbc62a0b..e3f9f6a5 100644
--- a/build.cmd
+++ b/build.cmd
@@ -57,9 +57,6 @@ for %%p in (%projects%) do (
     if %publish%==true (
         dotnet publish -c %buildType% -o %appInstallDir% .\src\%%p
         if errorlevel 1 echo ERROR: dotnet publish failed for .\src\%%p.&set __ExitCode=1
-
-        copy .\wrapper.bat %appInstallDir%\%%p.bat
-        if not exist %appInstallDir%\%%p.bat echo ERROR: Failed to copy wrapper script to %appInstallDir%\%%p.bat&set __ExitCode=1
     ) else (
         dotnet build -c %buildType% .\src\%%p
         if errorlevel 1 echo ERROR: dotnet build failed for .\src\%%p.&set __ExitCode=1
diff --git a/build.sh b/build.sh
index 70e60f08..d7260040 100755
--- a/build.sh
+++ b/build.sh
@@ -67,12 +67,6 @@ do
             echo "${__ErrMsgPrefix}dotnet publish of ./src/${proj} failed."
             final_exit_code=1
         fi
-
-        cp ./wrapper.sh $appInstallDir/$proj
-        if [ ! -f $appInstallDir/$proj ]; then
-            echo "Failed to copy wrapper script to $appInstallDir/$proj"
-            final_exit_code=1
-        fi
     else
         dotnet build -c $buildType ./src/$proj
         exit_code=$?
diff --git a/src/pmi/PMIDriver.cs b/src/pmi/PMIDriver.cs
index 74f44072..cdc60f95 100644
--- a/src/pmi/PMIDriver.cs
+++ b/src/pmi/PMIDriver.cs
@@ -185,7 +185,6 @@ private static PrepAllResult Compute(PrepAllInfo pi)
 
                 // If PMI is invoked as one of:
                 // 1. dotnet.exe pmi.dll DriveAll ...
-                //    (this is how the wrapper script `pmi.bat` invokes it)
                 // 2. corerun.exe pmi.dll DriveAll ...
                 // Then `driverName` will be either `dotnet.exe` or `corerun.exe` and the first argument in `newCommandLine` will be
                 // `pmi.dll`.
diff --git a/wrapper.bat b/wrapper.bat
deleted file mode 100644
index cdeaeb6b..00000000
--- a/wrapper.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@echo off
-dotnet.exe %~d0%~pn0.dll %*
diff --git a/wrapper.sh b/wrapper.sh
deleted file mode 100755
index fd456f77..00000000
--- a/wrapper.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-SOURCE=$BASH_SOURCE
-dotnet $SOURCE.dll "$@"

From f97671975bbc2f8c4fae3770a1d5264f9a741ab7 Mon Sep 17 00:00:00 2001
From: Bruce Forstall <brucefo@microsoft.com>
Date: Fri, 5 Nov 2021 18:27:32 -0700
Subject: [PATCH 2/2] Remove `src\packages` directory and build `-f` option

This is no longer necessary.
---
 .gitignore                   |  1 -
 bootstrap.cmd                |  4 ++--
 bootstrap.sh                 |  4 ++--
 build.cmd                    | 22 ----------------------
 build.sh                     | 34 +---------------------------------
 doc/config.md                |  4 ++--
 doc/diffs.md                 | 12 ------------
 jitutils.sln                 | 15 ---------------
 src/packages/README.md       |  6 ------
 src/packages/packages.cs     | 15 ---------------
 src/packages/packages.csproj | 10 ----------
 11 files changed, 7 insertions(+), 120 deletions(-)
 delete mode 100644 src/packages/README.md
 delete mode 100755 src/packages/packages.cs
 delete mode 100644 src/packages/packages.csproj

diff --git a/.gitignore b/.gitignore
index 8fcb5c43..50b95f30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,6 @@
 # ignore default binary/obj locations
 **/bin
 **/obj
-/fx
 .vscode
 
 # project system lock files
diff --git a/bootstrap.cmd b/bootstrap.cmd
index d748eef1..5ad77f0d 100644
--- a/bootstrap.cmd
+++ b/bootstrap.cmd
@@ -110,9 +110,9 @@ if not exist .\build.cmd echo Can't find build.cmd.&set __ExitCode=1&goto :eof
 dotnet restore
 if errorlevel 1 echo ERROR: dotnet restore failed.&set __ExitCode=1&goto :eof
 
-:: Build and publish all the utilties and frameworks
+:: Build and publish all the utilities
 
-call .\build.cmd -p -f
+call .\build.cmd -p
 if errorlevel 1 echo ERROR: build failed.&set __ExitCode=1&goto :eof
 
 :: Check to see if clang-format and clang-tidy are available. Since we're going
diff --git a/bootstrap.sh b/bootstrap.sh
index 9e22a85b..aa067a54 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -180,9 +180,9 @@ if [ $exit_code != 0 ]; then
     exit $exit_code
 fi
 
-# Build and publish all the utilties and frameworks
+# Build and publish all the utilities
 
-./build.sh -p -f
+./build.sh -p
 exit_code=$?
 if [ $exit_code != 0 ]; then
     echo "${__ErrMsgPrefix}Build failed."
diff --git a/build.cmd b/build.cmd
index e3f9f6a5..927a9d70 100644
--- a/build.cmd
+++ b/build.cmd
@@ -9,10 +9,8 @@ REM tools in <root>/src/<project>/bin/<platform>/<BuildType>/netcoreapp<version>
 
 set scriptDir=%~dp0
 set appInstallDir=%scriptDir%bin
-set fxInstallDir=%scriptDir%fx
 set buildType=Release
 set publish=false
-set fx=false
 
 for /f "usebackq tokens=1,2" %%a in (`dotnet --info`) do (
     if "%%a"=="RID:" set platform=%%b
@@ -26,10 +24,6 @@ if /i "%1"=="-b" (
     shift
     goto :nextArg
 )
-if /i "%1"=="-f" (
-    set fx=true
-    goto :nextArg
-)
 if /i "%1"=="-p" (
     set publish=true
     goto :nextArg
@@ -63,21 +57,6 @@ for %%p in (%projects%) do (
     )
 )
 
-if %fx%==true (
-    @REM Need to expicitly restore 'packages' project for host runtime in order
-    @REM for subsequent publish to be able to accept --runtime parameter to
-    @REM publish it as standalone.
-
-    dotnet restore --runtime %platform% .\src\packages
-    if errorlevel 1 echo ERROR: dotnet restore of .\src\packages failed.&set __ExitCode=1
-
-    dotnet publish -c %buildType% -o %fxInstallDir% --runtime %platform% .\src\packages
-    if errorlevel 1 echo ERROR: dotnet publish of .\src\packages failed.&set __ExitCode=1
-    
-    @REM remove package version of mscorlib* - refer to core root version for diff testing
-    if exist %fxInstallDir%\mscorlib* del /q %fxInstallDir%\mscorlib*
-)
-
 REM Done
 exit /b %__ExitCode%
 
@@ -87,7 +66,6 @@ echo  build.cmd [-b ^<BUILD TYPE^>] [-f] [-h] [-p]
 echo.
 echo      -b ^<BUILD TYPE^>   : Build type, can be Debug or Release.
 echo      -h                : Show this message.
-echo      -f                : Publish default framework directory in ^<script_root^>\fx.
 echo      -p                : Publish utilities.
 echo. 
 exit /b 1
diff --git a/build.sh b/build.sh
index d7260040..9932aa58 100755
--- a/build.sh
+++ b/build.sh
@@ -5,9 +5,6 @@
 ## This script will by default build release versions of the tools.
 ## If publish (-p) is requested it will create standalone versions of the
 ## tools in <script_root>/bin.
-## 
-## If frameworks (-f) are requested the script will create a scratch empty 'app'
-## publish that contains the default frameworks.
 
 function usage
 {
@@ -16,7 +13,6 @@ function usage
     echo ""
     echo "    -b <BUILD TYPE> : Build type, can be Debug or Release."
     echo "    -h              : Show this message."
-    echo "    -f              : Install default framework directory in <script_root>/fx."
     echo "    -p              : Publish utilities."
     echo ""
 }
@@ -33,9 +29,8 @@ cd $workingDir
 platform="`dotnet --info | awk '/RID/ {print $2}'`"
 # default install in 'bin' dir at script location
 appInstallDir="$scriptDir/bin"
-fxInstallDir="$scriptDir/fx"
 
-# process for '-h', '-p', 'f', '-b <arg>'
+# process for '-h', '-p', '-b <arg>'
 while getopts "hpfb:" opt; do
     case "$opt" in
     h)
@@ -48,9 +43,6 @@ while getopts "hpfb:" opt; do
     p)  
         publish=true
         ;;
-    f)  
-        fx=true
-        ;;
     esac
 done
 
@@ -77,28 +69,4 @@ do
     fi
 done
 
-# set up fx if requested.
-
-if [ "$fx" == true ]; then
-    # Need to explicitly restore 'packages' project for host runtime in order
-    # for subsequent publish to be able to accept --runtime parameter to publish
-    # it as standalone.
-    dotnet restore --runtime $platform ./src/packages
-    exit_code=$?
-    if [ $exit_code != 0 ]; then
-        echo "${__ErrMsgPrefix}dotnet restore of ./src/packages failed."
-        final_exit_code=1
-    fi
-
-    dotnet publish -c $buildType -o $fxInstallDir --runtime $platform ./src/packages
-    exit_code=$?
-    if [ $exit_code != 0 ]; then
-        echo "${__ErrMsgPrefix}dotnet publish of ./src/packages failed."
-        final_exit_code=1
-    fi
-
-    # remove package version of mscorlib* - refer to core root version for diff testing.
-    rm -f $fxInstallDir/mscorlib*
-fi
-
 exit $final_exit_code
diff --git a/doc/config.md b/doc/config.md
index ccd94a3e..250e9fd4 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -64,7 +64,7 @@ Sample config.json:
       "diff": "/Users/russellhadley/Work/dotnet/coreclr/bin/Product/OSX.x64.Checked",
       "frameworks": "true",
       "output": "/Users/russellhadley/Work/dotnet/output",
-      "core_root": "/Users/russellhadley/Work/dotnet/jitutils/fx"
+      "core_root": "/Users/russellhadley/Work/dotnet/runtime/artifacts/tests/coreclr/OSX.x64.Checked/Tests/Core_Root"
     },
     "tools": [
       {
@@ -101,7 +101,7 @@ Defaults:
 	base: checked_osx-1526
 	diff: /Users/russellhadley/Work/dotnet/coreclr/bin/Product/OSX.x64.Checked
 	output: /Users/russellhadley/Work/dotnet/output
-	core_root: /Users/russellhadley/Work/dotnet/jitutils/fx
+    core_root: /Users/russellhadley/Work/dotnet/runtime/artifacts/tests/coreclr/OSX.x64.Checked/Tests/Core_Root
 	frameworks: true
 
 Installed tools:
diff --git a/doc/diffs.md b/doc/diffs.md
index be964dff..65985405 100644
--- a/doc/diffs.md
+++ b/doc/diffs.md
@@ -58,7 +58,6 @@ build.sh [-b <BUILD TYPE>] [-f] [-h] [-p] [-t <TARGET>]
 
     -b <BUILD TYPE> : Build type, can be Debug or Release.
     -h              : Show this message.
-    -f              : Install default framework directory in <script_root>/fx.
     -p              : Publish utilities.
 ```
 
@@ -547,14 +546,3 @@ Sample help command line:
     <assembly>...              The list of assemblies or directories to
                                scan for assemblies.
 ```
-
-## packages
-
-This is a skeleton project that exists to pull down a predictable set of framework 
-assemblies and publish them in the root in the subdirectory './fx'.
-When this package is installed 
-via the `build.{cmd|sh}` script this set can be used on any supported platform for 
-diffing.  Note: The mscorlib.dll is removed, as this assembly should be updated from 
-the selected base runtime that is under test, for consistency. To add particular packages 
-to the set you diff, add their dependencies to the project.json in this project and 
-they will be pulled in and published in the standalone directory './fx'.
diff --git a/jitutils.sln b/jitutils.sln
index 965982e6..3a950933 100644
--- a/jitutils.sln
+++ b/jitutils.sln
@@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jit-diff", "src\jit-diff\ji
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jit-format", "src\jit-format\jit-format.csproj", "{37E93DAF-2993-4DF0-9E82-06817A3B7956}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "packages", "src\packages\packages.csproj", "{19436C6B-39C9-4A88-8021-3242D098637E}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "pmi", "src\pmi\pmi.csproj", "{829E459B-EE3D-46A9-AD4D-4F2B03D5188C}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jit-dasm-pmi", "src\jit-dasm-pmi\jit-dasm-pmi.csproj", "{2C846294-79D4-40EA-8ED3-0F01E033BE32}"
@@ -95,18 +93,6 @@ Global
 		{37E93DAF-2993-4DF0-9E82-06817A3B7956}.Release|x64.Build.0 = Release|Any CPU
 		{37E93DAF-2993-4DF0-9E82-06817A3B7956}.Release|x86.ActiveCfg = Release|Any CPU
 		{37E93DAF-2993-4DF0-9E82-06817A3B7956}.Release|x86.Build.0 = Release|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Debug|x64.Build.0 = Debug|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Debug|x86.Build.0 = Debug|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Release|x64.ActiveCfg = Release|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Release|x64.Build.0 = Release|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Release|x86.ActiveCfg = Release|Any CPU
-		{19436C6B-39C9-4A88-8021-3242D098637E}.Release|x86.Build.0 = Release|Any CPU
 		{829E459B-EE3D-46A9-AD4D-4F2B03D5188C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{829E459B-EE3D-46A9-AD4D-4F2B03D5188C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{829E459B-EE3D-46A9-AD4D-4F2B03D5188C}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -165,7 +151,6 @@ Global
 		{C4C9F6AA-A360-4B27-A8E8-AB55FC383614} = {69D45FDC-948D-464B-BF14-5675F291FC62}
 		{928320EE-2058-446D-A46E-6C795BBE7C68} = {69D45FDC-948D-464B-BF14-5675F291FC62}
 		{37E93DAF-2993-4DF0-9E82-06817A3B7956} = {69D45FDC-948D-464B-BF14-5675F291FC62}
-		{19436C6B-39C9-4A88-8021-3242D098637E} = {69D45FDC-948D-464B-BF14-5675F291FC62}
 		{829E459B-EE3D-46A9-AD4D-4F2B03D5188C} = {69D45FDC-948D-464B-BF14-5675F291FC62}
 		{2C846294-79D4-40EA-8ED3-0F01E033BE32} = {69D45FDC-948D-464B-BF14-5675F291FC62}
 		{59FB3663-C16C-4C3B-90A7-AF7259C8A39B} = {69D45FDC-948D-464B-BF14-5675F291FC62}
diff --git a/src/packages/README.md b/src/packages/README.md
deleted file mode 100644
index 80d42f15..00000000
--- a/src/packages/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# packages - Empty project with simplified project.json that exists to pull in a set of framework assemblies that can be used for diffing.
-
-To restore do:
-```
-    dotnet restore ./src/packages
-```
\ No newline at end of file
diff --git a/src/packages/packages.cs b/src/packages/packages.cs
deleted file mode 100755
index 776253e7..00000000
--- a/src/packages/packages.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-﻿using System;
-using System.IO;
-
-namespace ManagedCodeGen
-{
-    public class packages
-    {
-        public static void Main(string[] args)
-        {
-            Console.WriteLine("This project exsits only to pull in a particular set of " +
-                              "dependencies for diffing.  See the corediff tool for the " +
-                              "list of framework assembles used");
-        }
-    }
-}
diff --git a/src/packages/packages.csproj b/src/packages/packages.csproj
deleted file mode 100644
index 8b8d4197..00000000
--- a/src/packages/packages.csproj
+++ /dev/null
@@ -1,10 +0,0 @@
-﻿<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
-  </PropertyGroup>
-
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(target-framework.props))" />
-
-</Project>
