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

[proposal]: Add custom paths/settings to environment modules #1109

Closed
mwilliammyers opened this issue Jun 24, 2016 · 4 comments · Fixed by #1361
Closed

[proposal]: Add custom paths/settings to environment modules #1109

mwilliammyers opened this issue Jun 24, 2016 · 4 comments · Fixed by #1361

Comments

@mwilliammyers
Copy link
Contributor

I think you can already add custom paths eg. export PYTHONHOME to a generated environment module using this method in package.py but it would be nice to be able to not have to modify the package.py file or override it with another local package.

I am thinking something like this for the modules.yaml config:

modules:
  ...
  jdk:
    set_env:
      - JAVA_HOME: $prefix
  foo:
    prepend_path:
      - BAR: $prefix.lib
    append_path:
      - BAZ: $prefix.include

Where you can reference any of the prefix attribute variables listed here.

@mwilliammyers mwilliammyers changed the title [feature request]: Add custom paths/settings to environment modules [proposal]: Add custom paths/settings to environment modules Jun 29, 2016
@tgamblin
Copy link
Member

tgamblin commented Jul 5, 2016

I like it!

@alalazo
Copy link
Member

alalazo commented Jul 5, 2016

Can I suggest :

modules:
  ...
  jdk:
    set_env:
      - JAVA_HOME: {prefix}
  foo:
    prepend_path:
      - BAR: {prefix.lib}
    append_path:
      - BAZ: {prefix.include}

in that way you may use python string formatting capabilities out of the box 😄

@alalazo
Copy link
Member

alalazo commented Jul 6, 2016

@mwilliammyers I have received a bunch of user feedback for our modules and I'll need to generate something like what you propose, with the only difference that I'll need to permit some token expansion also on the keys, e.g. :

modules:
    prefix_inspections:
      '':
      - '{name}_ROOT'
    tcl:
      all:
        environment:
          set:
            '{name}_FOO': '{ver}'

Did you start already working on this? In case, would it make sense to you to work together in #1135 ? @tgamblin ?

@mwilliammyers
Copy link
Contributor Author

mwilliammyers commented Jul 19, 2016

@alalazo sorry this one/your most recent comment slipped by me. I am currently revamping the opencv package because I need to get that installed. I am almost done with that and so I would be happy to work on this with you, if it is not too late.

alalazo added a commit to epfl-scitas/spack that referenced this issue Jul 25, 2016
alalazo added a commit to epfl-scitas/spack that referenced this issue Jul 25, 2016
alalazo added a commit to epfl-scitas/spack that referenced this issue Aug 4, 2016
mamelara pushed a commit to mamelara/spack that referenced this issue Aug 9, 2016
olupton pushed a commit to olupton/spack that referenced this issue Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants