git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-gui not working in a non-default Cygwin installation.
@ 2008-02-16  1:48 Jurko Gospodnetić
  2008-02-17  8:02 ` Shawn O. Pearce
  0 siblings, 1 reply; 5+ messages in thread
From: Jurko Gospodnetić @ 2008-02-16  1:48 UTC (permalink / raw)
  To: git

   Hi all.

   I am unsure whether this is the right group for asking this question 
and if it is not please excuse me and/or redirect me to a more suitable one.

   We are looking into using git for our source control needs but ran 
into some problems.

   One of these is that it seems that with the latest git release the 
git-gui script changed and started hardcoding some absolute paths in it 
during its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a 
hardcoded path). However, this causes the prebuilt Cygwin package to not 
work in case Cygwin is not installed in its default location at 
C:\Cygwin (e.g. D:\Cygwin or C:\Program Files\Cygwin).

   Everything works fine if you manually edit the git-gui script and 
change the hard-coded path defined there.

   Is there something I'm missing here? E.g. is there any way for the 
Cygwin installation to set the correct path here? Or is the user 
supposed to modify this by hand on every installation? If this is so, 
then what other such files are expected to be modified?

   Many thanks.

   Best regards,
     Jurko Gospodnetić

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui not working in a non-default Cygwin installation.
  2008-02-16  1:48 git-gui not working in a non-default Cygwin installation Jurko Gospodnetić
@ 2008-02-17  8:02 ` Shawn O. Pearce
  2008-02-17 11:25   ` Jurko Gospodnetić
  2008-02-22  6:46   ` Shawn O. Pearce
  0 siblings, 2 replies; 5+ messages in thread
From: Shawn O. Pearce @ 2008-02-17  8:02 UTC (permalink / raw)
  To: Jurko Gospodnetić; +Cc: git

Jurko Gospodneti <jurko.gospodnetic@docte.hr> wrote:
>   I am unsure whether this is the right group for asking this question 
> and if it is not please excuse me and/or redirect me to a more suitable one.

This is a pretty good place to start for all things Git related.  :)
 
>   One of these is that it seems that with the latest git release the 
> git-gui script changed and started hardcoding some absolute paths in it 
> during its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a 
> hardcoded path). However, this causes the prebuilt Cygwin package to not 
> work in case Cygwin is not installed in its default location at 
> C:\Cygwin (e.g. D:\Cygwin or C:\Program Files\Cygwin).
> 
>   Everything works fine if you manually edit the git-gui script and 
> change the hard-coded path defined there.
> 
>   Is there something I'm missing here? E.g. is there any way for the 
> Cygwin installation to set the correct path here? Or is the user 
> supposed to modify this by hand on every installation? If this is so, 
> then what other such files are expected to be modified?

Gaaaaah.

This is not what I had intended to have happen.  Users should not
need to edit binary package files post installation to make things
work correctly.

There's a lot of people I could try to point fingers at for this,
but I think its all mine.  :-\

First, let me point out that Cygwin's Tcl/Tk is stuck on 8.4.1 and
will probably never get updated again.  I have had some bugs with
git-gui on 8.4.1 on Windows where git-fetch/git-push processes
get hung and don't function correctly.  Upgrading Tcl/Tk to the
native Windows binaries of version 8.4.15 resolves the problem,
but that binary cannot handle Cygwin paths and Cygwin mount points.

Cygwin gets around needing to embed absolute paths into binary
files at build time by using the mount point feature to relocate
those paths onto the user's system.  Thus '/' can be D:\Cygwin on
your system and C:\Program Files\Cygwin on mine.  Executables linked
against the Cygwin library can still function just fine, but native
Win32 programs (like Tcl/Tk 8.4.15) can't.

git-gui assumes its going to be running on a newer (and more stable)
Tcl/Tk so its build process embeds the Windows path into the script.
*sigh*

I'll have to figure out on Cygwin if the $TCL_PATH I'm using is
able to resolve Cygwin absolute paths or not, and then build the
script accordingly.  Fun.

I'll try to work up a Makefile patch in the next few days and get
it into a gitgui-0.9.3 maint release, which will probably roll up
into git 1.5.4.3.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui not working in a non-default Cygwin installation.
  2008-02-17  8:02 ` Shawn O. Pearce
@ 2008-02-17 11:25   ` Jurko Gospodnetić
  2008-02-17 13:39     ` Brian Dessent
  2008-02-22  6:46   ` Shawn O. Pearce
  1 sibling, 1 reply; 5+ messages in thread
From: Jurko Gospodnetić @ 2008-02-17 11:25 UTC (permalink / raw)
  To: git

   Hi Shawn.

> First, let me point out that Cygwin's Tcl/Tk is stuck on 8.4.1 and
> will probably never get updated again.  I have had some bugs with
> git-gui on 8.4.1 on Windows where git-fetch/git-push processes
> get hung and don't function correctly.  Upgrading Tcl/Tk to the
> native Windows binaries of version 8.4.15 resolves the problem,
> but that binary cannot handle Cygwin paths and Cygwin mount points.

   Sorry, I seem to be a bit confused about this... Why does cygwin not 
support Tcl/Tk above version 8.4.1?

   What about the information found on 
http://opencircuitdesign.com/cygwin under 'Tcl-Cygwin binary 
distribution download and install:'? It lists some additional downloads 
that may be used to install the latest Tcl/Tk on cygwin... Why is this 
not included in the regular Cygwin distribution (setup.exe)?


