From 63869b4d93ed85d0c08e94b5958f359d8f39bf14 Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Thu, 13 Jul 2023 15:06:33 -0400 Subject: [PATCH 1/8] add csh shell test for installation workflow --- .github/workflows/installation.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index 44aa967e7..de7d7144a 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -24,7 +24,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: "Install Zsh and Tcsh" + - name: "Install zsh and tcsh" run: | if [[ ${{ matrix.os }} == 'ubuntu-latest' ]]; then sudo apt-get install -y tcsh zsh @@ -53,6 +53,17 @@ jobs: which buildtest buildtest --help + - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - csh + env: + OS: '${{ matrix.os }}' + shell: csh {0} + run: | + echo "$SHELL" + pip install -U pip + source setup.sh + which buildtest + buildtest --help + - uses: actions/checkout@v3 - name: Setup tmate session if: ${{ failure() }} From 37b44aafea9fa38f9c610ff4c375f9ac0c96c4fd Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Thu, 13 Jul 2023 15:34:59 -0400 Subject: [PATCH 2/8] fix bug in installation workflow with csh enable printing output of each command when running in CI job --- .github/workflows/installation.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index de7d7144a..b5d0ef1de 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -32,10 +32,9 @@ jobs: brew install tcsh zsh fi - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - bash - env: - OS: '${{ matrix.os }}' shell: bash - run: | + run: | + set -v echo "$SHELL" pip install -U pip source setup.sh @@ -43,10 +42,9 @@ jobs: buildtest --help - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - zsh - env: - OS: '${{ matrix.os }}' shell: zsh {0} - run: | + run: | + set -v echo "$SHELL" pip install -U pip source setup.sh @@ -54,13 +52,12 @@ jobs: buildtest --help - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - csh - env: - OS: '${{ matrix.os }}' shell: csh {0} - run: | + run: | + set echo echo "$SHELL" pip install -U pip - source setup.sh + source setup.csh which buildtest buildtest --help From ba85d8e56745ff0278514419c569f03f6366619d Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Thu, 13 Jul 2023 15:54:01 -0400 Subject: [PATCH 3/8] remove set echo and set -v used for debugging --- .github/workflows/installation.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index b5d0ef1de..e26460a39 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -34,7 +34,6 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - bash shell: bash run: | - set -v echo "$SHELL" pip install -U pip source setup.sh @@ -44,7 +43,6 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - zsh shell: zsh {0} run: | - set -v echo "$SHELL" pip install -U pip source setup.sh @@ -54,7 +52,6 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - csh shell: csh {0} run: | - set echo echo "$SHELL" pip install -U pip source setup.csh From 235420ca2ea74709cd82df9cc4d7c5c455a60948 Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Mon, 1 Jul 2024 12:34:36 -0400 Subject: [PATCH 4/8] remove quotation marks from echo statement --- .github/workflows/installation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index 46b744a42..0bfe675d6 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -34,7 +34,7 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - bash shell: bash run: | - echo "$SHELL" + echo $SHELL pip install -U pip source setup.sh which buildtest @@ -43,7 +43,7 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - zsh shell: zsh {0} run: | - echo "$SHELL" + echo $SHELL pip install -U pip source setup.sh which buildtest @@ -52,7 +52,7 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - csh shell: csh {0} run: | - echo "$SHELL" + echo $SHELL pip install -U pip source setup.csh which buildtest From 619a63cc9f00aadc82b00899793eb778c47f7e63 Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Mon, 1 Jul 2024 12:40:47 -0400 Subject: [PATCH 5/8] change to echo $shell for csh test step --- .github/workflows/installation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index 0bfe675d6..e56628392 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -52,7 +52,7 @@ jobs: - name: Buildtest Installation for os - ${{ matrix.os }}, python version - ${{ matrix.python-version }}, shell - csh shell: csh {0} run: | - echo $SHELL + echo $shell pip install -U pip source setup.csh which buildtest From 2db40d445a38cac4c686834956bcd1f4b6887850 Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Mon, 1 Jul 2024 13:14:02 -0400 Subject: [PATCH 6/8] use a builtin ps command to determine shell --- setup.csh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.csh b/setup.csh index bbb55865d..4caf1aa2d 100755 --- a/setup.csh +++ b/setup.csh @@ -24,8 +24,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +# Get the name of the current shell +set shell_name = `ps -p $$ -o comm=` + # if shell is not csh or tcsh exit -if (`basename "$SHELL"` != "csh" && `basename "$SHELL"` != "tcsh") then +if ($shell_name != "csh" && "$shell_name" != "tcsh") then echo "Unsupported shell, please use 'csh' or 'tcsh' when sourcing this script" exit 1 endif From 24a803befb4ac95852c73228e05cba0e7355f8a7 Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Mon, 1 Jul 2024 13:18:06 -0400 Subject: [PATCH 7/8] need to use basename since value of shell_name is a full patch to shell --- setup.csh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.csh b/setup.csh index 4caf1aa2d..99dc71d4b 100755 --- a/setup.csh +++ b/setup.csh @@ -28,7 +28,7 @@ set shell_name = `ps -p $$ -o comm=` # if shell is not csh or tcsh exit -if ($shell_name != "csh" && "$shell_name" != "tcsh") then +if (`basename $shell_name` != "csh" && `basename $shell_name` != "tcsh") then echo "Unsupported shell, please use 'csh' or 'tcsh' when sourcing this script" exit 1 endif From 939a2e48c193b70103a29836bf455f99efb22e53 Mon Sep 17 00:00:00 2001 From: Shahzeb Siddiqui Date: Mon, 1 Jul 2024 13:41:03 -0400 Subject: [PATCH 8/8] the command utility may not be found so we will use 'which' --- setup.csh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.csh b/setup.csh index 99dc71d4b..01f9acc1d 100755 --- a/setup.csh +++ b/setup.csh @@ -71,7 +71,7 @@ curl https://bootstrap.pypa.io/get-pip.py | $python set pip=pip3 -if ( ! -x `command -v $pip` ) then +if ( ! -x `which $pip` ) then # If not found in PATH, check $HOME/.local/bin if ( -x "$HOME/.local/bin/$pip" ) then echo "$pip found in $HOME/.local/bin"