From ccc7fd77f25579edab2f6b2255e7016186ab26fe Mon Sep 17 00:00:00 2001 From: Alex Thibodeau Date: Thu, 28 Oct 2021 13:08:29 -0400 Subject: [PATCH 1/4] Calling build.cmd would exit early it appears so needed to call build.ps1 directly instead to keep the artifact copying. --- .yamato/scripts/build_win.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.yamato/scripts/build_win.bat b/.yamato/scripts/build_win.bat index 7cb15792509d51..79ebdc83e32d3f 100644 --- a/.yamato/scripts/build_win.bat +++ b/.yamato/scripts/build_win.bat @@ -1,5 +1,8 @@ @echo off -build.cmd -subset clr -a x64 -c release +setlocal + + +powershell -ExecutionPolicy ByPass -NoProfile -Command "& 'eng\build.ps1'" -subset clr -a x64 -c release if NOT %errorlevel% == 0 ( echo "build failed" From 36c864807cc09362c7217f27ff3a93adb1488ef7 Mon Sep 17 00:00:00 2001 From: Alex Thibodeau Date: Fri, 29 Oct 2021 16:41:45 -0400 Subject: [PATCH 2/4] Build script updates * Trigger current yamato targets on PRs so at least something runs :-) * Add classlib building. Currently leverages perl but not enthusiastic about it. --- .yamato/build_classlibs_win.yml | 20 ++++++++++++++++++++ .yamato/build_windows_x64.yml | 6 ++++++ .yamato/scripts/build_classlibs.pl | 25 +++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .yamato/build_classlibs_win.yml create mode 100644 .yamato/scripts/build_classlibs.pl diff --git a/.yamato/build_classlibs_win.yml b/.yamato/build_classlibs_win.yml new file mode 100644 index 00000000000000..d81ebeabe078b8 --- /dev/null +++ b/.yamato/build_classlibs_win.yml @@ -0,0 +1,20 @@ +name: Build Classlibs Windows + +agent: + type: Unity::VM + image: platform-foundation/windows-vs2019-il2cpp-bokken:stable + flavor: b1.xlarge + +commands: + - perl .yamato/scripts/build_classlibs.pl + +triggers: + pull_requests: + - targets: + only: + - "unity-main" + +artifacts: + win64: + paths: + - incomingbuilds\** \ No newline at end of file diff --git a/.yamato/build_windows_x64.yml b/.yamato/build_windows_x64.yml index 2f230462b05917..e7679a0efab9d5 100644 --- a/.yamato/build_windows_x64.yml +++ b/.yamato/build_windows_x64.yml @@ -8,6 +8,12 @@ agent: commands: - .yamato/scripts/build_win.bat +triggers: + pull_requests: + - targets: + only: + - "unity-main" + artifacts: win64: paths: diff --git a/.yamato/scripts/build_classlibs.pl b/.yamato/scripts/build_classlibs.pl new file mode 100644 index 00000000000000..76fad4ce4b1b26 --- /dev/null +++ b/.yamato/scripts/build_classlibs.pl @@ -0,0 +1,25 @@ +use strict; +use warnings; +use File::Copy::Recursive qw(dircopy); +use Cwd qw(); + +my $path = Cwd::cwd(); +print("cwsd: $path\n"); + +unless (-e "incomingbuilds" or mkdir("incomingbuilds")) +{ + die "Unable to create directory incomingbuilds"; +} + +my @hostPlatforms = ("windows", "OSX", "Linux"); + +foreach my $hostPlatform(@hostPlatforms) +{ + system ("build.cmd", "libs", "-os $hostPlatform", "-c release") eq 0 or die ("Failed to make $hostPlatform host platform class libraries\n"); + + dircopy ("artifacts/bin/runtime/net7.0-$hostPlatform-Release-x64", "incomingbuilds/coreclrjit-$hostPlatform") or die $!; + + system ("taskkill", "/IM", "\"dotnet.exe\"", "/F"); + + system ("build.cmd", "-clean"); +} \ No newline at end of file From e762aa9559bad2c70b255fd700aaf5f6b2c33be5 Mon Sep 17 00:00:00 2001 From: Alex Thibodeau Date: Tue, 2 Nov 2021 11:54:52 -0400 Subject: [PATCH 3/4] Switching from perl to batch script to build the classlibs --- .yamato/build_classlibs_win.yml | 2 +- .yamato/scripts/build_classlibs.bat | 20 ++++++++++++++++++++ .yamato/scripts/build_classlibs.pl | 25 ------------------------- 3 files changed, 21 insertions(+), 26 deletions(-) create mode 100644 .yamato/scripts/build_classlibs.bat delete mode 100644 .yamato/scripts/build_classlibs.pl diff --git a/.yamato/build_classlibs_win.yml b/.yamato/build_classlibs_win.yml index d81ebeabe078b8..e9981dbe0e6481 100644 --- a/.yamato/build_classlibs_win.yml +++ b/.yamato/build_classlibs_win.yml @@ -6,7 +6,7 @@ agent: flavor: b1.xlarge commands: - - perl .yamato/scripts/build_classlibs.pl + - .yamato/scripts/build_classlibs.bat triggers: pull_requests: diff --git a/.yamato/scripts/build_classlibs.bat b/.yamato/scripts/build_classlibs.bat new file mode 100644 index 00000000000000..ba238dff2edfe5 --- /dev/null +++ b/.yamato/scripts/build_classlibs.bat @@ -0,0 +1,20 @@ +@echo OFF + +if not exist "incomingbuilds" mkdir "incomingbuilds" + +for %%x IN ("windows", "OSX", "Linux") do ( + ECHO build.cmd libs -os %%x -c release + build.cmd libs -os %%x -c release + if NOT %errorlevel% == 0 ( + echo "build failed" + EXIT /B %errorlevel% + ) + if not exist "incomingbuilds/coreclrjit-%%x" mkdir "incomingbuilds/coreclrjit-%%x" + ECHO xcopy /s /e /h /y "artifacts/bin/runtime/net7.0-%%x-Release-x64" "incomingbuilds/coreclrjit-%%x" + xcopy /s /e /h /y "artifacts/bin/runtime/net7.0-%%x-Release-x64" "incomingbuilds/coreclrjit-%%x" + ECHO taskkill /IM "dotnet.exe" /F + taskkill /IM "dotnet.exe" /F + echo build.cmd -clean + build.cmd -clean +) +EXIT /B %ERRORLEVEL% \ No newline at end of file diff --git a/.yamato/scripts/build_classlibs.pl b/.yamato/scripts/build_classlibs.pl deleted file mode 100644 index 76fad4ce4b1b26..00000000000000 --- a/.yamato/scripts/build_classlibs.pl +++ /dev/null @@ -1,25 +0,0 @@ -use strict; -use warnings; -use File::Copy::Recursive qw(dircopy); -use Cwd qw(); - -my $path = Cwd::cwd(); -print("cwsd: $path\n"); - -unless (-e "incomingbuilds" or mkdir("incomingbuilds")) -{ - die "Unable to create directory incomingbuilds"; -} - -my @hostPlatforms = ("windows", "OSX", "Linux"); - -foreach my $hostPlatform(@hostPlatforms) -{ - system ("build.cmd", "libs", "-os $hostPlatform", "-c release") eq 0 or die ("Failed to make $hostPlatform host platform class libraries\n"); - - dircopy ("artifacts/bin/runtime/net7.0-$hostPlatform-Release-x64", "incomingbuilds/coreclrjit-$hostPlatform") or die $!; - - system ("taskkill", "/IM", "\"dotnet.exe\"", "/F"); - - system ("build.cmd", "-clean"); -} \ No newline at end of file From f81ebe6667c153f6dde985539d15794d17a4a39a Mon Sep 17 00:00:00 2001 From: Alex Thibodeau Date: Wed, 3 Nov 2021 12:29:34 -0400 Subject: [PATCH 4/4] PR feedback: Use a function for echoing system calls --- .yamato/scripts/build_classlibs.bat | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.yamato/scripts/build_classlibs.bat b/.yamato/scripts/build_classlibs.bat index ba238dff2edfe5..3f6e0dfc0dc569 100644 --- a/.yamato/scripts/build_classlibs.bat +++ b/.yamato/scripts/build_classlibs.bat @@ -3,18 +3,20 @@ if not exist "incomingbuilds" mkdir "incomingbuilds" for %%x IN ("windows", "OSX", "Linux") do ( - ECHO build.cmd libs -os %%x -c release - build.cmd libs -os %%x -c release + CALL :EchoAndExecute build.cmd libs -os %%x -c release if NOT %errorlevel% == 0 ( echo "build failed" EXIT /B %errorlevel% ) if not exist "incomingbuilds/coreclrjit-%%x" mkdir "incomingbuilds/coreclrjit-%%x" - ECHO xcopy /s /e /h /y "artifacts/bin/runtime/net7.0-%%x-Release-x64" "incomingbuilds/coreclrjit-%%x" - xcopy /s /e /h /y "artifacts/bin/runtime/net7.0-%%x-Release-x64" "incomingbuilds/coreclrjit-%%x" - ECHO taskkill /IM "dotnet.exe" /F - taskkill /IM "dotnet.exe" /F - echo build.cmd -clean - build.cmd -clean + + CALL :EchoAndExecute xcopy /s /e /h /y "artifacts/bin/runtime/net7.0-%%x-Release-x64" "incomingbuilds/coreclrjit-%%x" + CALL :EchoAndExecute taskkill /IM "dotnet.exe" /F + CALL :EchoAndExecute build.cmd -clean ) -EXIT /B %ERRORLEVEL% \ No newline at end of file +EXIT /B %ERRORLEVEL% + +:EchoAndExecute +ECHO %* +CALL %* +GOTO :EOF