|
| 1 | +--- |
| 2 | +authors: |
| 3 | + - branfosj |
| 4 | +date: 2025-08-09 |
| 5 | +slug: interactive-shell |
| 6 | +hide: |
| 7 | + - navigation |
| 8 | +--- |
| 9 | + |
| 10 | +# Interactive Shell to Debug Failed Builds |
| 11 | + |
| 12 | +One of the big enhancements in EasyBuild v5 is the support for starting an [interactive shell to debug failed builds](https://docs.easybuild.io/interactive-debugging-failing-shell-commands/) |
| 13 | +by simply running the auto-generated `cmd.sh` script. |
| 14 | + |
| 15 | +We would all prefer that no installation ever fails, but there will be times when they do. |
| 16 | + |
| 17 | +The new interactive shell feature provides a way to explore the build environment and debug the failure. |
| 18 | + |
| 19 | +<!-- more --> |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Demo |
| 24 | + |
| 25 | +In the following demo, `bzip2-1.0.8.eb` is being built on an Ubuntu 25.04 (Plucky Puffin) system. |
| 26 | +This build uses the `SYSTEM` toolchain, which means that the default system compiler provided by the OS is used - in this case GCC v13.3.0 (`gcc` command). |
| 27 | + |
| 28 | +{{ |
| 29 | +asciinema( |
| 30 | + '../../interactive-shell-demo-bzip.cast', |
| 31 | + idleTimeLimit=3, |
| 32 | + cols=108, |
| 33 | + rows=25, |
| 34 | + markers=[ |
| 35 | + [0, "Start installation"], |
| 36 | + [11, "Build failure"], |
| 37 | + [15, "Enter interactive debug environment"], |
| 38 | + [18, "Repeat failed command"], |
| 39 | + [23, "Explore environment"], |
| 40 | + [32, "Exit environment"] |
| 41 | + ], |
| 42 | +) |
| 43 | +}} |
| 44 | + |
| 45 | +The failure is because of an incompatibility between the older `binutils` (v2.37, defined as build dependency in the easyconfig file) and the newer GCC. |
| 46 | + |
| 47 | +### The 6 stages of the demo |
| 48 | + |
| 49 | +1. *[00:00]* Installing `bzip2` with EasyBuild: `eb bzip2-1.0.8.eb` (all dependencies have been pre-installed); |
| 50 | +2. *[00:11]* Installation fails in `build` step; |
| 51 | +3. *[00:15]* Enter interactive debug environment by running the `cmd.sh` script; |
| 52 | +1. *[00:18]* Repeat the failed command from shell history (arrow up), see why the build failed; |
| 53 | +1. *[00:23]* Explore the environment: |
| 54 | + - List the loaded modules (`module list`); |
| 55 | + - Check the value of the environment variable `CC` (`echo $CC`); |
| 56 | +1. *[00:32]* Exiting the interactive debug environment by running `exit`; |
| 57 | + |
| 58 | +### Avoiding this problem |
| 59 | + |
| 60 | +If you experience this failure then you should be able to build `bzip2-1.0.8.eb` using both the OS `gcc` and `binutils`. |
| 61 | +You can instruct EasyBuild to do this using [`--filter-deps=binutils`](https://docs.easybuild.io/manipulating-dependencies/#filter_deps). |
| 62 | + |
0 commit comments