Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: csh build failures due to error in build script #1669

Closed
2 tasks done
shahzebsiddiqui opened this issue Nov 20, 2023 · 0 comments
Closed
2 tasks done

[Bug]: csh build failures due to error in build script #1669

shahzebsiddiqui opened this issue Nov 20, 2023 · 0 comments
Assignees
Labels

Comments

@shahzebsiddiqui
Copy link
Member

Bug Description

Buildtest is unable to build the csh tests when running the following command.

(buildtest)  ~/Documents/GitHubDesktop/buildtest/ [fix_logic_buildscript] buildtest bd -e generic.local.csh
╭───────────────────────────────────────────── buildtest summary ─────────────────────────────────────────────╮                                                                                                                         
│                                                                                                             │                                                                                                                         
│ User:               siddiq90                                                                                │                                                                                                                         
│ Hostname:           DOE-7086392.vpn-dhcp.lbl.gov                                                            │                                                                                                                         
│ Platform:           Darwin                                                                                  │                                                                                                                         
│ Current Time:       2023/11/20 12:52:44                                                                     │                                                                                                                         
│ buildtest path:     /Users/siddiq90/Documents/GitHubDesktop/buildtest/bin/buildtest                         │                                                                                                                         
│ buildtest version:  1.7                                                                                     │                                                                                                                         
│ python path:        /Users/siddiq90/.local/share/virtualenvs/buildtest-KLOcDrW0/bin/python3                 │                                                                                                                         
│ python version:     3.11.4                                                                                  │                                                                                                                         
│ Configuration File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/buildtest/settings/config.yml         │                                                                                                                         
│ Test Directory:     /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests                             │                                                                                                                         
│ Report File:        /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/report.json                       │                                                                                                                         
│ Command:            /Users/siddiq90/Documents/GitHubDesktop/buildtest/bin/buildtest bd -e generic.local.csh │                                                                                                                         
│                                                                                                             │                                                                                                                         
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                                                                         
───────────────────────────────────────────────────────────────────────────────────────────────────────  Discovering Buildspecs ────────────────────────────────────────────────────────────────────────────────────────────────────────
                                Discovered buildspecs                                 
╔════════════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                          ║
╟────────────────────────────────────────────────────────────────────────────────────╢
║ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/environment.yml        ║
║ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/csh_shell_examples.yml ║
╚════════════════════════════════════════════════════════════════════════════════════╝
                       Buildspecs by Executor=generic.local.csh                       
