Skip to content

Commit

Permalink
Cleanup jitutils build (#343)
Browse files Browse the repository at this point in the history
* Remove jitutils tool wrapper scripts

* Remove `src\packages` directory and build `-f` option

This is no longer necessary.
  • Loading branch information
BruceForstall authored Nov 8, 2021
1 parent bf35492 commit fdf42ea
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 135 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# ignore default binary/obj locations
**/bin
**/obj
/fx
.vscode

# project system lock files
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,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."
Expand Down
25 changes: 0 additions & 25 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -57,30 +51,12 @@ 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
)
)

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%

Expand All @@ -90,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
40 changes: 1 addition & 39 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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 ""
}
Expand All @@ -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)
Expand All @@ -48,9 +43,6 @@ while getopts "hpfb:" opt; do
p)
publish=true
;;
f)
fx=true
;;
esac
done

Expand All @@ -67,12 +59,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=$?
Expand All @@ -83,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
4 changes: 2 additions & 2 deletions doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 0 additions & 12 deletions doc/diffs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
```

Expand Down Expand Up @@ -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'.
15 changes: 0 additions & 15 deletions jitutils.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
6 changes: 0 additions & 6 deletions src/packages/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions src/packages/packages.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/packages/packages.csproj

This file was deleted.

1 change: 0 additions & 1 deletion src/pmi/PMIDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 0 additions & 2 deletions wrapper.bat

This file was deleted.

3 changes: 0 additions & 3 deletions wrapper.sh

This file was deleted.

0 comments on commit fdf42ea

Please sign in to comment.