Git's gitk needs TK's wish to be found in PATH#8360
Git's gitk needs TK's wish to be found in PATH#8360adamjstewart merged 3 commits intospack:developfrom
Conversation
* Add a _runtime_ dependency on `tk` * Add an environment rule to add the path to TK's `wish` program to $PATH for the generated `git` modulefile.
|
This should definitely be a variant. It looks like |
healther
left a comment
There was a problem hiding this comment.
I'm not sure how I feel about tk being an unconditional dependency of git though ... Is there an option to build git without gitk?
| self.spec['gettext'].prefix.include)) | ||
|
|
||
| # gitk requires tk's wish to be found in $PATH. | ||
| run_env.prepend_path('PATH', self.spec['tk'].prefix.bin) |
There was a problem hiding this comment.
this is only executed at build time, just make the dependency of type ('build', 'run') and you will be fine.
|
@adamjstewart @healther Maybe I don't understand how I have provided an update to this PR to make my changes optional. |
|
This looks good to me now. As for the @alalazo may have opinions on this. |
|
I'm uncomfortable with including dependencies' stuff in module files in an ad-hoc manner. There are TONS of cases where module B must be loaded for module A to work; in fact, that is almost always the case, except in the case of RPATH'd binaries. Anyone using Python, R, etc. must load tons of modules to get anything to work. I would prefer a general solution that handles module dependencies. |
healther
left a comment
There was a problem hiding this comment.
I'm still uncertain about the environment setting. If I understand our module generation (note: I don't really use these at all) correctly, then a module generates ONLY the environment for the specific package, it is the user's job to make sure that the dependencies are also module loaded or otherwise add the autoload stuff to the module generation.
So my questions are essentially: 1) In how far is this not consistent with how other modules behave? and 2) Is this a sensible behaviour in the first place?
I think the answer to 1) is "It is consistent" (which imho would mean remove the environment setting from this PR)
but the more problematic one is 2). The fundamental building block of spack is a DAG, if so shouldn't the provided modules reflect that? But this is a larger discussion and separate from adding the depends_on('tk'.
|
I agree with @citibeth that a module-specific solution would be better. However, such a solution isn't available right now and, as it stands, the git recipe is installing an applications that doesn't work. Since Tcl/Tk is not an unusual environment or one that is likely to conflict with other installed packages, I consider this to be a low risk addition. The variant provided in my PR essentially provides a Also, my experience is different from @adamjstewart, in that essentially everyone that uses these git installations also use As I see it, there are two issues discussed here:
|
|
I agree with @KineticTheory, this probably needs to be merged. At the same time, I'm hoping we can use this issue to raise awareness and discussion on the use of Spack where recursive module loading is needed --- which is basically everywhere, except for RPATH'd binaries. See my rant here: |
|
@KineticTheory Can you comment on #8153? It could also be relevant to your experience here; and we need to get it merged. |
|
I'm not against merging it, but I think there is a way to do it with the module generation right now. The problem is, that I actually don't use this, so I don't have first hand knowledge, but iirc you can tell |
|
@alalazo But wouldn't it be better (in the long run) if this information on recursive loading were provided in the |
|
Am I missing something? The information is there in the |
Almost... it depends on the package you're depending on. The alternative is to just recursively load all modules, i.e. load anything where we see |
but isn't that exactly the difference between a ^Sure for |
|
I suppose so. So far, auto-loading everything has worked out well enough
for me, so I haven't put in any effort to be more precise. And getting
Spack Environments merged is a higher priority for me.
…On Wed, Jun 6, 2018 at 10:53 AM, healther ***@***.***> wrote:
it depends on the package you're depending on. depends_on('zlib') does not
require a recursive module load, but depends_on('py-numpy') does
but isn't that exactly the difference between a link and a run
dependency? Btw zlib is a poor example as it doesn't have any
dependencies itself so autoload would be a noop right?
^Sure for run dependencies one could also subdivide which of the
environment variables are really necessary, but that's an optimisation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8360 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB1cd-Nub7rEaWTtCS36TIRGoyeIISRKks5t5-z2gaJpZM4UZUM4>
.
|
There was a problem hiding this comment.
Just my point of view, not a strict request. Git configure help says:
--with-tcltk use Tcl/Tk GUI (default is YES)
ARG is the full path to the Tcl/Tk interpreter.
Bare --with-tcltk will make the GUI part only if
Tcl/Tk interpreter will be found in a system.I would be for adding an explicit:
if '+tcltk' in self.spec
configure_args.append('--with-tcl-tk={0}'.format(self.spec['tk'].prefix.bin.wish))
else:
configure_args.append('--with-tcl-tk=NO') # Or whatever is the option to disable itand making tk a (build, link) dependency.
|
|
||
| # gitk requires tk's wish to be found in $PATH. | ||
| if '+tcltk' in self.spec: | ||
| run_env.prepend_path('PATH', self.spec['tk'].prefix.bin) |
There was a problem hiding this comment.
I think it's better to check:
if 'tk' in self.spec:
run_env.prepend_path('PATH', self.spec['tk'].prefix.bin)The way this statement is written right now is bound to fail when git is declared as an external (as the variant might be there, but the dependency is not).
There was a problem hiding this comment.
@adamjstewart @KineticTheory Forgot to mention: I don't know tcl and tk at all, but it seems to me that the situation here might be common for packages that depend on tk. If somebody could confirm this impression, I think the proper place where to modify the run_env is the setup_dependnent_environment of the tk package.
There was a problem hiding this comment.
@alalazo I must confess that I too am blissfully ignorant of tcl/tk environments. 😌
I'll implement your recommended changes in my branch and do a couple of test builds before I push the updates.
| depends_on('automake', type='build') | ||
| depends_on('libtool', type='build') | ||
| depends_on('m4', type='build') | ||
| depends_on('tk', type='run', when='+tcltk') |
There was a problem hiding this comment.
This might be a build dependency it we pass the correct path at run-time to --with-tcltk. I understand your point on tk not being strictly needed during compilation, but maybe it's worth considering:
- Making
tka(build, link)dependency conditional on the variant - Pass its prefix to the configure script if
+tcltk
|
The updates provided in 94e717e
Thanks to @alalazo, @citibeth, @healther, and @adamjstewart for helpful recommendations. |
Background
gitkdepends on TK at runtime. If TK'swishprogram isn't already on the system,gitkwill fail to launch.gitmodule file generated by spack to satisfy this requirement. This PR captures the requirement and automates the installation oftkand correct modulefile generation.Changes
tkwishprogram to$PATHfor the generatedgitmodulefile.Impact
spack install gitmust also buildtk. This is a somewhat deep tree of dependencies.gitmodulefile generated by spack will contain the extra line (or similar depending on compiler):+ prepend_path("PATH", "${SPACK_ROOT}/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/tk-8.6.8-uaspjhewvbjfgqt54bmzqy33rv5i5zij/bin")