Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrowne authored Dec 17, 2024
2 parents 2d38cf4 + ade2bbb commit a9d4ed2
Show file tree
Hide file tree
Showing 318 changed files with 2,051 additions and 9,267 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ check-filenames =
check-hidden =
# Disable warnings about binary files
quiet-level = 2
skip = */.git,*/common_tools/cloc,*/TriBITSDoc,*/tribits/doc/guides/rst2latex.tex,*/*.js,*/*.svg,*/tribits/doc/sphinx/*/index.html
skip = */.git,*/common_tools/cloc,*/TriBITSDoc,*/tribits/doc/guides/rst2latex.tex,*/*.js,*/*.svg,*/tribits/doc/sphinx/*/index.html,*~
ignore-words-list = thur,inout,te,nd,lod,aci,nin,nnumber,wile,reall,bu,somewhere
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if (NOT TRIBITS_PROCESSING_PACKAGE)
# This CMakeLists.txt file is being processed as the TriBITS projects's base
# CMakeLists.txt file! (See comments at bottom of this file.)
cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR)
include("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake")
project(${PROJECT_NAME} NONE)
set(${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tribits" CACHE PATH "")
Expand Down
18 changes: 12 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
TriBITS: Tribal Build, Integrate, and Test System
=================================================

The Tribal Build, Integrate, and Test System (TriBITS) is a framework designed
to handle large software development projects involving multiple independent
development teams and multiple source repositories which is built on top of
the open-source CMake set of tools. TriBITS also defines a complete software
development, testing, and deployment system supporting processes consistent
with modern agile software development best practices.
The Tribal Build, Integrate, and Test System (TriBITS) provides a set of tools
and approaches designed to better handle large software development projects
involving multiple independent development teams and multiple source
repositories which are built on top of the open-source CMake set of tools.

TriBITS provides the following core feature sets:

* Package Architecture and Dependency Handling
* Package CMake targets and export files
* Uniform handling of external packages
* Large-scale test suite management


Documentation
=============
Expand Down
2 changes: 1 addition & 1 deletion common_tools/git/cherry-pick-commits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# @HEADER
# ************************************************************************
#
Expand Down
2 changes: 1 addition & 1 deletion common_tools/git/commit-summary-over-periods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# @HEADER
# ************************************************************************
#
Expand Down
15 changes: 9 additions & 6 deletions common_tools/git/hooks/client-side/copy_hooks_scripts.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh
#
# Run from the base TriBITS git repo clone to install local git hooks
# Run from a base git repo clone to install local git hooks
#
# For example:
#
# $ cd TriBITS/
# $ ./commont_tools/git/client-side/copy_hooks_scripts.sh
Expand All @@ -14,18 +16,19 @@ fi
_SCRIPT_DIR=`echo $0 | sed "s/\(.*\)\/copy_hooks_scripts.sh/\1/g"`

function copy_hook_script {
orig_file="$_SCRIPT_DIR/$1"
dest_file=".git/hooks/$1"
hook_file_name=$1
orig_file="$_SCRIPT_DIR/${hook_file_name}"
dest_file=".git/hooks/${hook_file_name}"

if diff ${orig_file} ${dest_file} &> /dev/null ; then
:
echo "NOTE: Local git hook script is same as installed: ${hook_file_name}"
else
echo "Copy local git hook script: $1"
echo "Copy local git hook script: ${hook_file_name}"
cp "${orig_file}" "${dest_file}"
fi
}

#echo "_SCRIPT_DIR = '$_SCRIPT_DIR'"

copy_hook_script commit-msg

copy_hook_script pre-push
149 changes: 149 additions & 0 deletions common_tools/git/hooks/client-side/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#!/usr/bin/env python3
#
# pre-push hook to check that commits are signed before pushing
#

import os
import sys
import subprocess


# Functions


def s(x):
try:
return x.decode("utf-8")
except AttributeError:
return x


def getCmndOutput(cmnd, allowToFail=False):
result = subprocess.run(cmnd, stdout=subprocess.PIPE,
stderr = subprocess.STDOUT)
output = s(result.stdout)
if result.returncode != 0 and not allowToFail:
print("Error, the command "+str(cmnd)+" returned error code "+str(result.returncode)\
+" with the stderr message:\n\n"+str(result.stderr)\
+"\n\nReturned output was:\n\n"+output)
exit(1)
return output


def getCmndLineArgsFrmSysArgv(sysArgv):
cmndLineArgs = sysArgv[1:]
remoteName = cmndLineArgs[0]
remoteURL = cmndLineArgs[1]
#print("remoteName = "+str(remoteName))
#print("remoteURL = "+str(remoteURL))
return (remoteName, remoteURL)


def getVersionInfoFromStdinStr(stdinStr):
if stdinStr:
stdinArray = stdinStr.split(" ")
#print("stdinArray = "+str(stdinArray))
localRef = stdinArray[0]
localObjectName = stdinArray[1]
remoteRef = stdinArray[2]
remoteObjectName = stdinArray[3]
#print("localRef = "+localRef)
#print("localObjectName = "+localObjectName)
#print("remoteRef = "+remoteRef)
#print("remoteObjectName = "+remoteObjectName)
localCommit = localObjectName
remoteCommit = remoteObjectName
else:
localCommit = None
remoteCommit = None
#
return (localCommit, remoteCommit)


def getUpstreamRemoteBranch():
upstreamRemoteBranchPropName = "user.upstreamremotebranch"
upstreamRemoteBranch = getCmndOutput(["git", "config", "--get",
upstreamRemoteBranchPropName], allowToFail=True).strip()
if not upstreamRemoteBranch:
print("Error: The git repo config var '"+upstreamRemoteBranchPropName+"'"\
+" is not set!\n\n"\
+"Please set it in your local repo with:\n\n"\
+" git config "+upstreamRemoteBranchPropName+" <remoteName>/<branchName>")
exit(1)
return upstreamRemoteBranch


def getAdjustedReferenceVersion(remoteCommit):
if remoteCommit == "0000000000000000000000000000000000000000":
#print("Adjusted remote ref for remote commit: "+remoteCommit)
return getUpstreamRemoteBranch()
return remoteCommit


def getVersionRangeInfoFromStdinStr(stdinStr):
(localCommit, remoteCommit) = getVersionInfoFromStdinStr(stdinStr)
remoteReferenceVersion = getAdjustedReferenceVersion(remoteCommit)
return (localCommit, remoteReferenceVersion)


def getCommitsListToBeTested(localCommit, remoteReferenceVersion):
if remoteReferenceVersion:
gitCommitsStr = getCmndOutput(["git", "rev-list",
remoteReferenceVersion+".."+localCommit]).strip()
#print("gitCommits = '"+gitCommits+"'")
else:
gitCommitsStr = None
# Return an array of the commits
if gitCommitsStr:
return str(gitCommitsStr).split("\n")
return []


def checkCommitOkay(commit):
commitMsg = getCmndOutput(["git", "log", "-1", "--pretty=format:\"%B\"", commit])
if not "Signed-off-by:" in commitMsg:
print("Error: Commit "+commit+" does not have a Signed-off-by line!")
return False
return True


def checkCommitsAreOkay(gitCommitsList, upstreamRemoteBranch):
foundBadCommit = False
if gitCommitsList:
for commit in gitCommitsList:
if not checkCommitOkay(commit):
foundBadCommit = True
if foundBadCommit:
print("\nNOTE: These commits can be signed off by running:\n\n"\
" git rebase --signoff "+upstreamRemoteBranch+"\n")
return False
return True


def abortIfOnlyDoingTesting():
prePushHookTesting = os.environ.get("PRE_PUSH_HOOK_TESTING", "0")
if prePushHookTesting == "1":
print("Aborting pre-push because PRE_PUSH_HOOK_TESTING="+str(prePushHookTesting))
exit(1)


#
# Main
#

# Get the branch name at the top in case it is not set!
upstreamRemoteBranch = getUpstreamRemoteBranch()

(remoteName, remoteURL) = getCmndLineArgsFrmSysArgv(sys.argv)

stdinStr = sys.stdin.read().strip()
(localCommit, remoteReferenceVersion) = getVersionRangeInfoFromStdinStr(stdinStr)
gitCommitsList = getCommitsListToBeTested(localCommit, remoteReferenceVersion)

allCommitsAreOkay = checkCommitsAreOkay(gitCommitsList, upstreamRemoteBranch)

abortIfOnlyDoingTesting()

# Final return pass/fail
if not allCommitsAreOkay: exit(1)
exit(0)
2 changes: 1 addition & 1 deletion common_tools/git/hooks/server-side/get_recipients.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import commands
import os
Expand Down
2 changes: 1 addition & 1 deletion common_tools/git/hooks/server-side/update_push_log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# @HEADER
# ************************************************************************
#
Expand Down
2 changes: 1 addition & 1 deletion common_tools/test/hhmmss_math.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# This simple set of python functions makes it easy to do simple math with
# times formatted as <hr>h<min>m<sec>s. This makes it easier to analyze
Expand Down
2 changes: 1 addition & 1 deletion common_tools/test/kill-pstree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# @HEADER
# ************************************************************************
#
Expand Down
72 changes: 72 additions & 0 deletions dev_testing/cee-rhel8/do-configure.mpi-debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

if [ -d CMakeFiles ] ; then
rm -r CMakeFiles
fi
if [ -e CMakeCache.txt ] ; then
rm CMakeCache.txt
fi

if [ "$TRIBITS_BASE_DIR" == "" ] ; then
_ABS_FILE_PATH=`readlink -f $0`
_SCRIPT_DIR=`dirname $_ABS_FILE_PATH`
TRIBITS_BASE_DIR=$_SCRIPT_DIR/../..
fi

tribits_install_test_dir=/tmp/rabartl/tribits_install_tests
if [ -d "${tribits_install_test_dir}" ] ; then
echo "Makedir ${tribits_install_test_dir}"
mkdir ${tribits_install_test_dir}
fi

${TRIBITS_BASE_DIR}/dev_testing/generic/do-configure-mpi-debug \
-DDART_TESTING_TIMEOUT=200 \
-DCTEST_PARALLEL_LEVEL=16 \
-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE \
-DTriBITS_CTEST_DRIVER_MEMORY_TESTS=TRUE \
-DTriBITS_ENABLE_CONFIGURE_TIMING=ON \
-DTriBITS_ENABLE_PACKAGE_CONFIGURE_TIMING=ON \
-DTribitsExProj_INSTALL_BASE_DIR=${tribits_install_test_dir} \
-DTribitsExProj_INSTALL_OWNING_GROUP=wg-sems-users-son \
-DTriBITS_ENABLE_REAL_GIT_CLONE_TESTS=ON \
-DTriBITS_SHOW_TEST_START_END_DATE_TIME=ON \
"$@"

#-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE \
#-DTriBITS_CTEST_DRIVER_MEMORY_TESTS=TRUE \

#-DTriBITS_ENABLE_DOC_GENERATION_TESTS=ON

# To submit to testing.sandia.gov/cdash set:
#
# -DTriBITS_CTEST_DRIVER_SUBMIT_TO=TESTING_SANDIA_CDASH

# To submit to testing-dev.sandia.gov/cdash set:
#
# -DTriBITS_CTEST_DRIVER_SUBMIT_TO=TESTING_DEV_SANDIA_CDASH

# To submit to exp.cdash.org set:
#
# -DTriBITS_CTEST_DRIVER_SUBMIT_TO=EXP_CDASH

# To submit to arbitrary CDash site (e.g. testing-dev.sandia.gov/cdash) set:
#
# -DTriBITS_CTEST_DRIVER_SUBMIT_TO=CUSTOM
# -DTriBITS_CTEST_DRIVER_SUBMIT_DROP_SITE=testing-dev.sandia.gov
# -DTriBITS_CTEST_DRIVER_SUBMIT_DROP_LOCATION="/cdash/submit.php?project=TribitsExProj"

# NOTE: Add -DTriBITS_ENABLE_REAL_GIT_CLONE_TESTS=ON to test cloning TriBITS
# Example repos and testing the clone features of the various tools. To get
# this to work on SNL machines, one may need to switch from
# 'https://github.com/' to '[email protected]:' using:
#
# export [email protected]:tribits/
#
# before configuring.
#
# NOTE: The directory /tmp/tribits_install_tests above was created beforehand with:
#
# $ mkdir /tmp/tribits_install_tests
#
# One can allow another user to create the directory with a shared group for
# more testing.
8 changes: 8 additions & 0 deletions dev_testing/cee-rhel8/load-env.clang-16.0.6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module purge
module load aue/cmake/3.27.7
module load aue/ninja/1.11.1
module load aue/clang/16.0.6
module load aue/openmpi/4.1.6-clang-16.0.6

export PATH=${HOME}/.local/bin:${PATH}
export [email protected]:tribits/
7 changes: 7 additions & 0 deletions dev_testing/cee-rhel8/load-env.gnu-10.3.0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module purge
module load aue/cmake/3.27.7
module load aue/ninja/1.11.1
module load aue/gcc/10.3.0
module load aue/openmpi/4.1.6-gcc-10.3.0

export [email protected]:tribits/
2 changes: 1 addition & 1 deletion dev_testing/crf450/mpi-debug/do-configure
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ "$TRIBITS_BASE_DIR" == "" ] ; then
fi

${TRIBITS_BASE_DIR}/dev_testing/generic/do-configure-mpi-debug \
-DDART_TESTING_TIMEOUT=85 \
-DDART_TESTING_TIMEOUT=100 \
-DCTEST_PARALLEL_LEVEL=16 \
-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE \
-DTriBITS_CTEST_DRIVER_MEMORY_TESTS=TRUE \
Expand Down
2 changes: 1 addition & 1 deletion refactoring/remove_std_tribits_includes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

include_files_to_remove = [
"AddSubdirectories",
Expand Down
4 changes: 2 additions & 2 deletions refactoring/replace_include_directories_r.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ echo
echo "Replacing INCLUDE_DIRECTORIES with TRIBITS_INCLUDE_DIRECTORIES in all CMakeList.txt and *.cmake files ..."
echo

find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/token-replace.py -t INCLUDE_DIRECTORIES -r TRIBITS_INCLUDE_DIRECTORIES -f {} \;
find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/../tribits/refactoring/token-replace.py -t INCLUDE_DIRECTORIES -r TRIBITS_INCLUDE_DIRECTORIES -f {} \;

echo
echo "Replacing include_directories with tribits_include_directories in all CMakeList.txt and *.cmake files ..."
echo

find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/token-replace.py -t include_directories -r tribits_include_directories -f {} \;
find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/../tribits/refactoring/token-replace.py -t include_directories -r tribits_include_directories -f {} \;
4 changes: 2 additions & 2 deletions refactoring/replace_set_and_inc_dirs_r.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ echo
echo "Replacing SET_AND_INC_DIRS with TRIBITS_SET_AND_INC_DIRS in all CMakeList.txt and *.cmake files ..."
echo

find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/token-replace.py -t SET_AND_INC_DIRS -r TRIBITS_SET_AND_INC_DIRS -f {} \;
find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/../tribits/refactoring/token-replace.py -t SET_AND_INC_DIRS -r TRIBITS_SET_AND_INC_DIRS -f {} \;

echo
echo "Replacing set_and_inc_dirs with tribits_set_and_inc_dirs in all CMakeList.txt and *.cmake files ..."
echo

find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/token-replace.py -t set_and_inc_dirs -r tribits_set_and_inc_dirs -f {} \;
find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/../tribits/refactoring/token-replace.py -t set_and_inc_dirs -r tribits_set_and_inc_dirs -f {} \;
Loading

0 comments on commit a9d4ed2

Please sign in to comment.