git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Todd Zullinger <tmz@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>,
	Jeff King <peff@peff.net>, Dominik Mahrer <teddy@teddy.ch>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH] Makefile: check that tcl/tk is installed
Date: Fri, 17 Nov 2017 12:42:58 -0500	[thread overview]
Message-ID: <20171117174258.GP3693@zaya.teonanacatl.net> (raw)
In-Reply-To: <CAP8UFD1hcFLMvNsXONPNbxZhTbHVzSMdRgCB9m=ZGeSTpMsYew@mail.gmail.com>

Christian Couder wrote:
> On Thu, Nov 16, 2017 at 2:35 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> I suspect that this change will hurt those who package Git for other 
>> people.
>
> Maybe a little bit, but in my opinion it should not be a big problem 
> for them to install Tcl/Tk and its dependencies on the build machine.

It's not a big burden, but it is a seemingly unnecessary build-time 
dependency.

>> It used to be that, as long as they have msgfmt installed, they only 
>> needed to _know_ what the path on the users' box to "wish" is, and 
>> set it to TCLTK_PATH, and if they are distro packagers, most likely 
>> they already have such an automated set-up working.  Now with this 
>> change, they are forced to install tcl/tk on their possibly headless 
>> box where tcl/tk is useless, and worse yet, an attempt to install it 
>> may bring in tons of unwanted stuff related to X that is irrelevant 
>> on such a headless development environment.
>
> Yeah, but if they build gitk and git-gui, there is a significant 
> chance that they build other graphical software too, and that this 
> will require installing stuff related to X anyway.

Most distributions build packages in individual container or chroots, 
to increase the stability and reproducibility of the builds.  So 
package builds don't run on systems where any deps have already been 
installed.

To be fair, it looks like pulling in tcl/tk would add only around 8MB 
to the Fedora build root for git.  That's not egregious, to be sure.  
But it really isn't a necessary build-time dependency either.  I don't 
know if there are other distros who would strongly object to pulling 
in tcl/tk.  Some are much more sensitive to build root sizes and 
unnecessary dependencies.

> In general I think packagers are much more able to deal with those 
> kinds of problems than most regular developers who want to hack on 
> Git.

I agree.  Packagers also provide git builds to the vast majority of 
end-users, so we should make their task easier whenever possible. :)

> So asking packagers to either set NO_TCLTK or BYPASS_TCLTK_CHECK or to 
> install Tcl/Tk would not burden them much, especially compared to what 
> regular developers have to deal with these days when trying to build 
> Git.

Presuming this new BYPASS_TCLTK_CHECK is communicated well and that 
the failure when not using it is clear, this doesn't seem likely to 
cause problems.  (I'll leave it to others whether there's a better way 
to solve the msgfmt fallthrough issue.  I didn't even know such a 
fallthrough existed until yesterday.)

I think it's important to ensure that automated package builds of a 
newer git don't simply skip parts of the build which used to work and 
so packagers reading the failed builds logs can easily see what they 
need to adjust.

Just dropping the new variable in the Makefile and waiting for package 
builds to fail or not package gitk & git-gui at the next release would 
be a bit unkind, I think.  Posting this to the git-packagers group[1] 
which Ævar created would be useful.  It /might/ even be worth asking 
there if any distros have strong opinions on the subject.

[1] https://groups.google.com/forum/#!forum/git-packagers and
    git-packagers@googlegroups.com

>> I think "If I cannot run either wish or msgfmt, then barf and give 
>> an error message" might at least be needed.  Am I misinterpreting 
>> the motivation of the patch?
>
> I'd rather add a separate check for msgfmt than mixing the 2 issues, 
> because I think that unless it has been explicitly told to do so, 
> Git should not try to build git-gui and gitk in the first place if 
> there is a big chance that those tools will not work.

If that's a motivation, wouldn't a check in the gitk and git-gui 
scripts handle it?  That would provide an error at run time to the 
user.  This change is about helping the user who builds their own git 
and then runs it, so if they built git without wish installed and then 
ran git-gui, they'd get a clear error that wish is missing and could 
easily install it.  It's not needed for the build, so they wouldn't 
need to rebuild anything.

Something like this:

diff --git i/gitk-git/gitk w/gitk-git/gitk
index a14d7a16b2..f9f28a164a 100755
--- i/gitk-git/gitk
+++ w/gitk-git/gitk
@@ -1,5 +1,6 @@
 #!/bin/sh
-# Tcl ignores the next line -*- tcl -*- \
+# Tcl ignores the next 2 lines -*- tcl -*- \
+type wish >/dev/null 2>&1 || { echo "error: wish not found" >&2; exit 1; }; \
 exec wish "$0" -- "$@"
 
 # Copyright © 2005-2016 Paul Mackerras.  All rights reserved.

maybe?  (The error message is certainly open for improvement.)

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A fool's brain digests philosophy into folly, science into
superstition, and art into pedantry.  Hence University education.
    -- George Bernard Shaw


  reply	other threads:[~2017-11-17 17:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 12:52 [PATCH] Makefile: check that tcl/tk is installed Christian Couder
2017-11-16  1:35 ` Junio C Hamano
2017-11-17 15:35   ` Christian Couder
2017-11-17 17:42     ` Todd Zullinger [this message]
2017-11-17 22:02       ` Jeff King
2017-11-20 17:25         ` Christian Couder
2017-11-20 18:12       ` Christian Couder
  -- strict thread matches above, loose matches on Subject: below --
2017-11-20 17:15 Christian Couder
2017-11-20 17:17 ` Christian Couder
2017-11-20 19:19 ` Jonathan Nieder
2017-11-20 23:58   ` Christian Couder
2017-11-26 19:15     ` Jeff King
2017-11-26 20:57       ` Christian Couder
2017-11-27 15:31         ` Jeff King
2017-11-27  1:13       ` Junio C Hamano
2017-11-27  4:31         ` Junio C Hamano
2017-11-27  4:35           ` Jeff King
2017-11-27  5:22             ` Todd Zullinger
2017-11-27  8:24             ` Christian Couder
2017-11-27 15:27               ` Jeff King
2017-11-27 23:42                 ` Junio C Hamano
2017-11-28  4:35                   ` Junio C Hamano
2017-11-27  9:08             ` Junio C Hamano
2017-11-25 20:46 ` Christian Couder
2017-11-26  3:53   ` Junio C Hamano
2017-11-26 14:00     ` Christian Couder
2017-11-26 17:43       ` Ramsay Jones
2017-11-26 18:34         ` Christian Couder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171117174258.GP3693@zaya.teonanacatl.net \
    --to=tmz@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=teddy@teddy.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).