eic / EICrecon

EIC Reconstruction - JANA based
https://eic.github.io/EICrecon
GNU Lesser General Public License v3.0
6 stars 28 forks source link

`source thisroot.sh` removes `/usr/local/bin` from `$PATH` in `eic-shell` #387

Closed c-dilks closed 1 year ago

c-dilks commented 1 year ago

Environment: (where does this bug occur, have you tried other environments)

Steps to reproduce: (give a step by step account of how to trigger the bug)

I'm certain I've seen someone else open this issue before, but I can't find it. Check $PATH before and after the source:

eic-shell
echo $PATH | sed 's/:/\n/g' > path_before
source /usr/local/bin/thisroot.sh
echo $PATH | sed 's/:/\n/g' > path_after
diff path_{before,after}

In some sense this is ROOT's fault, but we call this source thisroot.sh when we call source eicrecon-this.sh. A quick workaround is to put /usr/local/bin back in the $PATH in src/scripts/eicrecon-this.sh.in

Expected Result: (what do you expect when you execute the steps above)

From the diff command:

0a1
> /opt/software/linux-debian-x86_64/gcc-12.2.0/root-6.26.06-sh25v2drevvql6chglrpqxv4p5dtsiow/bin

Actual Result: (what do you get when you execute the steps above)

From the diff command:

0a1
> /opt/software/linux-debian-x86_64/gcc-12.2.0/root-6.26.06-sh25v2drevvql6chglrpqxv4p5dtsiow/bin
4d4
< /usr/local/bin

Try to run cmake (installed at /usr/local/bin):

jug_xl> dilks@arcturus:~$ cmake
bash: cmake: command not found
faustus123 commented 1 year ago

This issue is also listed in JANA2 here:

[https://github.com/JeffersonLab/JANA2/issues/174]()

You assessment of the issue is correct. Adding /usr/local/bin back in in eicrecon-this.sh is a good solution that can be addressed immediately.

I think the best solution (aside from ROOT fixing it) will be to unset the ROOTSYS envar in the jana-this.sh script before thisroot.sh is sourced. That will be in the next JANA2 release. In the meantime, you can unset it yourself before sourcing eicrecon-this.sh.