From 3cccb105f641b1fef8f42aaad1ccd3a9c0fc9e8e Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Fri, 1 Apr 2022 05:38:23 +0530 Subject: [PATCH] SWDEV-326661 - hipcc/hipconfig to use return value from pl scripts. (#2584) On Windows build failures were ignored becasue hipcc script ignored the output of hipcc.pl Also disables catch2 deviceLib testset on Windows due to linking issue. This makes sure that we have a baseline of no build failures on Windows Change-Id: I007a2a47e69ce1ae69e5569bbef4c63a636110ee --- bin/hipcc | 26 +++++++++++++++++++++----- bin/hipconfig | 26 +++++++++++++++++++++----- tests/catch/unit/CMakeLists.txt | 2 +- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/bin/hipcc b/bin/hipcc index 32494dd345..552c44dda7 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -22,7 +22,6 @@ # Need perl > 5.10 to use logic-defined or use 5.006; use v5.10.1; -use strict; use warnings; use File::Basename; @@ -35,13 +34,30 @@ my $SCRIPT_DIR=dirname(__FILE__); if ($HIPCC_USE_PERL_SCRIPT) { #Invoke hipcc.pl my $HIPCC_PERL=catfile($SCRIPT_DIR, '/hipcc.pl'); - exec($^X, $HIPCC_PERL, @ARGV); + system("$^X $HIPCC_PERL @ARGV"); } else { - #Invoke hipcc.bin - my $HIPCC_BIN=catfile($SCRIPT_DIR, '/hipcc.bin'); + $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); + $BIN_NAME="/hipcc.bin"; + if ($isWindows) { + $BIN_NAME="/hipcc.bin.exe"; + } + my $HIPCC_BIN=catfile($SCRIPT_DIR, $BIN_NAME); if ( -e $HIPCC_BIN ) { - exec($HIPCC_BIN, @ARGV); + #Invoke hipcc.bin + my $output = qx($HIPCC_BIN @ARGV); + print ("$output\n"); } else { print "hipcc.bin not present; Install HIPCC binaries before proceeding"; + exit(-1); } } +if ($? == -1) { + exit($?); +} +elsif ($? & 127) { + exit($?); +} +else { + $CMD_EXIT_CODE = $? >> 8; +} +exit($CMD_EXIT_CODE); diff --git a/bin/hipconfig b/bin/hipconfig index 8ed1ba6f10..8789a52b45 100755 --- a/bin/hipconfig +++ b/bin/hipconfig @@ -22,7 +22,6 @@ # Need perl > 5.10 to use logic-defined or use 5.006; use v5.10.1; -use strict; use warnings; use File::Basename; @@ -35,13 +34,30 @@ my $SCRIPT_DIR=dirname(__FILE__); if ($HIPCONFIG_USE_PERL_SCRIPT) { #Invoke hipconfig.pl my $HIPCONFIG_PERL=catfile($SCRIPT_DIR, '/hipconfig.pl'); - exec($^X, $HIPCONFIG_PERL, @ARGV); + system("$^X $HIPCONFIG_PERL @ARGV"); } else { - #Invoke hipconfig.bin - my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, '/hipconfig.bin'); + $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); + $BIN_NAME="/hipconfig.bin"; + if ($isWindows) { + $BIN_NAME="/hipconfig.bin.exe"; + } + my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, $BIN_NAME); if ( -e $HIPCONFIG_BIN ) { - exec($HIPCONFIG_BIN, @ARGV); + #Invoke hipconfig.bin + my $output = qx($HIPCONFIG_BIN @ARGV); + print ("$output\n"); } else { print "hipconfig.bin not present; Install HIPCC binaries before proceeding"; + exit(-1); } } +if ($? == -1) { + exit($?); +} +elsif ($? & 127) { + exit($?); +} +else { + $CMD_EXIT_CODE = $? >> 8; +} +exit($CMD_EXIT_CODE); diff --git a/tests/catch/unit/CMakeLists.txt b/tests/catch/unit/CMakeLists.txt index 2a1f50adb7..8506e67781 100644 --- a/tests/catch/unit/CMakeLists.txt +++ b/tests/catch/unit/CMakeLists.txt @@ -23,9 +23,9 @@ if (UNIX) add_subdirectory(memory) add_subdirectory(graph) add_subdirectory(rtc) + add_subdirectory(deviceLib) endif() -add_subdirectory(deviceLib) add_subdirectory(stream) add_subdirectory(event) add_subdirectory(occupancy)