> git-gui assumes its going to be running on a newer (and more stable)
> Tcl/Tk so its build process embeds the Windows path into the script.
> *sigh*

   But new version of Tcl/Tk or not, this will not work unless you 
actually *build* git-gui on your final target system. Why does this 
information need to be hardcoded in the script at all? Can it not be 
detected at run-time?


> I'll try to work up a Makefile patch in the next few days and get
> it into a gitgui-0.9.3 maint release, which will probably roll up
> into git 1.5.4.3.

   Thanks!

   Best regards,
     Jurko Gospodnetić

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui not working in a non-default Cygwin installation.
  2008-02-17 11:25   ` Jurko Gospodnetić
@ 2008-02-17 13:39     ` Brian Dessent
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Dessent @ 2008-02-17 13:39 UTC (permalink / raw)
  To: Jurko Gospodneti?; +Cc: git

Jurko Gospodneti? wrote:

>    Sorry, I seem to be a bit confused about this... Why does cygwin not
> support Tcl/Tk above version 8.4.1?
> 
>    What about the information found on
> http://opencircuitdesign.com/cygwin under 'Tcl-Cygwin binary
> distribution download and install:'? It lists some additional downloads
> that may be used to install the latest Tcl/Tk on cygwin... Why is this
> not included in the regular Cygwin distribution (setup.exe)?

The Cygwin tcl/tk package exists primarily to support the Insight
debugger which uses its own bundled in-tree copy of tcl + tk + itcl +
itk.  If someone were to hack on Insight to decouple it, then it might
be possible to ship a different/newer version, but not until then.

Brian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui not working in a non-default Cygwin installation.
  2008-02-17  8:02 ` Shawn O. Pearce
  2008-02-17 11:25   ` Jurko Gospodnetić
@ 2008-02-22  6:46   ` Shawn O. Pearce
  1 sibling, 0 replies; 5+ messages in thread
From: Shawn O. Pearce @ 2008-02-22  6:46 UTC (permalink / raw)
  To: Jurko Gospodnetić; +Cc: git

"Shawn O. Pearce" <spearce@spearce.org> wrote:
> Jurko Gospodneti <jurko.gospodnetic@docte.hr> wrote:
> > 
> >   One of these is that it seems that with the latest git release the 
> > git-gui script changed and started hardcoding some absolute paths in it 
> > during its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a 
> > hardcoded path). However, this causes the prebuilt Cygwin package to not 
> > work in case Cygwin is not installed in its default location at 
> > C:\Cygwin (e.g. D:\Cygwin or C:\Program Files\Cygwin).
...
> I'll have to figure out on Cygwin if the $TCL_PATH I'm using is
> able to resolve Cygwin absolute paths or not, and then build the
> script accordingly.  Fun.
> 
> I'll try to work up a Makefile patch in the next few days and get
> it into a gitgui-0.9.3 maint release, which will probably roll up
> into git 1.5.4.3.

So it took me longer than "next few days" but there is now a
two patch series in my maint branch that resolves this issue.
If git-gui is built with a Tcl/Tk that understands Cygwin path
translations it keeps the library path in POSIX format, but if it
builds with a Tcl/Tk that is a native Win32 binary then it uses
cygpath to translate the path.

Although now that I think about it the relative path case should
be able to be enabled again in the native Win32 codepath, as we
only ran into problems with it on Cygwin.

Anyway, it will be in gitgui-0.9.3, which I expect will be bundled
into git 1.5.4.3, which Junio has stated may be next week.

--8<--
diff --git a/Makefile b/Makefile
index 081d755..01e0a46 100644
--- a/Makefile
+++ b/Makefile
@@ -92,8 +92,12 @@ ifndef V
 	REMOVE_F1 = && echo '   ' REMOVE `basename "$$dst"` && $(RM_RF) "$$dst"
 endif
 
-TCL_PATH   ?= tclsh
 TCLTK_PATH ?= wish
+ifeq (./,$(dir $(TCLTK_PATH)))
+	TCL_PATH ?= $(subst wish,tclsh,$(TCLTK_PATH))
+else
+	TCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH)))
+endif
 
 ifeq ($(uname_S),Darwin)
 	TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
@@ -127,7 +131,17 @@ GITGUI_MACOSXAPP :=
 
 ifeq ($(uname_O),Cygwin)
 	GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
-	gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
+
+	# Is this a Cygwin Tcl/Tk binary?  If so it knows how to do
+	# POSIX path translation just like cygpath does and we must
+	# keep libdir in POSIX format so Cygwin packages of git-gui
+	# work no matter where the user installs them.
+	#
+	ifeq ($(shell echo 'puts [file normalize /]' | '$(TCL_PATH_SQ)'),$(shell cygpath --mixed --absolute /))
+		gg_libdir_sed_in := $(gg_libdir)
+	else
+		gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
+	endif
 else
 	ifeq ($(exedir),$(gg_libdir))
 		GITGUI_RELATIVE := 1

-- 
Shawn.

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-22  6:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-16  1:48 git-gui not working in a non-default Cygwin installation Jurko Gospodnetić
2008-02-17  8:02 ` Shawn O. Pearce
2008-02-17 11:25   ` Jurko Gospodnetić
2008-02-17 13:39     ` Brian Dessent
2008-02-22  6:46   ` Shawn O. Pearce

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 NNTP newsgroup(s).