╔════════════════════════════════════════════════════════════════════════════════════╗
║ buildspecs                                                                         ║
╟────────────────────────────────────────────────────────────────────────────────────╢
║ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/environment.yml        ║
║ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/csh_shell_examples.yml ║
╚════════════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  2
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  2
────────────────────────────────────────────────────────────────────────────────────────────────────────── Parsing Buildspecs ──────────────────────────────────────────────────────────────────────────────────────────────────────────
Valid Buildspecs: 2
Invalid Buildspecs: 0
/Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/environment.yml: VALID
/Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/csh_shell_examples.yml: VALID
Total builder objects created: 4
                                                                                                        Builders by type=script                                                                                                        
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ builder                       ┃ type   ┃ executor           ┃ compiler ┃ nodes ┃ procs ┃ description                                           ┃ buildspecs                                                                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ bash_env_variables/274fd612   │ script │ generic.local.bash │ None     │ None  │ None  │ Declare environment variables in default shell (bash) │ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/environment.yml        │
├───────────────────────────────┼────────┼────────────────────┼──────────┼───────┼───────┼───────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────┤
│ csh_env_declaration/c4922b17  │ script │ generic.local.csh  │ None     │ None  │ None  │ csh shell example to declare environment variables    │ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/environment.yml        │
├───────────────────────────────┼────────┼────────────────────┼──────────┼───────┼───────┼───────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────┤
│ tcsh_env_declaration/04667652 │ script │ generic.local.csh  │ None     │ None  │ None  │ tcsh shell example to declare environment variables   │ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/environment.yml        │
├───────────────────────────────┼────────┼────────────────────┼──────────┼───────┼───────┼───────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────┤
│ csh_shell/61ad5d31            │ script │ generic.local.csh  │ None     │ None  │ None  │ csh shell example                                     │ /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials/csh_shell_examples.yml │
└───────────────────────────────┴────────┴────────────────────┴──────────┴───────┴───────┴───────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────┘
──────────────────────────────────────────────────────────────────────────────────────────────────────────── Building Test ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
bash_env_variables/274fd612: Creating test directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/environment/bash_env_variables/274fd612
bash_env_variables/274fd612: Creating the stage directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/environment/bash_env_variables/274fd612/stage
bash_env_variables/274fd612: Writing build script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/environment/bash_env_variables/274fd612/bash_env_variables_build.sh
csh_env_declaration/c4922b17: Creating test directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/csh_env_declaration/c4922b17
csh_env_declaration/c4922b17: Creating the stage directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/csh_env_declaration/c4922b17/stage
csh_env_declaration/c4922b17: Writing build script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/csh_env_declaration/c4922b17/csh_env_declaration_build.sh
tcsh_env_declaration/04667652: Creating test directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/tcsh_env_declaration/04667652
tcsh_env_declaration/04667652: Creating the stage directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/tcsh_env_declaration/04667652/stage
tcsh_env_declaration/04667652: Writing build script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/tcsh_env_declaration/04667652/tcsh_env_declaration_build.sh
csh_shell/61ad5d31: Creating test directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31
csh_shell/61ad5d31: Creating the stage directory: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/stage
csh_shell/61ad5d31: Writing build script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell_build.sh
──────────────────────────────────────────────────────────────────────────────────────────────────────────── Running Tests ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────────────────────────────────────────────────────────────────────────────────── Iteration 1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
bash_env_variables/274fd612 does not have any dependencies adding test to queue
csh_shell/61ad5d31 does not have any dependencies adding test to queue
csh_env_declaration/c4922b17 does not have any dependencies adding test to queue
tcsh_env_declaration/04667652 does not have any dependencies adding test to queue
    Builders Eligible to Run     
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder                       ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ bash_env_variables/274fd612   │
│ tcsh_env_declaration/04667652 │
│ csh_env_declaration/c4922b17  │
│ csh_shell/61ad5d31            │
└───────────────────────────────┘
bash_env_variables/274fd612: Current Working Directory : /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/environment/bash_env_variables/274fd612/stage
bash_env_variables/274fd612: Running Test via command: bash --norc --noprofile -eo pipefail bash_env_variables_build.sh
bash_env_variables/274fd612: Test completed in 0.030784 seconds
bash_env_variables/274fd612: Test completed with returncode: 0
bash_env_variables/274fd612: Writing output file -  /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/environment/bash_env_variables/274fd612/bash_env_variables.out
bash_env_variables/274fd612: Writing error file - /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/environment/bash_env_variables/274fd612/bash_env_variables.err
tcsh_env_declaration/04667652: Current Working Directory : /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/tcsh_env_declaration/04667652/stage
tcsh_env_declaration/04667652: Running Test via command: csh -ef tcsh_env_declaration_build.sh
tcsh_env_declaration/04667652 failed to submit job with returncode: 1
─────────────────────────────────────────────────────────────────────────────────────────── Error Message for tcsh_env_declaration/04667652 ────────────────────────────────────────────────────────────────────────────────────────────
Badly placed ()'s.

tcsh_env_declaration/04667652: Detected failure in running test, will attempt to retry test: 1 times
tcsh_env_declaration/04667652: Run - 1/1
tcsh_env_declaration/04667652: Running Test via command: csh -ef tcsh_env_declaration_build.sh
tcsh_env_declaration/04667652: failed to submit job with returncode: 1
tcsh_env_declaration/04667652: Test completed in 0.047736 seconds
tcsh_env_declaration/04667652: Test completed with returncode: 1
tcsh_env_declaration/04667652: Writing output file -  /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/tcsh_env_declaration/04667652/tcsh_env_declaration.out
tcsh_env_declaration/04667652: Writing error file - /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/tcsh_env_declaration/04667652/tcsh_env_declaration.err
csh_env_declaration/c4922b17: Current Working Directory : /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/csh_env_declaration/c4922b17/stage
csh_env_declaration/c4922b17: Running Test via command: csh -ef csh_env_declaration_build.sh
csh_env_declaration/c4922b17 failed to submit job with returncode: 1
──────────────────────────────────────────────────────────────────────────────────────────── Error Message for csh_env_declaration/c4922b17 ────────────────────────────────────────────────────────────────────────────────────────────
Badly placed ()'s.

csh_env_declaration/c4922b17: Detected failure in running test, will attempt to retry test: 1 times
csh_env_declaration/c4922b17: Run - 1/1
csh_env_declaration/c4922b17: Running Test via command: csh -ef csh_env_declaration_build.sh
csh_env_declaration/c4922b17: failed to submit job with returncode: 1
csh_env_declaration/c4922b17: Test completed in 0.036468 seconds
csh_env_declaration/c4922b17: Test completed with returncode: 1
csh_env_declaration/c4922b17: Writing output file -  /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/csh_env_declaration/c4922b17/csh_env_declaration.out
csh_env_declaration/c4922b17: Writing error file - /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/environment/csh_env_declaration/c4922b17/csh_env_declaration.err
csh_shell/61ad5d31: Current Working Directory : /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/stage
csh_shell/61ad5d31: Running Test via command: csh -ef csh_shell_build.sh
csh_shell/61ad5d31 failed to submit job with returncode: 1
───────────────────────────────────────────────────────────────────────────────────────────────── Error Message for csh_shell/61ad5d31 ─────────────────────────────────────────────────────────────────────────────────────────────────
Badly placed ()'s.

