diff --git a/CHANGELOG.md b/CHANGELOG.md index faeb42a436708f18d69a0bb8778fceecf802af49..4317cb8e76e1cda8030be42e1bb3ce8806865e25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### New Features * Autocompletion for `iocsh.bash` has been added +* Removed `iocsh_gdb.bash` and `iocsh_nice.bash`, both of whose functionality can be called via `iocsh.bash -dg` and `iocsh.bash -n`, respectively. +* Patch file location has been change from `patch/Site/$VERSION-description.p0.patch` to `patch/Site/$VERSION/description.p0.patch` +* Require will automatically build `.template` and `.substitutions` files into the common build directory instead of into the source Db path * Rudimentary testing has been added: * * Tests that the correct version is loaded * * Tests that elementary patching/building works as expected @@ -15,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bugfixes * `iocsh.bash --help` (and variants) no longer loads tries to load `env.sh`. +* `make uninstall` no longer tries to remove from global `siteLibs` directory. +* `make build` will fail if any of the target architectures fail, not just the last one. +* Fixed issue where git passwords would be displayed in plaintext in metadata file +* Fixed issue where `LD_LIBRARY_PATH` could keep old `siteLibs` path around +* Removed duplicated entries from generated `.dep` files ### Other changes diff --git a/require-ess/tools/driver.makefile b/require-ess/tools/driver.makefile index 03abfec3817c3663668085cbef660bb25df72e26..bf7574edc55fcdfa6e6d7de8b5d6178367dcffbc 100644 --- a/require-ess/tools/driver.makefile +++ b/require-ess/tools/driver.makefile @@ -93,12 +93,13 @@ DOCUEXT += template db dbt subs subst substitutions script SHELL = /bin/bash -O extglob # Some shell commands: +RMDIR = rm -rf LN = ln -s EXISTS = test -e NM = nm -RMDIR = rm -rf RM = rm -f CP = cp +MKDIR = mkdir -p -m 775 # This is to allow for build numbers in recognized versions. First regex is for grep, second for sed. VERSIONGLOB = +([0-9]).+([0-9]).+([0-9])?(++([0-9])) @@ -152,25 +153,9 @@ ifndef EPICSVERSION ## RUN 1 # In source directory -##---## In E3, we don't need to check which EPICS BASE - -# Find out which EPICS versions to build. -#INSTALLED_EPICS_VERSIONS := $(patsubst ${EPICS_LOCATION}/base-%,%,$(wildcard ${EPICS_LOCATION}/base-*[0-9])) -#EPICS_VERSIONS = $(filter-out ${EXCLUDE_VERSIONS:=%},${DEFAULT_EPICS_VERSION}) -#MISSING_EPICS_VERSIONS = $(filter-out ${BUILD_EPICS_VERSIONS},${DEFAULT_EPICS_VERSION}) -#BUILD_EPICS_VERSIONS = $(filter ${INSTALLED_EPICS_VERSIONS},${DEFAULT_EPICS_VERSION}) - -#BUILD_EPICS_VERSIONS = ${DEFAULT_EPICS_VERSION} - $(foreach v,$(sort $(basename ${BUILD_EPICS_VERSIONS})),$(eval EPICS_VERSIONS_$v=$(filter $v.%,${BUILD_EPICS_VERSIONS}))) -# # Che# ck only version of files needed to build the module. But which are they? -# VERSIONCHECKFILES = $(filter-out /% -none-, $(wildcard *makefile* *Makefile* *.db *.template *.subs *.dbd *.cmd) ${SOURCES} ${DBDS} ${TEMPLATES} ${SCRIPTS} $(foreach v,3.13 3.14 3.15, ${SOURCES_$v} ${DBDS_$v})) -# VERSIONCHECKCMD = ${MAKEHOME}/getVersion.tcl ${VERSIONDEBUGFLAG} ${VERSIONCHECKFILES} -# LIBVERSION = $(or $(filter-out test,$(shell ${VERSIONCHECKCMD} 2>/dev/null)),${USER},test) -# VERSIONDEBUGFLAG = $(if ${VERSIONDEBUG}, -d) - # Default module name is name of current directory. # But in case of "src" or "snl", use parent directory instead. # Avoid using environment variables for MODULE or PROJECT @@ -199,26 +184,12 @@ export ${PRJ}_E3_GIT_STATUS export SUBS export TMPS -# Some shell commands: -RMDIR = rm -rf -LN = ln -s -EXISTS = test -e -NM = nm -RM = rm -f -MKDIR = mkdir -p -m 775 - clean:: $(RMDIR) O.* -#clean.%:: -# $(RMDIR) $(wildcard O.*${@:clean.%=%}*) - uninstall: $(RMDIR) ${MODULE_LOCATION} -#uninstall.%: -# $(RMDIR) $(wildcard ${MODULE_LOCATION}/R*${@:uninstall.%=%}*) - help: @echo "usage:" @for target in '' build '<EPICS version>' \ @@ -229,7 +200,6 @@ help: do echo " make $$target"; \ done @echo "Makefile variables:(defaults) [comment]" -# @echo " EPICS_VERSIONS (${DEFAULT_EPICS_VERSION})" @echo " MODULE (${PRJ}) [from current directory name]" @echo " PROJECT [older name for MODULE]" @echo " SOURCES (*.c *.cc *.cpp *.st *.stt *.gt)" @@ -245,16 +215,8 @@ help: @echo " BUILDCLASSES (Linux)" @echo " <module>_VERSION () [build against specific version of other module]" -## "make version" shows the module version and why it is what it is. -# version: ${IGNOREFILES} -# @${VERSIONCHECKCMD} - debug:: -# @echo "INSTALLED_EPICS_VERSIONS = ${INSTALLED_EPICS_VERSIONS}" @echo "BUILD_EPICS_VERSIONS = ${BUILD_EPICS_VERSIONS}" -# @echo "MISSING_EPICS_VERSIONS = ${MISSING_EPICS_VERSIONS}" -# @echo "EPICS_VERSIONS_3.14 = ${EPICS_VERSIONS_3.14}" - @echo "EPICS_VERSIONS_3.15 = ${EPICS_VERSIONS_3.15}" @echo "BUILDCLASSES = ${BUILDCLASSES}" @echo "LIBVERSION = ${LIBVERSION}" @echo "VERSIONCHECKFILES = ${VERSIONCHECKFILES}" @@ -267,13 +229,6 @@ MAKEVERSION = ${MAKE} -f ${USERMAKEFILE} LIBVERSION=${LIBVERSION} build install debug db_internal:: ${IGNOREFILES} @+for VERSION in ${BUILD_EPICS_VERSIONS}; do ${MAKEVERSION} EPICSVERSION=$$VERSION $@; done -#build: ${IGNOREFILES} -# ${MAKE} -f ${USERMAKEFILE} LIBVERSION=${LIBVERSION} EPICSVERSION=$$DEFAULT_EPICS_VERSION -# ${MAKEVERSION} EPICSVERSION=$${BUILD_EPICS_VERSIONS} -# Handle cases where user requests a group of EPICS versions: -# make <action>.3.13 or make <action>.3.14 instead of make <action> or -# make 3.13 or make 3.14 instead of make. - define VERSIONRULES $(1): ${IGNOREFILES} @+for VERSION in $${EPICS_VERSIONS_$(1)}; do $${MAKEVERSION} EPICSVERSION=$$$$VERSION build; done @@ -325,7 +280,6 @@ else # EPICSVERSION # Second or third run (see T_A branch below) EPICS_BASE=${EPICS_LOCATION} -#/base-${EPICSVERSION} CONFIG=${EPICS_BASE}/configure @@ -419,25 +373,10 @@ SCR = $(if ${SCRIPTS},$(filter-out -none-,${SCRIPTS}),$(wildcard *.cmd *.iocsh)) SCR += ${SCRIPTS_${EPICSVERSION}} export SCR -DOCUDIR = . -#DOCU = $(foreach DIR,${DOCUDIR},$(wildcard ${DIR}/*README*) $(foreach EXT,${DOCUEXT}, $(wildcard ${DIR}/*.${EXT}))) -export DOCU - -# Loop over all target architectures for third run. - # Filter architectures to build using EXCLUDE_ARCHS and ARCH_FILTER. CROSS_COMPILER_TARGET_ARCHS := ${EPICS_HOST_ARCH} ${CROSS_COMPILER_TARGET_ARCHS} CROSS_COMPILER_TARGET_ARCHS := $(filter-out $(addprefix %,${EXCLUDE_ARCHS}),$(filter-out $(addsuffix %,${EXCLUDE_ARCHS}),$(if ${ARCH_FILTER},$(filter ${ARCH_FILTER},${CROSS_COMPILER_TARGET_ARCHS}),${CROSS_COMPILER_TARGET_ARCHS}))) -# Create build dirs (and links) if necessary. -LINK_eldk52-e500v2 = eldk52-rt-e500v2 eldk52-xenomai-e500v2 -define MAKELINKDIRS -LINKDIRS+=O.${EPICSVERSION}_$1 -O.${EPICSVERSION}_$1: - $(LN) O.${EPICSVERSION}_$2 O.${EPICSVERSION}_$1 -endef -$(foreach a,${CROSS_COMPILER_TARGET_ARCHS},$(foreach l,$(LINK_$a),$(eval $(call MAKELINKDIRS,$l,$a)))) - SRCS_Linux = ${SOURCES_Linux} export SRCS_Linux @@ -591,29 +530,6 @@ INSTALL_CFG = ${INSTALL_REV}/cfg INSTALL_DOC = ${MODULE_LOCATION}/doc INSTALL_SCR = ${INSTALL_REV} -#INSTALL_DOCUS = $(addprefix ${INSTALL_DOC}/${PRJ}/,$(notdir ${DOCU})) - -#${INSTALL_DOC}/${PRJ}/%: % -# @echo "Installing documentation $@" -# $(RM) $@ -# cp $^ $@ -# chmod 444 $@ -# -#${INSTALL_TEMPL}/%.template: %.template -# @echo "Installing template file $@" -# $(RM) $@ -# echo "#${PRJ}Lib ${LIBVERSION}" > $@ -# cat $^ >> $@ -# chmod 444 $@ -# $(SETLINKS) ${INSTALL_TEMPL} .template $(basename $(notdir $^)) -# -#${INSTALL_TEMPL}/%.db: %.db -# @echo "Installing template file $@" -# $(RM) $@ -# $(CP) $^ >> $@ -# chmod 444 $@ -# $(SETLINKS) ${INSTALL_TEMPL} .db $(basename $(notdir $^)) - LIBRARY_OBJS = $(strip ${LIBOBJS} $(foreach l,${USR_LIBOBJS},$(addprefix ../,$(filter-out /%,$l))$(filter /%,$l))) MODULELIB = $(if ${LIBRARY_OBJS},${LIB_PREFIX}${PRJ}${SHRLIB_SUFFIX},) @@ -645,7 +561,6 @@ MINOR=$(word 2,${MAJOR_MINOR_PATCH}) PATCH=$(word 3,${MAJOR_MINOR_PATCH}) ifneq (${MINOR},) ALLMINORS := $(shell for ((i=0;i<=${MINOR};i++));do echo $$i;done) -PREREQUISITES = $(shell ${MAKEHOME}/getPrerequisites.tcl ${INSTALL_INCLUDE} | grep -vw ${PRJ}) ifeq (${OS_CLASS}, Linux) PROVIDES = ${ALLMINORS:%=-Wl,--defsym,${PRJ}Lib_${MAJOR}.%=0} endif # Linux @@ -736,8 +651,6 @@ build: ${DEPFILE} # Include default EPICS Makefiles (version dependent). # Avoid library installation when doing 'make build'. INSTALL_LOADABLE_SHRLIBS= -# Avoid installing *.munch to bin directory. -INSTALL_MUNCHS= # We ony want to include ${BASERULES} from EPICS base if we are /not/ in debug # mode. Including this causes all of the source files to be compiled! @@ -934,30 +847,9 @@ SNCFLAGS += -r ${LN} $< $(*F).gt gdc $(*F).gt -# The original EPICS munching rules do not really work well. -# Call the native vxWorks munch program. -MUNCH_5=tclsh $(VX_DIR)/host/src/hutils/munch.tcl -MUNCH_6=tclsh $(VX_DIR)/host/resource/hutils/tcl/munch.tcl -MUNCH_=$(MUNCH_5) -# VXWORKS_MAJOR_VERSION exsists since EPICS 3.14.12 or so. -MUNCH=$(MUNCH_$(VXWORKS_MAJOR_VERSION)) -%.munch: CMPLR=TRAD -%.munch: % - @echo Munching $< - $(RM) ctct.o ctdt.c - $(NM) $< | $(MUNCH) > ctdt.c - $(COMPILE.c) ctdt.c - $(LINK.c) $@ $< ctdt.o - -%_ctdt.c : %.nm - @echo Munching $* - @$(RM) $@ - $(MUNCH) < $< > $@ - ${VERSIONFILE}: echo "char _${PRJ}LibRelease[] = \"${LIBVERSION}\";" >> $@ -# EPICS R3.14.*: # Create file to fill registry from dbd file. ${REGISTRYFILE}: ${MODULEDBD} $(PERL) $(EPICS_BASE_HOST_BIN)/registerRecordDeviceDriver.pl $< $(basename $@) | grep -v 'iocshRegisterCommon();' > $@ @@ -1030,47 +922,6 @@ ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE) @$(foreach m,${REQ},echo "$m $(or $(call FETCH_BUILD_NUMBER,$(E3_SITEMODS_PATH),$m),$(and $(wildcard ${E3_SITEMODS_PATH}/$m),$(error REQUIRED module $m has no numbered version. Set $m_VERSION)),$(warning REQUIRED module $m not found for ${T_A}.))" >> $@.tmp;) cat $@.tmp | sort -u >> $@ -# Remove MakefileInclude after we are done because it interfers with our way to build. -build: - $(RM) MakefileInclude - endif # In O.* directory endif # T_A defined endif # EPICSVERSION defined - - - - -## -## Tuesday, January 30 14:03:35 CET 2018 : Default snc path (SNC) was changed in order to use E3_SITELIBS_PATH, -## at the same time, we also add E3_SITEMODS_PATH, E3_SITEAPPS_PATH also. -## They should be configured in E3/CONFIG_EXPORT and E3/CONFIG_E3_MAKEFILE. -## We also introduce E3_SEQUENCER_NAME also. -## -## Wednesday, January 31 15:18:33 CET 2018: Add Debug messages in SNC -## -## Saturday, February 10 22:42:44 CET 2018: E3_SEQUENCER_VERSION was introduced. If not set, fall back to -## *.*.* versions number, and SNC will be selected via lastword -## in the original driver.makefile way. -## Default E3_SEQUENCER_NAME as sequencer, if it is not defined in -## CONFIG_MODULE in each module -## -## Tuesday, May 1 20:27:31 CEST 2018 : Generate a dependency file with module_name x.x.x instead of x.x -## add the exclusion for include for require.dep -## -## Sunday, May 6 22:10:24 CEST 2018 : add %.{hh,hpp,hxx} headers into vpath in order to install them properly -## -## Tuesday, September 18 22:57:17 CEST 2018 : add *.iocsh in SCR -## -## Thursday, November 8 11:01:28 CET 2018 : Add ADD_SITEMODS_INCLUDES and ADD_SITEAPPS_INCLUDES instead of ADD_FOREIGN_INCLUDES -## Remove the E3_SEQUENCER_*, use sequencer_VERSION instaed. -## -## Thursday, March 7 00:11:50 CET 2019 : Add E3_SITEMODS_PATH, E3_SITEAPPS_PATH in the dep file generation. -## -## Monday, September 9 15:25:53 CEST 2019 : Revert E3_SITEMODS_PATH from E3_SITELIBS_PATH in the snc path -## -## Tuesday, June 30 2020 : Combine NFS E3 driver.makefile with conda version -## -## Friday, July 3 2020 : Force all module names to be lowercase, to allow consistency between conda/nfs startup scripts. -## -## $(DATE) : Removed the V3-specific code. Adde������������������������������������������������������������������ diff --git a/require-ess/tools/getVersion.tcl b/require-ess/tools/getVersion.tcl deleted file mode 100755 index b481adf866a85b383e93fabd4a1a72cf87b7b56c..0000000000000000000000000000000000000000 --- a/require-ess/tools/getVersion.tcl +++ /dev/null @@ -1,287 +0,0 @@ -#!/usr/bin/tclsh - -package require Tclx - -set debug 0 - -set global_context [scancontext create] -set file_context [scancontext create] -set skip_context [scancontext create] - -scanmatch $global_context {there is no version here} { - return -} - -scanmatch $global_context {cvs status: failed} { - puts stderr "Error: $matchInfo(line)" - return -} - -scanmatch $global_context {no such directory `(.*)'} { - puts stderr "checking directory $matchInfo(submatch0): so such directory" - return -} - -scanmatch $global_context {cvs [status aborted]: there is no version here} { - return -} - -scanmatch $global_context {^File: .*Up-to-date} { - set file [lindex $matchInfo(line) 1] - puts -nonewline stderr "checking $file: " - catch {unset major minor patch} - scanfile $file_context $matchInfo(handle) - if {![info exists major]} { - puts stderr "revision $rev($file) not tagged => version test" - set version test - continue - } - puts stderr "revision $rev($file) tag $tag($file) => version $major.$minor.$patch" - if {![info exists version]} { - set version $major.$minor.$patch - } else { - if ![cequal $major.$minor.$patch $version] { - set version test - continue - } - } - continue -} - -scanmatch $global_context {^File: .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "checking $file: [lrange $matchInfo(line) 3 end] => version test" - set version test - continue -} - -scanmatch $global_context {^\? .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "checking $file: not in cvs => version test" - set version test - continue -} - -scanmatch $file_context {Working revision:} { - set rev($file) [lindex $matchInfo(line) 2] -} - -scanmatch $file_context {Sticky Tag:.*_([0-9]+)_([0-9]+)_([0-9]+)[ \t]+\(revision: } { - set major $matchInfo(submatch0) - set minor $matchInfo(submatch1) - set patch $matchInfo(submatch2) - set tag($file) "[lindex $matchInfo(line) 2] (sticky)" - scanfile $skip_context $matchInfo(handle) - return -} - -scanmatch $file_context {Sticky Tag:.*_([0-9]+)_([0-9]+)[ \t]+\(revision: } { - set major $matchInfo(submatch0) - set minor $matchInfo(submatch1) - set patch 0 - set tag($file) "[lindex $matchInfo(line) 2] (sticky)" - scanfile $skip_context $matchInfo(handle) - return -} - -scanmatch $file_context {_([0-9]+)_([0-9]+)(_([0-9]+))?[ \t]+\(revision: ([\.0-9]+)\)} { - if [cequal $rev($file) $matchInfo(submatch4)] { - set Major $matchInfo(submatch0) - set Minor $matchInfo(submatch1) - set Patch [expr $matchInfo(submatch3) + 0] - if {![info exists major] || - $Major>$major || - ($Major==$major && ($Minor>$minor - || ($Minor==$minor && $Patch>$patch)))} { - set major $Major - set minor $Minor - set patch $Patch - set tag($file) [lindex $matchInfo(line) 0] - } - } -} - -scanmatch $skip_context {=================} { - return -} - -scanmatch $file_context {=================} { - return -} - -set git_context [scancontext create] - -scanmatch $git_context {fatal: Not a git repository} { - return -} - -scanmatch $git_context {^\?\? .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: not in git => version test" - set version test - continue -} - -scanmatch $git_context {^ M .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: locally modified => version test" - set version test - continue -} - -scanmatch $git_context {^D .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: deleted (or renamed) but not committed => version test" - set version test - continue -} - -scanmatch $git_context {^ D .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: locally deleted => version test" - set version test - continue -} - -scanmatch $git_context {^A .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: locally added => version test" - set version test - continue -} - -scanmatch $git_context {^AM .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: locally added and modified => version test" - set version test - continue -} - -scanmatch $git_context {^([ MADRCU][ MADRCU]) .*} { - set file [lindex $matchInfo(line) 1] - puts stderr "$file: $matchInfo(submatch0) (whatever that means) => version test" - set version test - continue -} - -scanmatch $git_context {fatal: No names found} { - puts stderr "no tag on this version => version test" - set version test -} - -scanmatch $git_context {^([0-9]+)\.([0-9]+)(\.([0-9]+))?$} { - set major $matchInfo(submatch0) - set minor $matchInfo(submatch1) - set patch [expr $matchInfo(submatch3) + 0] - set version $major.$minor.$patch - puts stderr "checking tag $matchInfo(line) => version $version" -} - -scanmatch $git_context {[a-zA-Z]+[a-zA-Z0-9]*_([0-9]+)_([0-9]+)(_([0-9]+))?$} { - set major $matchInfo(submatch0) - set minor $matchInfo(submatch1) - set patch [expr $matchInfo(submatch3) + 0] - set version $major.$minor.$patch - puts stderr "checking tag $matchInfo(line) => version $version" -} - -scanmatch $git_context {(.*[0-9]+[_.][0-9]+([_.][0-9]+)?)-([0-9]+)-g} { - set version test - puts stderr "tag $matchInfo(submatch0) is $matchInfo(submatch2) commits old => version test" -} - -scanmatch $git_context {Your branch is ahead of '(.*)/(.*)'} { - puts stderr "branch \"$matchInfo(submatch1)\" not yet pushed to remote \"$matchInfo(submatch0)\" => version test" - puts stderr "try: git push --tags $matchInfo(submatch0) $matchInfo(submatch1)" - set version test -} - -if {[lindex $argv 0] == "-d"} { - set debug 1 - set argv [lrange $argv 1 end] -} - -# Check all files in top directory and all files specified explicitly in subdirectories - -set topfiles [glob -nocomplain GNUmakefile makefile Makefile *.c *.cc *.cpp *.h *.dbd *.st *.stt *.gt] - -if {$debug} { - puts stderr "checking $topfiles $argv" -} - - -if {[catch { - # fails if we have no git: - if {$debug} { - puts stderr "git status --porcelain $topfiles $argv" - } - set statusinfo [open "|git status --porcelain $topfiles $argv 2>@ stdout"] - scanfile $git_context $statusinfo - # fails if this is no git repo - close $statusinfo - - if [info exists version] { - puts $version - exit - } - - if {$debug} { - puts stderr "git describe --tags HEAD" - } - set statusinfo [open "|git describe --tags HEAD 2>@ stdout"] - scanfile $git_context $statusinfo - catch {close $statusinfo} - - if ![info exists version] { - puts stderr "Could not find out version tag => version test" - set version test - } - - if {$version != "test"} { - if {$debug} { - puts stderr "git status" - } - set statusinfo [open "|git status 2>@ stdout"] - scanfile $git_context $statusinfo - catch {close $statusinfo} - } - - puts $version - exit -}] && $debug} { puts stderr "git: $errorInfo" } - - -if {[catch { -# cvs bug: calling cvs status for files in other directories spoils status -# information for local files. -# fix: check local and non local files separately - - # fails if we have no cvs or server has a problem - if {$debug} { - puts stderr "cvs status -l -v $topfiles $argv" - } - set statusinfo [open "|cvs status -l -v $topfiles $argv 2>@ stdout"] - scanfile $global_context $statusinfo - # fails if this is no cvs repo - close $statusinfo - -# set files {} -# foreach file $argv { -# if {[file tail $file] != $file} { -# lappend files $file -# } -# } -# if [llength $files] { -# set statusinfo [open "|cvs status -l -v $files 2>@ stdout"] -# scanfile $global_context $statusinfo -# close $statusinfo -# } - - puts $version - exit -}] && $debug} { puts stderr "cvs: $errorInfo" } - -puts stderr "No repository found => version test" -puts "test" - -# $Header: /cvs/G/DRV/misc/App/tools/getVersion.tcl,v 1.3 2010/08/03 08:42:40 zimoch Exp $