Makefile: check that tcl/tk is installed
PATCH 1/1 Makefile: check that tcl/tk is installed
By default running make install in the root directory of the project will set TCLTK_PATH to wish and then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.
When Tcl/Tk is not installed, the above will succeed if gettext is installed, as Tcl/Tk is only required as a substitute for msgfmt when msgfmt is not installed. But then running the installed gitk and git-gui will fail.
If neither Tcl/Tk nor gettext are installed, then processing po files will fail in the git-gui directory. The error message when this happens is very confusing to new comers as it is difficult to understand that we tried to use Tcl/Tk as a substitute for msgfmt, and that the solution is to either install gettext or Tcl/Tk, or to set both NO_GETTEXT and NO_TCLTK.
To improve the current behavior when Tcl/Tk is not installed, let's just check that TCLTK_PATH points to something and error out right away if this is not the case.
This should benefit people who actually want to install and use git-gui or gitk as they will have to install Tcl/Tk anyway, and it is better for them if they are told about installing it soon in the build process, rather than if they have to debug it after installing.
For people who don't want to use git-gui or gitk, this forces them to specify NO_TCLTK. If they don't have gettext, this will make it much easier to fix the problems they would have had to fix anyway. If they have gettext, setting NO_TCLTK is a small additional step they will have to make, but it might be a good thing as it will not install what they don't want and it will build a bit faster.
For packagers who want to build git-gui and gitk even if Tcl/Tk is not installed, we provide the new BYPASS_TCLTK_CHECK variable.
--- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+)
The changes compared to the previous version are related to the newly introduced BYPASS_TCLTK_CHECK variable.
I agree that removing NO_TCLTK while introducing USE_TCLTK and not building git-gui and gitk by default is perhaps simpler and probably the right direction for the future, but I think it might be too big a change for now or until the next major release (Git 3.0.0).
Makefile +13 -0
@@ -318,6 +318,10 @@ all:: # If not set it defaults to the bare 'wish'. If it is set to the empty # string then NO_TCLTK will be forced (this is used by configure script). # +# The BYPASS_TCLTK_CHECK variable can be used when you want to build +# the Tcl/Tk GUI but don't want to install Tcl/Tk on the build +# machine. +# # Define INTERNAL_QSORT to use Git's implementation of qsort(), which # is a simplified version of the merge sort used in glibc. This is # recommended if Git triggers O(n^2) behavior in your platform's qsort().
@@ -1636,6 +1640,15 @@ ifeq ($(TCLTK_PATH),) NO_TCLTK = NoThanks endif +ifndef NO_TCLTK + ifndef BYPASS_TCLTK_CHECK + has_tcltk := $(shell type $(TCLTK_PATH) 2>/dev/null) + ifndef has_tcltk +$(error "Tcl/Tk is not installed ('$(TCLTK_PATH)' not found). Consider setting NO_TCLTK or installing Tcl/Tk") + endif + endif +endif + ifeq ($(PERL_PATH),) NO_PERL = NoThanks endif
Signature · 1 line
2.15.0.165.g82024f6603.dirty
(Sorry I forgot to mark this as v2.)
Quoted 4 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.
Hi,
Quoted 9 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.When Tcl/Tk is not installed, the above will succeed if gettext is installed, as Tcl/Tk is only required as a substitute for msgfmt when msgfmt is not installed. But then running the installed gitk and git-gui will fail.
Hm, I am not sure I understand the point of this change. E.g. if I run "make install" for git and install tk later, wouldn't I want gitk to work?
Can you say more about where this comes up? gitk is a wrapper script
#!/bin/sh # Tcl ignores the next line -*- tcl -*- \ exec wish "$0" -- "$@"
Would some error handling there help? E.g. something like
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@" || \
{ echo >&2 "Cannot run gitk without tk"; exit 127; }Quoted 6 lines
If neither Tcl/Tk nor gettext are installed, then processing po files will fail in the git-gui directory. The error message when this happens is very confusing to new comers as it is difficult to understand that we tried to use Tcl/Tk as a substitute for msgfmt, and that the solution is to either install gettext or Tcl/Tk, or to set both
NO_GETTEXTandNO_TCLTK.
Hm, is this the motivating problem? This is a condition where the rationale for failing the build seems clearer.
Quoted 3 lines
To improve the current behavior when Tcl/Tk is not installed, let's just check that
TCLTK_PATHpoints to something and error out right away if this is not the case.
At first glance I had thought this might set NO_TCLTK automatically, which I think would be problematic for the reasons mentioned above.
Erroring out like this patch does and asking the user to explicitly confirm that they want to install gitk without Tcl/Tk is less problematic, so I am not *against* this patch, just interested in more background.
Thanks and hope that helps,
Jonathan
Hi,
Quoted 9 lines · Jonathan Nieder
Hi,
Quoted 5 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.
Quoted 8 lines
Quoted 4 lines
When Tcl/Tk is not installed, the above will succeed if gettext is installed, as Tcl/Tk is only required as a substitute for msgfmt when msgfmt is not installed. But then running the installed gitk and git-gui will fail.
Hm, I am not sure I understand the point of this change. E.g. if I run "make install" for git and install tk later, wouldn't I want gitk to work?
Yeah, if you know how it all works and want to decide after installing gitk and git-gui if you actually want to use them, then things are a bit less straightforward with this patch, though you can still do what you want by setting the BYPASS_TCLTK_CHECK variable.
But I doubt that many people who are actually building Git are in this case.
Quoted 1 line
Can you say more about where this comes up?
The original discussion is:
https://public-inbox.org/git/[email protected]/
and here are discussions related to version 1 of this patch:
https://public-inbox.org/git/[email protected]/
As Peff mentions in the original discussion, at the Bloomberg Git sprint, we saw someone struggling to compile Git, because of these msgfmt and Tcl/Tk issues.
Quoted 7 lines
gitk is a wrapper
script#!/bin/sh # Tcl ignores the next line -*- tcl -*- \ exec wish "$0" -- "$@"
Quoted 6 lines
Would some error handling there help? E.g. something like
#!/bin/sh # Tcl ignores the next line -*- tcl -*- \ exec wish "$0" -- "$@" || \ { echo >&2 "Cannot run gitk without tk"; exit 127; }
I think Peff already gave his opinion about this in the above discussions.
Quoted 9 lines
Quoted 6 lines
If neither Tcl/Tk nor gettext are installed, then processing po files will fail in the git-gui directory. The error message when this happens is very confusing to new comers as it is difficult to understand that we tried to use Tcl/Tk as a substitute for msgfmt, and that the solution is to either install gettext or Tcl/Tk, or to set both
NO_GETTEXTandNO_TCLTK.Hm, is this the motivating problem? This is a condition where the rationale for failing the build seems clearer.
This is the issue as well as the above thread that prompted me to take a look at this.
Quoted 10 lines
Quoted 3 lines
To improve the current behavior when Tcl/Tk is not installed, let's just check that
TCLTK_PATHpoints to something and error out right away if this is not the case.At first glance I had thought this might set
NO_TCLTKautomatically, which I think would be problematic for the reasons mentioned above.Erroring out like this patch does and asking the user to explicitly confirm that they want to install gitk without Tcl/Tk is less problematic,
Yeah that is also my opinion.
Quoted 2 lines
so I am not *against* this patch, just interested in more background.
Thanks for taking a look at this,
Christian.
Quoted 6 lines · Christian Couder
Quoted 1 line
Can you say more about where this comes up?
The original discussion is:
Quoted 7 lines
and here are discussions related to version 1 of this patch:
https://public-inbox.org/git/[email protected]/
As Peff mentions in the original discussion, at the Bloomberg Git sprint, we saw someone struggling to compile Git, because of these msgfmt and Tcl/Tk issues.
Actually, I think we had the _opposite_ problem there.
The main problem your patch fixes is that we may silently build a version of gitk/git-gui that do not work. The "make" process completes, but they refer to a non-existent "wish" tool, and running them will fail.
That's potentially annoying if you wanted those tools. But if you didn't care about them in the first place, it's fine.
The opposite problem is when you don't care about those tools, and they _do_ break the build. And then just to get the rest of Git built, you have to know about and set NO_TCLTK.
AFAIK that only happens if you don't have msgfmt installed. Because then the gitk and git-gui Makefiles try to auto-fallback to implementing msgfmt in tcl _during the build_, and there a lack of "tclsh" will break the build.
I think your patch does say "consider setting NO_TCLTK" in that case, which is an improvement. But it might be nicer still if it Just Worked (either because we don't do tcl/tk by default, or because we respect NO_GETTEXT in the gitk/git-gui Makefiles, or because our msgfmt can fallback further to not even using tclsh).
So I'm not really against this patch, but IMHO it doesn't make the interesting case (you don't care about tcl and are just trying to build git for the first time) all that much better. I do also wonder if we want to start putting these kind of run-time checks into the Makefile itself. That's kind of what autoconf is for. As much as I hate autoconf, is it the right advice for somebody who doesn't want to look at the Makefile knobs to do:
autoconf
./configure
make
?
If there are deficiencies in configure.in (and I can well believe that there are), should we be fixing it there?
-Peff
Quoted 18 lines · Jeff King
Quoted 6 lines · Christian Couder
Quoted 1 line
Can you say more about where this comes up?
The original discussion is:
Quoted 7 lines
and here are discussions related to version 1 of this patch:
https://public-inbox.org/git/[email protected]/
As Peff mentions in the original discussion, at the Bloomberg Git sprint, we saw someone struggling to compile Git, because of these msgfmt and Tcl/Tk issues.
Actually, I think we had the _opposite_ problem there.
Quoted 7 lines
The main problem your patch fixes is that we may silently build a version of gitk/git-gui that do not work. The "make" process completes, but they refer to a non-existent "wish" tool, and running them will fail.
That's potentially annoying if you wanted those tools. But if you didn't care about them in the first place, it's fine.
I think it's a bit better to not install the tools if you don't care about them. So overall whether you care or not about them, there is still a bit of improvement.
Quoted 11 lines
The opposite problem is when you don't care about those tools, and they _do_ break the build. And then just to get the rest of Git built, you have to know about and set
NO_TCLTK.AFAIK that only happens if you don't have msgfmt installed. Because then the gitk and git-gui Makefiles try to auto-fallback to implementing msgfmt in tcl
_duringthebuild_, and there a lack of "tclsh" will break the build.I think your patch does say "consider setting
NO_TCLTK" in that case, which is an improvement.
Yeah, so my patch actually improve things in all the cases.
Quoted 4 lines
But it might be nicer still if it Just Worked
(either because we don't do tcl/tk by default, or because we respectNO_GETTEXTin the gitk/git-gui Makefiles, or because our msgfmt can fallback further to not even using tclsh).
Yeah, it might be nicer if it just worked, but as I already answered in another thread, it could break some environments if we just stopped installing gitk and git-gui by default.
About improving the way msgfmt is handled, I am not against it. In fact I might even give it a try, but I think it is a separate issue, and I don't want to mix those issues right now.
Quoted 3 lines
So I'm not really against this patch, but IMHO it doesn't make the interesting case (you don't care about tcl and are just trying to build git for the first time) all that much better.
I agree that it doesn't solve all the issues, if you are trying to build git for the first time, but I do think that it makes it easier. If you don't have msgfmt, you get an error that is not so difficult to debug.
Quoted 3 lines
I do also wonder if we
want to start putting these kind of run-time checks into theMakefileitself. That's kind of what autoconf is for.
I don't quite agree that autoconf is for that, and there are already some checks in the Makefile.
Quoted 9 lines
As much as I hate autoconf,
is it the right advice for somebody who doesn't want to look at theMakefileknobs to do:autoconf
./configure
make?
I don't think so. I think it is just easier to advice to do as most of us do, and to just add a few checks in the Makefile to make it clear which dependencies should be installed or which knob should be tweaked.
Quoted 2 lines
If there are deficiencies in configure.in (and I can well believe that there are), should we be fixing it there?
If most of us don't use autoconf, even if we fix the current deficiencies, there could still be some a few years from now. While if we add checks to the Makefile, there is a good chance that those who change the Makefile will see the existing tests and add more if necessary.
Quoted 8 lines · Christian Couder
Quoted 8 lines
As much as I hate autoconf,
is it the right advice for somebody who doesn't want to look at theMakefileknobs to do:autoconf
./configure
make
Quoted 6 lines
Quoted 1 line
?
I don't think so. I think it is just easier to advice to do as most of us do, and to just add a few checks in the
Makefileto make it clear which dependencies should be installed or which knob should be tweaked.
I guess I can buy that line of reasoning (and in particular your later comment that autoconf is doomed to bitrot, since most of us don't use it). I'm just slightly concerned that we're going to end up reimplementing autoconf inside our Makefile. ;)
But that is a slippery slope argument; we could switch our approach any time if it starts to look bad.
-Peff
Quoted 10 lines · Jeff King
...
I think your patch does say "consider settingNO_TCLTK" in that case, which is an improvement. But it might be nicer still if it Just Worked (either because we don't do tcl/tk by default, or because we respectNO_GETTEXTin the gitk/git-gui Makefiles, or because our msgfmt can fallback further to not even using tclsh).So I'm not really against this patch, but IMHO it doesn't make the interesting case (you don't care about tcl and are just trying to build git for the first time) all that much better.
I was in agreement with that line of argument while the patch was discussed, and I still think the above is true.
And if the primary thing we want to address with this patch is the build breakage for those who do not have tclsh nor msgfmt, perhaps it is a more direct fix to update this part in gitk/Makefile:
## po-file creation rules
XGETTEXT ?= xgettext
ifdef NO_MSGFMT
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
else
MSGFMT ?= msgfmt
ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
MSGFMT := $(TCL_PATH) po/po2msg.sh
endif
endif
There is an identical copy-and-pasted copy of this in git-gui/Makefile, and both of them silently assume that TCL_PATH points at something usable when msgfmt is not available.
Perhaps the "else" part of the above should become a bit more careful, something along the lines of...
else
MSGFMT ?= msgfmt
- ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
- MSGFMT := $(TCL_PATH) po/po2msg.sh
- endif
+ MSGFMT_DRYRUN = --tcl -l C -d . /dev/null 2>/dev/null
+ ifneq ($(shell $(MSGFMT) $(MSGFMT_DRYRUN); echo $$?),0)
+ ifneq ($(shell $(TCL_PATH) po/po2msg.sh $(MSGFMT_DRYRUN); echo $$?),0)
+ MSGFMT := $(TCL_PATH) po/po2msg.sh
+ else
+ $(error "no usable msgfmt to build gitk; set NO_TCLTK perhaps?")
+ endif
endif
endif
Another reason why I think the Makefiles in gitk and git-gui projects are better targets for the fix is because they are designed to be independent projects. We should be able to do
cd git-gui && make
in our tree, but an update to our top-level Makefile does not help those people.
Quoted 7 lines · Junio C Hamano
Perhaps the "else" part of the above should become a bit more careful, something along the lines of...
else
MSGFMT ?= msgfmt(quoted diff) +0
-2- ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0) - MSGFMT := $(TCL_PATH) po/po2msg.sh
Review
Quoted 10 lines
(quoted diff) +7
-1- endif + MSGFMT_DRYRUN = --tcl -l C -d . /dev/null 2>/dev/null + ifneq ($(shell $(MSGFMT) $(MSGFMT_DRYRUN); echo $$?),0) + ifneq ($(shell $(TCL_PATH) po/po2msg.sh $(MSGFMT_DRYRUN); echo $$?),0) + MSGFMT := $(TCL_PATH) po/po2msg.sh + else + $(error "no usable msgfmt to build gitk; set NO_TCLTK perhaps?") + endif endif endif
Actually, at this point, I think the suggestion should primarily be to install either msgfmt or tclsh; offering another choice to set NO_TCLTK is OK, but it should be secondary, as the fact that the make utility is running this recipe is a sign that the builder wants to build gitk/git-gui.
Whether the builder wants to run the result on the same box is a separate and irrelevant matter. Once built and installed, a box without "wish" may not be able to run the result, but installing it after the fact will fix it without need to rebuild anything.
Quoted 20 lines · Junio C Hamano
Quoted 7 lines · Junio C Hamano
Perhaps the "else" part of the above should become a bit more careful, something along the lines of...
else
MSGFMT ?= msgfmt(quoted diff) +0
-2- ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0) - MSGFMT := $(TCL_PATH) po/po2msg.shReview
Quoted 10 lines
(quoted diff) +7
-1- endif + MSGFMT_DRYRUN = --tcl -l C -d . /dev/null 2>/dev/null + ifneq ($(shell $(MSGFMT) $(MSGFMT_DRYRUN); echo $$?),0) + ifneq ($(shell $(TCL_PATH) po/po2msg.sh $(MSGFMT_DRYRUN); echo $$?),0) + MSGFMT := $(TCL_PATH) po/po2msg.sh + else + $(error "no usable msgfmt to build gitk; set NO_TCLTK perhaps?") + endif endif endif
Quoted 5 lines
Actually, at this point, I think the suggestion should primarily be to install either msgfmt or tclsh; offering another choice to set
NO_TCLTKis OK, but it should be secondary, as the fact that the make utility is running this recipe is a sign that the builder wants to build gitk/git-gui.
I think that's the rub, though. We hit this code path by default, so it's _not_ a sign that the builder cares about gitk.
I do agree that outlining "install one of these or disable tcl" as the options is a good idea, though.
Quoted 4 lines
Whether the builder wants to run the result on the same box is a separate and irrelevant matter. Once built and installed, a box without "wish" may not be able to run the result, but installing it after the fact will fix it without need to rebuild anything.
Yeah, this side-steps the "other half" of the issue that Christian's patch addresses, which seems like the more controversial part (I don't have a strong opinion myself, though).
-Peff
Quoted 1 line · Jeff King
Yeah, this side-steps the "other half" of the issue that Christian's patch addresses, which seems like the more controversial part (I don't have a strong opinion myself, though).
I don't either. The general motivation there, as far as I understand, is that it's undesirable to have 'make install' install tools that cannot run.
Perhaps it's worth noting that there are other commands installed by default which won't work out of the box. For example, 'git svn' requires subversion at run time but not at build time.
If there aren't many such commands, then maybe checking for them in the Makefile is reasonable to make installing git from source easier for new users. Without looking closely, I can't do more than take a wild guess.
As a package maintainer and an aging sysadmin, I'd bet that there are more dependencies than one might initially guess. I also tend to think that by the time most users want something newer than their OS provides that they're a bit more able to deal with these sort of issues. But I could easily be wrong on all counts.
Signature · 5 lines
Todd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Going to trial with a lawyer who considers your whole life-style a Crime in Progress is not a happy prospect. -- Hunter S. Thompson
Quoted 22 lines · Jeff King
Quoted 20 lines · Junio C Hamano
Quoted 17 lines · Junio C Hamano
Perhaps the "else" part of the above should become a bit more careful, something along the lines of...
else
MSGFMT ?= msgfmt(quoted diff) +7
-3- ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0) - MSGFMT := $(TCL_PATH) po/po2msg.sh - endif + MSGFMT_DRYRUN = --tcl -l C -d . /dev/null 2>/dev/null + ifneq ($(shell $(MSGFMT) $(MSGFMT_DRYRUN); echo $$?),0) + ifneq ($(shell $(TCL_PATH) po/po2msg.sh $(MSGFMT_DRYRUN); echo $$?),0) + MSGFMT := $(TCL_PATH) po/po2msg.sh + else + $(error "no usable msgfmt to build gitk; set NO_TCLTK perhaps?") + endif endif endif
Quoted 5 lines
Quoted 5 lines
Actually, at this point, I think the suggestion should primarily be to install either msgfmt or tclsh; offering another choice to set
NO_TCLTKis OK, but it should be secondary, as the fact that the make utility is running this recipe is a sign that the builder wants to build gitk/git-gui.
What if the user actually don't care about internationalization?
The problem is that inside git-gui, the option to disable msgfmt is NO_MSGFMT, while in the git repo it is NO_GETTEXT, so if we make this change in git-gui, we should suggest using NO_MSGFMT to disable msgfmt. But then the user building git and setting NO_MSGFMT will get another msgfmt related error later in the git build (as NO_MSGFMT will have no effect in the git build) and will not understand at all why there is still a msgfmt error despite setting NO_MSGFMT as the build suggested.
Quoted 2 lines
I think that's the rub, though. We hit this code path by default, so it's _not_ a sign that the builder cares about gitk.
Yeah, I agree. That's why I think it is a good idea if Tcl/Tk is not installed to ask for either setting NO_TCLTK or installing Tcl/Tk or setting BYPASS_TCLTK_CHECK.
Quoted 2 lines
I do agree that outlining "install one of these or disable tcl" as the options is a good idea, though.
The problem is that we should suggest disabling msgfmt as it is a valid solution, but as explained above there is an issue related to NO_MSGFMT in git-gui vs NO_GETTEXT in git.
That's also one of the reason why I don't want to mix the Tcl/Tk issue and the msgfmt issue. In the end I think we should fix both, but if it is not possible to fix the simpler Tcl/Tk issue first, it's not even worth spending time to take a deep look at the msgfmt issue.
Quoted 4 lines
Quoted 4 lines
Whether the builder wants to run the result on the same box is a separate and irrelevant matter. Once built and installed, a box without "wish" may not be able to run the result, but installing it after the fact will fix it without need to rebuild anything.
Yeah, people have not complained about that and it is not a really bad situation, but I don't think this is the best practice nor the best we can do, and I think the situation in this regard is better after my patch.
For example if someone builds a box that should be used afterwards in an internal network where this no way to install Tcl/Tk, then users will be screwed when they will try to run gitk or git-gui. The same thing can happen if someone installs git just before a long plane trip with no Internet access. Also the person using git-gui or gitk may not be the same person as the person installing the box, so the user might just not have the rights to actually install things.
As I wrote in a previous email, in general it is best to try to fix issues as soon possible, so it is better to invite people to decide if they want to install Tcl/Tk at build time rather than at run time. Yeah, I know that it is not best for packagers and maybe a few other special cases, but I think setting BYPASS_TCLTK_CHECK should be a good enough workaround in those cases.
Quoted 3 lines
Yeah, this side-steps the "other half" of the issue that Christian's patch addresses, which seems like the more controversial part (I don't have a strong opinion myself, though).
I don't think any part of my patch should be controversial. I repeatedly wrote very long messages to show all the possible cases, so that it is easy to see that we are not worse in any case. And all the competing suggestions, even the above from Junio either have significant problems or address a different problem.
Quoted 9 lines · Christian Couder
Quoted 3 lines
Yeah, this side-steps the "other half" of the issue that Christian's patch addresses, which seems like the more controversial part (I don't have a strong opinion myself, though).
I don't think any part of my patch should be controversial. I repeatedly wrote very long messages to show all the possible cases, so that it is easy to see that we are not worse in any case. And all the competing suggestions, even the above from Junio either have significant problems or address a different problem.
Sorry, controversial may not have been the right word. It's just that the review discussion focused around packagers who may want to build git without having "wish" on the build machine. If everybody is happy with the BYPASS mechanism you added to address that, then I'm perfectly fine with it.
-Peff
Quoted 3 lines · Jeff King
without having "wish" on the build machine. If everybody is happy with the BYPASS mechanism you added to address that, then I'm perfectly fine with it.
OK. The topic was queued on 'pu' yesterday; lets move it forward after waiting for a few more days to see if there are further improvements and/or objections.
Quoted 9 lines · Junio C Hamano
Quoted 3 lines · Jeff King
without having "wish" on the build machine. If everybody is happy with the BYPASS mechanism you added to address that, then I'm perfectly fine with it.
OK. The topic was queued on 'pu' yesterday; lets move it forward after waiting for a few more days to see if there are further improvements and/or objections.
It seems that TravisCI objects ;-)
https://travis-ci.org/git/git/jobs/307745929
PATCH 1/1 travis-ci: avoid new tcl/tk build requirement
A build requirement on tcl/tk was added in 01c54284f1 (Makefile: check that tcl/tk is installed, 2017-11-20). For building and running the tests, we don't need tcl/tk installed. Bypass the requirement.
---
Quoted 3 lines · Junio C Hamano
It seems that TravisCI objects ;-)
https://travis-ci.org/git/git/jobs/307745929
Interesting that the main builds passed. I don't know what the default 64-bit linuxinstall looks like in travis, so I presume it includes tcl/tk or something.
In any case, perhaps something like this is what we want? We could use NO_TCLTK or ensure that tcl/tk is installed in all environments. I used the BYPASS_TCLTK_CHECK option since the tests have been running without tcl/tk previously. If they become required for the tests, this can be adjusted.
I have a travis job running with this change here:
https://travis-ci.org/tmzullinger/git/builds/308452464
So far the only failure is (what looks like) an unrelated one in the GETTEXT_POISON build.
.travis.yml | 1 + ci/run-linux32-docker.sh | 1 + 2 files changed, 2 insertions(+)
.travis.yml +1 -0
@@ -23,6 +23,7 @@ addons: env: global: + - BYPASS_TCLTK_CHECK=1 - DEVELOPER=1 # The Linux build installs the defined dependency versions below. # The OS X build installs the latest available versions. Keep that
ci/run-linux32-docker.sh +1 -0
@@ -13,6 +13,7 @@ docker pull daald/ubuntu32:xenial docker run \ --interactive \ + --env BYPASS_TCLTK_CHECK \ --env DEVELOPER \ --env DEFAULT_TEST_TARGET \ --env GIT_PROVE_OPTS \
Signature · 1 line
2.15.0
Re: [PATCH] travis-ci: avoid new tcl/tk build requirement
Quoted 7 lines · Todd Zullinger
A build requirement on tcl/tk was added in
01c54284f1(Makefile: check that tcl/tk is installed, 2017-11-20). For building and running the tests, we don't need tcl/tk installed. Bypass the requirement.Signed-off-by Todd Zullinger <[email protected]>---
Quoted 8 lines
Quoted 3 lines · Junio C Hamano
It seems that TravisCI objects ;-)
https://travis-ci.org/git/git/jobs/307745929Interesting that the main builds passed. I don't know what the default 64-bit linuxinstall looks like in travis, so I presume it includes tcl/tk or something.
Yeah, interesting. I am cc'ing Lars who perhaps knows.
Quoted 6 lines
In any case, perhaps something like this is what we want? We could use
NO_TCLTKor ensure that tcl/tk is installed in all environments. I used theBYPASS_TCLTK_CHECKoption since the tests have been running without tcl/tk previously. If they become required for the tests, this can be adjusted.
Quoted 6 lines
I have a travis job running with this change here:
https://travis-ci.org/tmzullinger/git/builds/308452464So far the only failure is (what looks like) an unrelated one in the
GETTEXT_POISONbuild.
Yeah, I can't see how test failures in the t/ directory could be related.
Quoted 3 lines
.travis.yml | 1 + ci/run-linux32-docker.sh | 1 + 2 files changed, 2 insertions(+)
The patch looks good to me. Thanks!
I wonder if it would be better to squash it into my patch or to keep it separate. I am ok with both ways.
Re: [PATCH] travis-ci: avoid new tcl/tk build requirement
Quoted 10 lines · Christian Couder
Quoted 8 lines
Quoted 3 lines · Junio C Hamano
It seems that TravisCI objects ;-)
https://travis-ci.org/git/git/jobs/307745929Interesting that the main builds passed. I don't know what the default 64-bit linuxinstall looks like in travis, so I presume it includes tcl/tk or something.
Yeah, interesting. I am cc'ing Lars who perhaps knows.
I pulled the travis docker image used in clang/gcc builds[1] and can see it has both tcl and tk packages installed. The linux32 builds use a docker image[2] which does not contain tcl or tk.
[1] travisci/ci-garnet:packer-1503972846
[2] daald/ubuntu32:xenial
If we wanted, we could set BYPASS_TCLTK_CHECK only for the linux32 builds. I think it's probably better to do it globally rather than rely on the travis containers implicitly having tcl/tk installed.
Quoted 4 lines
The patch looks good to me. Thanks!
I wonder if it would be better to squash it into my patch or to keep it separate. I am ok with both ways.
I fine either way too. This is still just on pu, so squashing it in seems like the way to go. I only made it separate to cause travis to run the tests. :)
Signature · 5 lines
Todd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move. -- Douglas Adams
Re: [PATCH] travis-ci: avoid new tcl/tk build requirement
Quoted 11 lines · Todd Zullinger
I pulled the travis docker image used in clang/gcc builds[1] and can see it has both tcl and tk packages installed. The linux32 builds use a docker image[2] which does not contain tcl or tk.
[1] travisci/ci-garnet:packer-1503972846
[2] daald/ubuntu32:xenialIf we wanted, we could set
BYPASS_TCLTK_CHECKonly for the linux32 builds. I think it's probably better to do it globally rather than rely on the travis containers implicitly having tcl/tk installed.
Quoted 8 lines
Quoted 4 lines
The patch looks good to me. Thanks!
I wonder if it would be better to squash it into my patch or to keep it separate. I am ok with both ways.
I fine either way too. This is still just on pu, so squashing it in seems like the way to go. I only made it separate to cause travis to run the tests. :)
I am OK either way but this may be giving an early warning that a typical mix of packages installed on a box will lead many people to encounter this glitch in the real world, and we may need a more seamless solution than a workaround.
Keeping this "fix" separate from the original commit that introduced the issue would allow us more easily to refer real users who will be hit by this glitch to it, telling them to do something similar to their build environment.
Quoted 2 lines · Jeff King
I think that's the rub, though. We hit this code path by default, so it's _not_ a sign that the builder cares about gitk.
OK.
Quoted 8 lines
Quoted 4 lines
Whether the builder wants to run the result on the same box is a separate and irrelevant matter. Once built and installed, a box without "wish" may not be able to run the result, but installing it after the fact will fix it without need to rebuild anything.
Yeah, this side-steps the "other half" of the issue that Christian's patch addresses, which seems like the more controversial part (I don't have a strong opinion myself, though).
Is that controversial at all? In the sense that it is addressing a non-issue (i.e. it is perfectly fine if installed gitk fails at runtime complaining that it cannot find wish), it might be, but to me, it appears there isn't any room for controversy there.
But an out-of-box build that fails _is_ a problem worth addressing to, so I view it primarily as the "how do we do msgfmt (or its substitute that is good enough for tcl script)" issue. Perhaps we can export NO_GETTEXT from the top-level Makefile and have Makefiles in these two subdirectories to pay attention to it, in addition to NO_MSGFMT, and build them without i18n support instead of failing, or something?
Quoted 4 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.
Has this patch fallen through the cracks or is there an unresolved issue?
Quoted 8 lines · Christian Couder
Quoted 4 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.Has this patch fallen through the cracks or is there an unresolved issue?
I had an impression that the conclusion was that the existing error message at runtime already does an adequate job and there is no issue to be addressed by this patch. Am I mistaken?
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Christian Couder
Quoted 4 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.
Quoted 5 lines
Quoted 1 line
Has this patch fallen through the cracks or is there an unresolved issue?
I had an impression that the conclusion was that the existing error message at runtime already does an adequate job and there is no issue to be addressed by this patch. Am I mistaken?
This patch is mostly about what happens at the build step. Its goal is not much to improve what happens at runtime, though that is improved a bit too. If the build step was good enough, then I would agree that what happens at run time is adequate.
Let's consider only people installing git using "make install" to use it on their machine, as I think I already discussed the case of packagers and added the BYPASS_TCLTK_CHECK variable for them.
When those users run "make install", let's suppose they don't have Tcl/Tk installed. (If it is already installed my patch changes nothing.)
Let's also suppose that NO_TCLTK is not set. (If it is set my patch changes nothing.)
Then there are 2 cases:
- msgfmt is already installed
Without my patch, the "make install" step works and installs git, git-gui and gitk. But the user might not want to have git-gui and gitk installed in the first place. As Jeff says there are a lot of other graphical tools, that are more advanced these days, so there is a big chance that they just forgot to set NO_TCLTK or just didn't know about this variable. Now if they actually want to use git-gui and gitk, they will get an error at run time (which is adequate) and they will have to install Tck/Tk then before they can git-gui and gitk.
With my patch, the "make install" step fails right away telling them to either set NO_TCLTK or install Tcl/Tk. If they don't want to use git-gui and gitk, they will set NO_TCLTK and then run "make install" again and things will be exactly as they want. If they do want to use git-gui and gitk, they will install Tcl/Tk and then run "make install" again and then things will be exactly as they want and there will be no error at runtime.
So my opinion is that whether they actually want to use git-gui and gitk or not, forcing them to decide is probably a good thing because it ensures that when "make install" succeeds things are exactly how they want them to be. The only case when it might not be a good thing is if they don't know yet if they will actually want to use gitk and git-gui. But even in this case, which is not the most common, they are not much worse.
- msgfmt is not installed
Without my patch, the "make install" step produces an error message while building git-gui. Debugging and fixing the error is quite difficult especially for new comers. They will have to either set NO_GETTEXT or install gettext, and to either set NO_TCLTK or to install Tcl/Tk before the build can fully succeed.
With my patch, the "make install" step fails right away telling them to either set NO_TCLTK or install Tcl/Tk. Then the build will fail again and they will have to either set NO_GETTEXT or install gettext, but this error is easier to understand and to fix than without my patch.
Quoted 16 lines · Christian Couder
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Christian Couder
Quoted 4 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.Quoted 5 lines
Quoted 1 line
Has this patch fallen through the cracks or is there an unresolved issue?
I had an impression that the conclusion was that the existing error message at runtime already does an adequate job and there is no issue to be addressed by this patch. Am I mistaken?
Quoted 9 lines
This patch is mostly about what happens at the build step. Its goal is not much to improve what happens at runtime, though that is improved a bit too. If the build step was good enough, then I would agree that what happens at run time is adequate.
Let's consider only people installing git using "make install" to use it on their machine, as I think I already discussed the case of packagers and added the
BYPASS_TCLTK_CHECKvariable for them.
I haven't been following this thread too closely, but I have the feeling that the best course of action is to simply not fall back to using a tcl version of msgfmt in the first place!. ;-)
If a given platform does not have gettext/msgfmt, then you just don't get an i18n-ed version of git. (no need for BYPASS_ ...).
Am I missing something?
ATB,
Ramsay Jones
Quoted 24 lines · Ramsay Jones
Quoted 21 lines · Christian Couder
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Christian Couder
Quoted 4 lines · Christian Couder
By default running
make installin the root directory of the project will setTCLTK_PATHtowishand then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.Quoted 5 lines
Quoted 1 line
Has this patch fallen through the cracks or is there an unresolved issue?
I had an impression that the conclusion was that the existing error message at runtime already does an adequate job and there is no issue to be addressed by this patch. Am I mistaken?
This patch is mostly about what happens at the build step. Its goal is not much to improve what happens at runtime, though that is improved a bit too. If the build step was good enough, then I would agree that what happens at run time is adequate.
Quoted 8 lines
Quoted 4 lines
Let's consider only people installing git using "make install" to use it on their machine, as I think I already discussed the case of packagers and added the
BYPASS_TCLTK_CHECKvariable for them.I haven't been following this thread too closely, but I have the feeling that the best course of action is to simply not fall back to using a tcl version of msgfmt in the first place!. ;-)
Well, another possibility would be to try to use the tcl version of msgfmt in the build of git itself if msgfmt is not available. This way the build behavior of git and git-gui could be similar.
Quoted 2 lines
If a given platform does not have gettext/msgfmt, then you just don't get an i18n-ed version of git. (no need for
BYPASS_...).
Right now without gettext/msgfmt you get an error unless you set NO_GETTEXT. If we try to use the tcl version of msgfmt in the build of git itself, then you could still get an i18n-ed version of git if you have Tcl/Tk.
But anyway even if this is related, I think it is a different issue.
Quoted 1 line
Am I missing something?
I still think it is not the best outcome to just install git-gui and gitk by default when Tcl/Tk is not installed. In general it is best to fix potential errors at build time rather than at run time (even if the run time error is adequate).