Skip to content

byobu: add tmux to $PATH#8629

Closed
matthiasdiener wants to merge 1 commit intospack:developfrom
matthiasdiener:byobu
Closed

byobu: add tmux to $PATH#8629
matthiasdiener wants to merge 1 commit intospack:developfrom
matthiasdiener:byobu

Conversation

@matthiasdiener
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@healther healther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this taken care of by the depends_on(... type='run')?

@hartzell
Copy link
Copy Markdown
Contributor

hartzell commented Jul 3, 2018

On my system the lua modulefile for byobu includes

if not isloaded("tmux/2.7-7sgiyx2") then
    load("tmux/2.7-7sgiyx2")
end

and loading it adds the tmux bin to my PATH.

The dependency in the copy of the byobu package that I have is:

    depends_on('tmux', type=('build', 'run'))

with no extra environment setup.

@matthiasdiener
Copy link
Copy Markdown
Contributor Author

Without this patch, when I run spack load byobu, tmux does not get added to the $PATH, and byobu can not be run (despite the depends_on(... type='run')) :

/Users/mdiener/Work/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/byobu-5.125-qymgjvuj6y667efuayssriaqyto75qev/bin/byobu: line 238: exec: tmux: not found

@hartzell
Copy link
Copy Markdown
Contributor

hartzell commented Jul 3, 2018

I use Lmod modules and don't go through spack load. I'm not sure how it decides what modules tool to load.

Do you have any modulefiles for byobu (under share/spack/)? What does your modules configuration look like (have you overridden any of the defaults?)

Is your shell set up to use modules (e.g. does module avail do anything interesting?)?

@matthiasdiener
Copy link
Copy Markdown
Contributor Author

matthiasdiener commented Jul 3, 2018

As far as I understand, spack load never loads any dependencies.

I do have module files for byobu and tmux under share/spack. I didn't change any module configuration (as I am on Mac OS, I'm using spack bootstrap for modules).

module avail shows the byobu and tmux modules.

@adamjstewart
Copy link
Copy Markdown
Member

@hartzell I just tested this on macOS and without any changes to the default modules.yaml (aside from enabling LMod and setting a core_compiler), none of the 3 modules systems autoload 'run' dependencies by default.

This problem affects hundreds of packages in Spack, not just byobu. I would like to see a more general solution than manually adding 'run' dependencies to module files. I'm going to open up another issue for this.

@healther
Copy link
Copy Markdown
Contributor

healther commented Jul 4, 2018

I used to use

spack load -r <mypackage>

or

spack module loads -r <mypackage>

to effectively do the autoload thing manually. But I never completely understood how the module system was supposed to be used. I, as a user, always expected spack load to just work ™️, which would require autoload in all modules. For some reason, that I don't remember anymore, this didn't get picked up

@hartzell
Copy link
Copy Markdown
Contributor

hartzell commented Jul 4, 2018

@adamjstewart ...

@hartzell I just tested this on macOS and without any changes to the default modules.yaml (aside from enabling LMod and setting a core_compiler), none of the 3 modules systems autoload 'run' dependencies by default.

Hmmm. I just checked out a clean tree, built byobu, added this etc/spack/modules.yaml file

modules:
  enable::
    - lmod
    - tcl
  lmod:
    core_compilers:
      - '[email protected]'

and generated the lmod modulefiles with

spack module refresh --module-type lmod --delete-tree -y

I got the same result you got: neither the tcl nor the Lmod modulefiles autoloaded tmux.

Then I added a bit from my standard modules.yaml that should generate autoloads for packages that depend on python (following the documentation, the resulting modules.yaml file contained:

modules:
  enable::
    - lmod
    - tcl
  lmod:
    core_compilers:
      - '[email protected]'
    ^python:
      autoload:  'direct'

The resulting byobu Lmod modulefile contained:

if not isloaded("tmux/2.7-2b6gc3z") then
    load("tmux/2.7-2b6gc3z")
end

@alalazo -- I expected this line to only generate autoloads for things that depend on python. byobu does not seem to depend on Python:

[hartzell@bunny spack]$ spack spec -t byobu
Input spec
--------------------------------
[    ]  byobu

Concretized
--------------------------------
[    ]  [email protected]%[email protected] arch=linux-centos7-x86_64
[b r ]      ^[email protected]%[email protected] arch=linux-centos7-x86_64
[bl  ]          ^[email protected]%[email protected]+openssl arch=linux-centos7-x86_64
[bl  ]              ^[email protected]%[email protected]+systemcerts arch=linux-centos7-x86_64
[bl  ]                  ^[email protected]%[email protected]+optimize+pic+shared arch=linux-centos7-x86_64
[bl  ]          ^[email protected]%[email protected]~symlinks~termlib arch=linux-centos7-x86_64
[b   ]              ^[email protected]%[email protected] arch=linux-centos7-x86_64

[hartzell@bunny spack]$

Is this a bug or a SNAFU on my part?

@matthiasdiener matthiasdiener force-pushed the byobu branch 2 times, most recently from 41c4537 to 364bf89 Compare October 13, 2018 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants