diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1dea3d9af33c2bc54297c2bc005e12f9d8e79b4..5db5d1464ac2a5d265e39f87ac14c3d085cdee61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,6 +48,7 @@ build require: - tar -zxvf epics.tar.gz - export BASE_PATH=$(ls -d $(pwd)/epics/base-*) - echo "EPICS_BASE:=${BASE_PATH}" >> configure/RELEASE.local + - echo "E3_REQUIRE_VERSION:=${CI_COMMIT_SHORT_SHA}" >> configure/CONFIG_MODULE.local - chmod +w "${BASE_PATH}"/configure/CONFIG_SITE - echo 'INSTALL_LOCATION:=$(TOP)' >> "${BASE_PATH}"/configure/CONFIG_SITE - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BASE_PATH}/lib/linux-x86_64" diff --git a/CHANGELOG.md b/CHANGELOG.md index 994baf5807df7807c5eaf0b7ac3f13bcd17dcd2a..44e78101e1feb68504c26783f4865c13d3e21866 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed issue where consecutive builds might not track updated dependencies ### Other changes +* Rename `iocsh.bash` to `iocsh` * Removed `<module>_TEMPLATES` in favour of `<module>_DB` * Removed unnecessary code from `make init`. * removed `e3.cfg`, `ess-env.conf` and `DEFINES_REQUIRE` files and associated codes in `RULES_REQUIRE`, `setE3Env.bash` and `.gitignore`. diff --git a/README.md b/README.md index 5b1fc97a285b8fa5c182827921f5e40c31ef88c2..977a73ce7d8c5855d8f89f244fe4543fa9e04fd9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ The main parts that we have taken from PSI `require` are `require.c` and `driver load modules dynamically at run-time, and which run the custom build process. However, both of these have been modified significantly for the purposes of e3. -Furthermore, we have added the custom startup script `iocsh.bash` which sets up the IOC's environment before +Furthermore, we have added the custom startup script `iocsh` which sets up the IOC's environment before running `softIocPVA` from EPICS base. ## Building `require` @@ -41,7 +41,7 @@ $ make install To test your build, run ```bash $ source ${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/setE3Env.bash -$ iocsh.bash +$ iocsh ``` which should start up an IOC and load require. diff --git a/configure/E3/CONFIG_TEST b/configure/E3/CONFIG_TEST index d9792f20aa9dcede18a97366c77c25df8997eccd..0b04b6b37f802ac54ec48f550c5d6490882eea45 100644 --- a/configure/E3/CONFIG_TEST +++ b/configure/E3/CONFIG_TEST @@ -1,6 +1,6 @@ TEST_DIR:=$(TOP)/tests -RUN_IOCSH_TEST_COMMAND = run-iocsh --name "${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/iocsh.bash" -r "$(E3_MODULE_NAME),$(E3_MODULE_VERSION)" -l $(TEMP_CELL_PATH) +RUN_IOCSH_TEST_COMMAND = run-iocsh --name "${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/iocsh" -r "$(E3_MODULE_NAME),$(E3_MODULE_VERSION)" -l $(TEMP_CELL_PATH) TEMP_CELL_PATH := $(TOP)/testMods-$(shell date +"%y%m%d%H%M%S") RMDIR = $(RM) -rf diff --git a/configure/module/RULES_REQUIRE b/configure/module/RULES_REQUIRE index 1b10dad6285d38b7c7137e4988865472bdbedd1e..f8579c9d538db3bbe208de4c1efaaeb8d795a3ca 100644 --- a/configure/module/RULES_REQUIRE +++ b/configure/module/RULES_REQUIRE @@ -7,7 +7,7 @@ FILE_FILTER:= %~ %\# E3_TEST_SCRIPT := $(TOP)/tools/test_installed_modules.sh # -E3_SHELL_FILES := $(wildcard $(E3_MODULE_SRC_PATH)/tools/iocsh*.bash) +E3_SHELL_FILES := $(wildcard $(E3_MODULE_SRC_PATH)/tools/iocsh*) E3_IOC_CFG_FILES += $(E3_MODULE_SRC_PATH)/tools/setE3Env.bash E3_IOC_CFG_FILES += $(E3_MODULE_SRC_PATH)/tools/promptE3Env.bash E3_REQUIRE_CONF_FILES := $(filter-out $(FILE_FILTER), $(wildcard $(TOP)/configure/E3/*)) diff --git a/require-ess/tools/README.md b/require-ess/tools/README.md index f22f0c81db58de52199d22a6dd766e6478893e73..39bf3fafbc314a862b7995e02aa322a60a90b096 100644 --- a/require-ess/tools/README.md +++ b/require-ess/tools/README.md @@ -1,17 +1,17 @@ -iocsh.bash +iocsh ==== ## E3 Unique Variables ``` E3_CMD_TOP : the absolute path where a startup script (cmd file) is -E3_IOCSH_TOP : the absolute path where the iocsh.bash is executed +E3_IOCSH_TOP : the absolute path where the iocsh is executed ``` -For example, one executes the iocsh.bash ```${HOME}``` to call ```e3_local/cmds``` via +For example, one executes the iocsh ```${HOME}``` to call ```e3_local/cmds``` via ```sh -$ iocsh.bash e3_local/cmds/iocStats.cmd +$ iocsh e3_local/cmds/iocStats.cmd ``` In this case, ```E3_CMD_TOP``` is defined as ```"${HOME}/e3_local/cmds"``` diff --git a/require-ess/tools/iocsh.bash b/require-ess/tools/iocsh similarity index 86% rename from require-ess/tools/iocsh.bash rename to require-ess/tools/iocsh index d8f38e8d67f562d26acc9e1f52bcd566bb865256..9201e0bbb8f636fbe7a5e22c12a4e5345af51aa2 100644 --- a/require-ess/tools/iocsh.bash +++ b/require-ess/tools/iocsh @@ -21,7 +21,7 @@ # ESS specific iocsh author : Jeong Han Lee # email : han.lee@esss.se # -# Add IOCSH_TOP in order to access where the iocsh.bash is executed +# Add IOCSH_TOP in order to access where the iocsh is executed # Thursday, May 31 00:04:07 CEST 2018, jhlee # # Add PVA support to call softIOCPVA if BASE >= 7.0.1.1 @@ -34,16 +34,17 @@ # 0.3.5 : Set the proper limitation of REQUIRE PV name # 0.3.6 : In case, we know where $0 is, sourcing setE3Env.bash by itself # 0.3.7 : Introduce the local mode with -l -# 0.3.8 : Use mktemp, and protect iocsh.bash when there is no diskspace +# 0.3.8 : Use mktemp, and protect iocsh when there is no diskspace # 0.3.9 : LD_BIND_NOW=1 for resolving symbols at startup. # 0.4.0 : - Fixed registryJLinkAdd failed pva error from base 7.0.3 # - Enable an exit subroutine for sotfioc # Wednesday, September 11 17:27:59 CEST 2019 -# 0.4.1 : - Use the one BASHPID for iocsh.bash +# 0.4.1 : - Use the one BASHPID for iocsh # 0.4.2 : - Use the secure path within tmp, but it may create "disk full" in the long # term if each IOC cannot be closed properly # 0.4.3 : - Tune REQUIRE-* PV in order to replace - with . easily # + SC_SCRIPT="$(readlink -e "$0")" SC_SCRIPTNAME=${0##*/} SC_TOP="${SC_SCRIPT%/*}" @@ -55,7 +56,7 @@ declare BASECODE="" # shellcheck source=require-ess/tools/iocsh_functions.bash . "${SC_TOP}"/iocsh_functions.bash -# To get the absolute path where iocsh.bash is executed +# To get the absolute path where iocsh is executed IOCSH_TOP=${PWD} # Check whether an expected e3 environment variable is defined. @@ -70,12 +71,12 @@ fi # Check that the e3 environment definition and the path for this script # are consistent if [ "${E3_REQUIRE_BIN}" != "${SC_TOP}" ]; then - echo "Error: Configured e3 environment does not match path for iocsh.bash executable." - echo "Please source the appropriate setE3Env.bash file for the version" - echo "of iocsh.bash you wish to use, or run iocsh.bash from a clean" - echo "environment so it can set the environment correctly." - echo "Expected path to iocsh.bash from environment = ${E3_REQUIRE_BIN}" - echo "Actual path to iocsh.bash = ${SC_TOP}" + echo "Error: Configured e3 environment does not match path for iocsh executable." + echo "Please source the appropriate setE3Env.bash file for the version of iocsh" + echo "you wish to use, or run iocsh from a clean environment so it can set the" + echo "environment correctly." + echo "Expected path to iocsh from environment = ${E3_REQUIRE_BIN}" + echo "Actual path to iocsh = ${SC_TOP}" die 2 fi @@ -83,15 +84,15 @@ BASECODE="$(basecode_generator)" check_mandatory_env_settings -# ${BASHPID} returns iocsh.bash PID -iocsh_bash_id=${BASHPID} +# ${BASHPID} returns iocsh PID +iocsh_id=${BASHPID} # -SC_VERSION+=-PID-${iocsh_bash_id} +SC_VERSION+=-PID-${iocsh_id} # -# We define HOSTNAME + iocsh_bash_id -IOCSH_PS1=$(iocsh_ps1 "${iocsh_bash_id}") -REQUIRE_IOC=$(require_ioc "${iocsh_bash_id}") +# We define HOSTNAME + iocsh_id +IOCSH_PS1=$(iocsh_ps1 "${iocsh_id}") +REQUIRE_IOC=$(require_ioc "${iocsh_id}") # # Default Initial Startup file for REQUIRE and minimal environment # Create TMP_PATH path in order to keep tmp files secure until diff --git a/require-ess/tools/iocsh_complete.bash b/require-ess/tools/iocsh_complete.bash index af3ab3fe7899f54e3c32dce3df0df1dca7209ccc..c3dfe1e66eeae548142dd6491ad3bddeb4f001b6 100644 --- a/require-ess/tools/iocsh_complete.bash +++ b/require-ess/tools/iocsh_complete.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -_iocsh_bash_completion() { +_iocsh_completion() { local cur prev opts mods COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" @@ -38,4 +38,4 @@ _iocsh_bash_completion() { mapfile -t COMPREPLY < <(compgen -f -- "${cur}") } -complete -o filenames -o nospace -o bashdefault -F _iocsh_bash_completion iocsh.bash +complete -o filenames -o nospace -o bashdefault -F _iocsh_completion iocsh diff --git a/require-ess/tools/iocsh_functions.bash b/require-ess/tools/iocsh_functions.bash index 4562146f2e5a6985def1cdd1b87b4babc5a23ed1..9c4b12e9ba37f92e273fc69c2380374e7b850594 100644 --- a/require-ess/tools/iocsh_functions.bash +++ b/require-ess/tools/iocsh_functions.bash @@ -25,7 +25,6 @@ # email : simon.rose@ess.eu # date : 2021-12-10 # -# REALTIME= __LOADER__= @@ -432,9 +431,9 @@ function set_e3_cmd_top() { function help() { { printf "\n" - printf "USAGE: iocsh.bash [startup files]\n" + printf "USAGE: iocsh [startup files]\n" printf "\n" - printf "Start the ESS iocsh.bash and load startup scripts.\n\n" + printf "Start the ESS iocsh and load startup scripts.\n\n" printf "Options:\n\n" printf " -?, -h, --help Show this page and exit.\n" printf " -v, --version Show version and exit.\n" @@ -461,13 +460,13 @@ function help() { printf "All other files are executed as startup scripts by the EPICS shell.\n" printf "After a file you can specify substitutions like m1=v1 m2=v1 for that file.\n\n" printf "Examples:\n" - printf " iocsh.bash st.cmd\n" - printf " iocsh.bash my_database.template P=XY M=3\n" - printf " iocsh.bash -r my_module,version -c 'initModule()'\n" - printf " iocsh.bash -c 'var requireDebug 1' st.cmd\n" - printf " iocsh.bash -i st.cmd\n" - printf " iocsh.bash -dv --dvarg='--vgdb=full'\n" - printf " iocsh.bash -dv st.cmd\n\n" + printf " iocsh st.cmd\n" + printf " iocsh my_database.template P=XY M=3\n" + printf " iocsh -r my_module,version -c 'initModule()'\n" + printf " iocsh -c 'var requireDebug 1' st.cmd\n" + printf " iocsh -i st.cmd\n" + printf " iocsh -dv --dvarg='--vgdb=full'\n" + printf " iocsh -dv st.cmd\n\n" } >&2 exit } diff --git a/require-ess/tools/setE3Env.bash b/require-ess/tools/setE3Env.bash index 6663a44005f462559844749df6e2fdf5fa92d6eb..4b685043395ecad57c26166c3a7eb31f2ebbf045 100644 --- a/require-ess/tools/setE3Env.bash +++ b/require-ess/tools/setE3Env.bash @@ -220,7 +220,7 @@ LD_LIBRARY_PATH=$(set_variable "${old_ld_path}" "${E3_LD_LIBRARY_PATH}") export LD_LIBRARY_PATH -# Add iocsh.bash autocompletion +# Add iocsh autocompletion # shellcheck source=require-ess/tools/iocsh_complete.bash source "${SRC_PATH}"/iocsh_complete.bash diff --git a/tests/utils.py b/tests/utils.py index d44e21127d2483e0b744540f691d841c49663e0f..2ef7a92d79c46092f242d96e32f8cff7c24d226e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -7,6 +7,8 @@ def run_ioc_get_output(module, version, cell_path): """ Run an IOC and try to load the test module """ - with IOC("-r", f"{module},{version}", "-l", cell_path) as ioc: + with IOC( + "-r", f"{module},{version}", "-l", cell_path, ioc_executable="iocsh" + ) as ioc: time.sleep(1) return ioc.proc.returncode, ioc.outs, ioc.errs diff --git a/tools/README.md b/tools/README.md index f22f0c81db58de52199d22a6dd766e6478893e73..39bf3fafbc314a862b7995e02aa322a60a90b096 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,17 +1,17 @@ -iocsh.bash +iocsh ==== ## E3 Unique Variables ``` E3_CMD_TOP : the absolute path where a startup script (cmd file) is -E3_IOCSH_TOP : the absolute path where the iocsh.bash is executed +E3_IOCSH_TOP : the absolute path where the iocsh is executed ``` -For example, one executes the iocsh.bash ```${HOME}``` to call ```e3_local/cmds``` via +For example, one executes the iocsh ```${HOME}``` to call ```e3_local/cmds``` via ```sh -$ iocsh.bash e3_local/cmds/iocStats.cmd +$ iocsh e3_local/cmds/iocStats.cmd ``` In this case, ```E3_CMD_TOP``` is defined as ```"${HOME}/e3_local/cmds"```