csh_shell/61ad5d31: Detected failure in running test, will attempt to retry test: 1 times
csh_shell/61ad5d31: Run - 1/1
csh_shell/61ad5d31: Running Test via command: csh -ef csh_shell_build.sh
csh_shell/61ad5d31: failed to submit job with returncode: 1
csh_shell/61ad5d31: Test completed in 0.050015 seconds
csh_shell/61ad5d31: Test completed with returncode: 1
csh_shell/61ad5d31: Writing output file -  /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.out
csh_shell/61ad5d31: Writing error file - /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.err
                                                        Test Summary                                                         
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ builder                       ┃ executor           ┃ status ┃ checks (ReturnCode, Regex, Runtime) ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ tcsh_env_declaration/04667652 │ generic.local.csh  │ FAIL   │ None None None                      │ 1          │ 0.047736 │
├───────────────────────────────┼────────────────────┼────────┼─────────────────────────────────────┼────────────┼──────────┤
│ bash_env_variables/274fd612   │ generic.local.bash │ PASS   │ None None None                      │ 0          │ 0.030784 │
├───────────────────────────────┼────────────────────┼────────┼─────────────────────────────────────┼────────────┼──────────┤
│ csh_shell/61ad5d31            │ generic.local.csh  │ FAIL   │ None None None                      │ 1          │ 0.050015 │
├───────────────────────────────┼────────────────────┼────────┼─────────────────────────────────────┼────────────┼──────────┤
│ csh_env_declaration/c4922b17  │ generic.local.csh  │ FAIL   │ None None None                      │ 1          │ 0.036468 │
└───────────────────────────────┴────────────────────┴────────┴─────────────────────────────────────┴────────────┴──────────┘



Passed Tests: 1/4 Percentage: 25.000%
Failed Tests: 3/4 Percentage: 75.000%


Adding 4 test results to /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/report.json
Writing Logfile to: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/logs/buildtest_w_pn79fp.log

The main problem is we introduced the trap function and this syntax is not correct for csh.

(buildtest)  ~/Documents/GitHubDesktop/buildtest/ [fix_logic_buildscript] buildtest it query -o -e -b  csh_shell/61ad5d31
──────────────────────────────────────────────────────────────────────────────────────────── csh_shell/61ad5d31-57e1-4047-9557-8547c68e9cd8 ────────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.csh
Description: csh shell example
State: FAIL
Returncode: 1
Runtime: 0.050015 sec
Starttime: 2023/11/20 12:52:45
Endtime: 2023/11/20 12:52:45
Command: csh -ef csh_shell_build.sh
Test Script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.csh
Build Script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell_build.sh
Output File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.out
Error File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.err
Log File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/logs/buildtest_w_pn79fp.log
──────────────────────────────────────────── Output File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.out ────────────────────────────────────────────
                                                                                                                                                                                                                                        
──────────────────────────────────────────── Error File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell.err ─────────────────────────────────────────────
Badly placed ()'s.                                                                                                                                                                                                                      
                                                                                                                                                                                                                                        
────────────────────────────────────────── Test File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/csh_shell_build.sh ───────────────────────────────────────────
#!/bin/bash                                                                                                                                                                                                                             
                                                                                                                                                                                                                                        
# Function to handle all signals and perform cleanup                                                                                                                                                                                    
function cleanup() {                                                                                                                                                                                                                    
    echo "Signal trapped. Performing cleanup before exiting."                                                                                                                                                                           
    exitcode=$?                                                                                                                                                                                                                         
    echo "buildtest: command \`$BASH_COMMAND' failed (exit code: $exitcode)"                                                                                                                                                            
    exit $exitcode                                                                                                                                                                                                                      
}                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                        
# Trap all signals and call the cleanup function                                                                                                                                                                                        
trap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU                                                                                                                              
                                                                                                                                                                                                                                        
setenv BUILDTEST_TEST_NAME csh_shell                                                                                                                                                                                                    
setenv BUILDTEST_TEST_ROOT /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31                                                                                          
setenv BUILDTEST_BUILDSPEC_DIR /Users/siddiq90/Documents/GitHubDesktop/buildtest/tutorials                                                                                                                                              
setenv BUILDTEST_STAGE_DIR /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/stage                                                                                    
# source executor startup script                                                                                                                                                                                                        
source /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/executor/generic.local.csh/before_script.sh                                                                                                                                
# Run generated script                                                                                                                                                                                                                  
csh /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.csh/csh_shell_examples/csh_shell/61ad5d31/stage/csh_shell.csh                                                                                             
# Get return code                                                                                                                                                                                                                       
set returncode = $status                                                                                                                                                                                                                
# Exit with return code                                                                                                                                                                                                                 
exit $returncode

Steps to reproduce the error

buildtest bd -e generic.local.csh

Version and HEAD commit

devel

Relevant log output

No response

Post question in Slack

  • I agree that I posted my question in slack before creating this issue

Is there an existing issue

  • I confirm there is no existing issue for this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant