Skip to content

Commit

Permalink
Fix OS detection for CPack dependencies (#217)
Browse files Browse the repository at this point in the history
* Fix OS detection for CPack dependencies

The SYSTEM_OS and SYSTEM_OS_VERSION variables were mixed up when they
were renamed in 9137cd5.

* Ensure CI fails if packaging commands fail

* Check that each package can be installed
  • Loading branch information
cgmb authored Jan 4, 2024
1 parent 504452b commit c87ede0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,25 @@ def runPackageCommand(platform, project, jobName, label='')
String ext = platform.jenkinsLabel.contains('ubuntu') ? "deb" : "rpm"
String dir = project.buildName.contains('Debug') ? "debug" : "release"

String testPackageCommand;
if (platform.jenkinsLabel.contains('ubuntu'))
{
testPackageCommand = 'sudo apt-get install -y --simulate '
}
else if (platform.jenkinsLabel.contains('centos') || platform.jenkinsLabel.contains('rhel'))
{
testPackageCommand = 'sudo yum install -y --setopt tsflags=test '
}
else
{
testPackageCommand = 'sudo zypper install -y --dry-run --download-only --allow-unsigned-rpm '
}

command = """
set -x
set -ex
cd ${project.paths.project_build_prefix}/build/${dir}
make package
${testPackageCommand} ./hipsolver*.$ext
mkdir -p package
if [ ! -z "$label" ]
then
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ include( clients/cmake/build-options.cmake )
if(NOT SYSTEM_OS)
rocm_set_os_id(SYSTEM_OS)
string(TOLOWER "${SYSTEM_OS}" SYSTEM_OS)
rocm_read_os_release(SYSTEM_OS VERSION_ID)
rocm_read_os_release(SYSTEM_OS_VERSION VERSION_ID)
endif()

# Build clients of the library
Expand Down

0 comments on commit c87ede0

Please sign in to comment.