environment.py: allow link:run#29336
Conversation
Some users want minimal views, excluding run-type dependencies, since
those type of dependencies are covered by rpaths and the symlinked
libraries in the view aren't used anyways.
With this change, an environment like this:
```
spack:
specs: ['py-flake8']
view:
default:
root: view
link: run
```
includes python packages and python, but no link type deps of python.
cfeb778 to
6c960af
Compare
|
@lee218llnl let me know if this works for you. would be great to get this, followed by #29317, so that we can move towards faster / immutable / atomic views everywhere (and simplify spack even more, since that does not require packages/spack to "undo" modifications to views per spec) |
|
I found a few cases where this doesn't quite do what I want and have done prior to this PR. Consider this env: The resulting bin directory in the view looks like this: The gtk packages are dependences of py-xdot, but I do not want gtk in my view. In addition, we install the python binding for conduit in our python installation, but don't necessarily want conduit itself in the view. I realize that conduit is explicitly specified in my environment, so perhaps I will test to see if "exclude" will help in this case. Our use case here may not map perfectly to environment views, but I will see if it is close enough that I can put in a few workarounds like exclude. |
|
Using exclude: [gtkplus, gdk-pixbuf] removes the symlinks for those packages and still allows py-xdot to work. However, and perhaps not a surprise, exclude: [conduit] completely excludes conduit, so I cannot import it when running python through the view. Of course, in my ideal world ,there would be an equivalent to the way I currently activate packages in to my python installation, but I realize this may not warrant supporting if it's just us. If you were to leave it as is, I could exclude all the dependences and packages like conduit, and then for packages like conduit, I can manually link it in to my view. I should also admit that in my current workflow with active, I take the list of "py-*" packages in my spack.yaml and create a shell script that does a @tgamblin do you have any advice on how to proceed? I guess I am OK with this PR as is, but if anyone has a suggestion on how to support our python use case directly in spack, I would appreciate it. |
|
How did you handle conduit previously? Did it somehow only symlink part of the prefix, not the entire prefix? Regarding py-xdot, I would not be surprised if it incorrectly specifies link-type dependencies as run-type dependencies. |
|
Now that I look back at my notes, you may be right about conduit. It looks like I don't activate conduit, but rather symlink just the site-packages directory. That said there is no loss of functionality there. Sorry that I had forgotten this and thanks for the reminder. |
lee218llnl
left a comment
There was a problem hiding this comment.
I think with this PR, I have enough of the functionality that I need to deploy our standalone python.
|
if @lee218llnl has enough to do the deployment w/this PR then I think I'm happy with it. For some of the stuff above, we should probably revisit deptypes in dependencies as @haampie suggests. I think I agree with @haampie that this is better than having something that only links in |
Some users want minimal views, excluding transitive link-type dependencies, since
those type of dependencies are covered by rpaths and the symlinked
libraries in the view aren't used anyways.
With this change, an environment like this:
includes
['py-flake8', 'py-mccabe', 'python', 'py-pycodestyle', 'py-setuptools', 'py-pyflakes'], but no link type deps of python.With
link: allit would includes a lot of "unnecessary" specs:['py-flake8', 'py-mccabe', 'python', 'bzip2', 'expat', 'libbsd', 'libmd', 'gdbm', 'readline', 'ncurses', 'gettext', 'libiconv', 'libxml2', 'xz', 'zlib', 'tar', 'libffi', 'openssl', 'sqlite', 'util-linux-uuid', 'py-pycodestyle', 'py-setuptools', 'py-pyflakes']even when build type deps are already omitted.This is a requirement to get #29317 in.