Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-23393

loadLSST.bash (unnecessarily?) sets miniconda bin path dangerously

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: lsstsw
    • Labels:
      None
    • Team:
      Architecture
    • Urgent?:
      No

      Description

      I found out that executing loadLSST.bash twice causes the wrong miniconda bin path to be exposed to the shell. This is because here the base miniconda bin directory is prepended to the PATH, however if the virtualenv has already been activated, it does not activate again and the miniconda bin shadows the virtualenv bin path and this means different modules are available than expected.

      I'm pretty sure that line can simply be removed since the source activate should set the correct path in any case. If it cannot be removed, it should be an append so that sourcing the file multiple times does not end up in a confusing state.

      FWIW, I think this is also a problem for the other shell specific files, but have not checked for sure.

        Attachments

          Activity

          Hide
          ktl Kian-Tat Lim added a comment - - edited

          Without that PATH entry, though, the user has no way of finding the activate script. So I think the proper replacement is to remove the PATH setting and instead have

          source ${miniconda_path}/bin/activate "\${LSST_CONDA_ENV_NAME}"

          Can you try this and see if it works for you?

          Show
          ktl Kian-Tat Lim added a comment - - edited Without that PATH entry, though, the user has no way of finding the activate script. So I think the proper replacement is to remove the PATH setting and instead have source ${miniconda_path}/bin/activate "\${LSST_CONDA_ENV_NAME}" Can you try this and see if it works for you?
          Hide
          krughoff Simon Krughoff added a comment -

          Good point about finding activate. I'll try your suggestion.

          Show
          krughoff Simon Krughoff added a comment - Good point about finding activate . I'll try your suggestion.
          Hide
          krughoff Simon Krughoff added a comment -

          This does seem to do the trick. Note I just edited my loadLSST.bash and confirmed that I could source it multiple times without losing the path to my virtualenv python: loadLSST.bash

          Show
          krughoff Simon Krughoff added a comment - This does seem to do the trick. Note I just edited my loadLSST.bash and confirmed that I could source it multiple times without losing the path to my virtualenv python: loadLSST.bash
          Hide
          ktl Kian-Tat Lim added a comment -

          Josh and Simon looked at this; I'm hoping that counts as enough review.

          Show
          ktl Kian-Tat Lim added a comment - Josh and Simon looked at this; I'm hoping that counts as enough review.

            People

            Assignee:
            ktl Kian-Tat Lim
            Reporter:
            krughoff Simon Krughoff
            Watchers:
            Jim Bosch, John Swinbank, Kian-Tat Lim, Simon Krughoff, Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.