Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

putty install incomplete #44622

Closed
seamusdemora opened this issue Oct 5, 2015 · 27 comments
Closed

putty install incomplete #44622

seamusdemora opened this issue Oct 5, 2015 · 27 comments

Comments

@seamusdemora
Copy link

'brew install putty' creates several binaries in /usr/local/Cellar/putty/0.65/bin
However, putty itself is not one of them

@bfontaine
Copy link
Contributor

It seems that the putty binary doesn’t build on OS X; it was removed in #40963.

@seamusdemora
Copy link
Author

?! if putty itself doesn't build, then 2 questions:

  1. why does it show up in brew search putty
  2. why does it install the ancillary binaries (plink, puttygen, etc)?

screen shot 2015-10-05 at 10 46 05 am

@bfontaine
Copy link
Contributor

The putty binary doesn’t build but the rest of the binaries do. Searching putty gives you the putty formula; brew search doesn’t know which binaries are installed by each formula.

@seamusdemora
Copy link
Author

The other binaries exist only to support putty. In other words if you don't get putty, these binaries are useless (for the most part). I'm trying to understand the point of this - I'm obviously missing something.

@seamusdemora
Copy link
Author

OK... I guess you are saying that putty isn't included because someone outside of the homebrew project has to fix this?

@bfontaine
Copy link
Contributor

Yeah, putty was included at the beginning but it stopped being supported on OS X (see #40963) so the binary was removed. This left this putty formula without putty binary.

@seamusdemora
Copy link
Author

Does that make sense to you... putty without putty?
I'm just wondering why the whole thing wasn't dropped, 'cause it's really not useful w/o putty.
Did anyone contact the putty author to see if he could fix the dependency issue?

@bfontaine
Copy link
Contributor

I understand the confusion. Are these binaries used outside of putty?

@DomT4 @tdsmith Should we boneyard here since it doesn’t really make sense to have a putty formula without its main binary?

@tdsmith
Copy link
Contributor

tdsmith commented Oct 5, 2015

I think pscp, pftp, and plink are still useful, so I think we should not boneyard the formula, and I think putty is still the right name for the formula. We could add a caveat explaining why the GUI isn't included.

@seamusdemora
Copy link
Author

I don't know what that use would be, but if someone finds it useful...
I guess I didn't understand what homebrew did. I thought homebrew looked at all of the packages, and made sure they were supported on Mac. putty without putty... i don't know.
Final question: Do you know if anyone has contacted the developer of putty to see if he could fix this?

@DomT4
Copy link
Contributor

DomT4 commented Oct 6, 2015

Should we boneyard here since it doesn’t really make sense to have a putty formula without its main binary?

For FontForge, where we stopped shipping the GUI as a result of the same set of changes that killed off putty we tweaked the description to try to make explicit the formula was command-line.

As for the upstream situation, they recently switched to using GTK+3 in git which when released should make restoring the putty et al. commands available.

@asparagui
Copy link
Contributor

Final question: Do you know if anyone has contacted the developer of putty to see if he could fix this?

@seamusdemora Perhaps you could try? Otherwise, per @DomT4's feedback above, would suggest we just wait for a new release and close this.

@DomT4
Copy link
Contributor

DomT4 commented Oct 7, 2015

This actually works in terms of build (Notice the --without-quartz option present now 🎉) but currently segfaults at runtime:

diff --git a/Library/Formula/putty.rb b/Library/Formula/putty.rb
index d03f3f7..45eee9e 100644
--- a/Library/Formula/putty.rb
+++ b/Library/Formula/putty.rb
@@ -21,9 +21,11 @@ class Putty < Formula
     depends_on "halibut" => :build
     depends_on "autoconf" => :build
     depends_on "automake" => :build
+    depends_on "gtk+3" => :optional
   end

   depends_on "pkg-config" => :build

   def install
     if build.head?
@@ -37,17 +39,24 @@ class Putty < Formula
       --disable-silent-rules
       --disable-dependency-tracking
       --disable-gtktest
-      --without-gtk
     ]

+    if build.head? && build.with?("gtk+3")
+      args << "--with-gtk=3" << "--without-quartz"
+    else
+      args << "--without-gtk"
+    end
+
     system "./configure", *args

     build_version = build.head? ? "git-#{version}" : version
     system "make", "VER=-DRELEASE=#{build_version}"

+    bin.install %w[putty puttytel pterm] if build.head? && build.with?("gtk+3")
     bin.install %w[plink pscp psftp puttygen]

     cd "doc" do
+      man1.install %w[putty.1 puttytel.1 pterm.1] if build.head? && build.with?("gtk+3")
       man1.install %w[plink.1 pscp.1 psftp.1 puttygen.1]
     end
   end

@DomT4
Copy link
Contributor

DomT4 commented Oct 9, 2015

Dropped the dev an email regarding the segfault. Got a reply. Possibly related to our very new GTK+3 version and some deprecations around that, but he's open to fixes:

I've so far only tried building GTK 3 PuTTY against GTK 3.10 and 3.16 -
even Debian unstable hasn't gone to 3.18 yet, and the version of
GTK/Quartz I installed via jhbuild to attempt a (more or less) native OS
X port is also only 3.16. So there could perfectly well be an
incompatibility with this extremely new GTK.

Alternatively, it might be some kind of a confusion over GTK back ends.
Your configure command line includes --without-quartz, i.e. you're
disabling the (unfinished) source-code tweaks I've been making in order
to work more usefully with the OS X GUI; and yet your backtrace points
at im-quartz.so, which suggests that you're running the GTK Quartz back
end without my deliberate workarounds for its problems.

So I'd have to say that if you can debug this problem then I'll be
interested to hear what the answer turns out to be (and quite likely
accept a patch fixing it), but at the moment I have no platform I can
debug it on myself. As and when GTK 3.18 appears on systems I can
conveniently access, I expect I'll find out more.

Cheers,
Simon

The line about the Quartz backend is interesting because I thought GTK+3 had killed that, and if you don't pass that option it dies during configure looking for gdkx.h which is no longer generated. @tschoonj may know more or have some thoughts around this.

@DomT4
Copy link
Contributor

DomT4 commented Oct 9, 2015

For anyone curious, the referenced backtrace:

rocess 60525 stopped
* thread #1: tid = 0x701a12, 0x00000001057dfbb5 im-quartz.so`discard_preedit + 56, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x00000001057dfbb5 im-quartz.so`discard_preedit + 56
im-quartz.so`discard_preedit:
->  0x1057dfbb5 <+56>: cmpq   %rax, (%rcx)
    0x1057dfbb8 <+59>: je     0x1057dfc51               ; <+212>
    0x1057dfbbe <+65>: movq   %rbx, %rdi
    0x1057dfbc1 <+68>: movq   %rax, %rsi
(lldb) bt
* thread #1: tid = 0x701a12, 0x00000001057dfbb5 im-quartz.so`discard_preedit + 56, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x00000001057dfbb5 im-quartz.so`discard_preedit + 56
    frame #1: 0x00000001001b5122 libgtk-3.0.dylib`gtk_entry_focus_out + 100
    frame #2: 0x00000001002192b5 libgtk-3.0.dylib`_gtk_marshal_BOOLEAN__BOXED + 85
    frame #3: 0x0000000100a14416 libgobject-2.0.0.dylib`g_closure_invoke + 262
    frame #4: 0x0000000100a2952a libgobject-2.0.0.dylib`signal_emit_unlocked_R + 2102
    frame #5: 0x0000000100a2a0fe libgobject-2.0.0.dylib`g_signal_emit_valist + 2068
    frame #6: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #7: 0x0000000100306da4 libgtk-3.0.dylib`gtk_widget_event_internal + 539
    frame #8: 0x000000010030bb14 libgtk-3.0.dylib`gtk_widget_send_focus_change + 191
    frame #9: 0x000000010031bad2 libgtk-3.0.dylib`do_focus_change + 255
    frame #10: 0x000000010031ac83 libgtk-3.0.dylib`gtk_window_real_set_focus + 206
    frame #11: 0x0000000100a17812 libgobject-2.0.0.dylib`g_cclosure_marshal_VOID__OBJECTv + 162
    frame #12: 0x0000000100a14643 libgobject-2.0.0.dylib`_g_closure_invoke_va + 267
    frame #13: 0x0000000100a29d9b libgobject-2.0.0.dylib`g_signal_emit_valist + 1201
    frame #14: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #15: 0x000000010031624c libgtk-3.0.dylib`_gtk_window_unset_focus_and_default + 96
    frame #16: 0x00000001003090c7 libgtk-3.0.dylib`gtk_widget_set_child_visible + 164
    frame #17: 0x000000010024027a libgtk-3.0.dylib`gtk_notebook_real_switch_page + 88
    frame #18: 0x0000000100a14416 libgobject-2.0.0.dylib`g_closure_invoke + 262
    frame #19: 0x0000000100a2952a libgobject-2.0.0.dylib`signal_emit_unlocked_R + 2102
    frame #20: 0x0000000100a2a03e libgobject-2.0.0.dylib`g_signal_emit_valist + 1876
    frame #21: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #22: 0x000000010023b0a4 libgtk-3.0.dylib`gtk_notebook_set_current_page + 56
    frame #23: 0x00000001000664b6 putty`treeselection_changed + 99
    frame #24: 0x0000000100a14643 libgobject-2.0.0.dylib`_g_closure_invoke_va + 267
    frame #25: 0x0000000100a29d9b libgobject-2.0.0.dylib`g_signal_emit_valist + 1201
    frame #26: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #27: 0x00000001002ea49c libgtk-3.0.dylib`gtk_tree_view_real_set_cursor + 347
    frame #28: 0x00000001002f8f2a libgtk-3.0.dylib`gtk_tree_view_multipress_gesture_pressed + 1693
    frame #29: 0x0000000100da5934 libffi.6.dylib`ffi_call_unix64 + 76
    frame #30: 0x0000000100da5267 libffi.6.dylib`ffi_call + 831
    frame #31: 0x0000000100a15990 libgobject-2.0.0.dylib`g_cclosure_marshal_generic_va + 1567
    frame #32: 0x0000000100a14643 libgobject-2.0.0.dylib`_g_closure_invoke_va + 267
    frame #33: 0x0000000100a29d9b libgobject-2.0.0.dylib`g_signal_emit_valist + 1201
    frame #34: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #35: 0x00000001001e34c0 libgtk-3.0.dylib`gtk_gesture_multi_press_begin + 297
    frame #36: 0x0000000100a17598 libgobject-2.0.0.dylib`g_cclosure_marshal_VOID__BOXEDv + 183
    frame #37: 0x0000000100a14643 libgobject-2.0.0.dylib`_g_closure_invoke_va + 267
    frame #38: 0x0000000100a29d9b libgobject-2.0.0.dylib`g_signal_emit_valist + 1201
    frame #39: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #40: 0x00000001001e11bd libgtk-3.0.dylib`_gtk_gesture_check_recognized + 96
    frame #41: 0x00000001001e1e25 libgtk-3.0.dylib`gtk_gesture_handle_event + 487
    frame #42: 0x00000001001e46a6 libgtk-3.0.dylib`gtk_gesture_single_handle_event + 322
    frame #43: 0x00000001001beb53 libgtk-3.0.dylib`gtk_event_controller_handle_event + 61
    frame #44: 0x000000010030706c libgtk-3.0.dylib`_gtk_widget_run_controllers + 158
    frame #45: 0x0000000100219385 libgtk-3.0.dylib`_gtk_marshal_BOOLEAN__BOXEDv + 184
    frame #46: 0x0000000100a14643 libgobject-2.0.0.dylib`_g_closure_invoke_va + 267
    frame #47: 0x0000000100a29d9b libgobject-2.0.0.dylib`g_signal_emit_valist + 1201
    frame #48: 0x0000000100a2a70e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #49: 0x0000000100306da4 libgtk-3.0.dylib`gtk_widget_event_internal + 539
    frame #50: 0x0000000100218493 libgtk-3.0.dylib`propagate_event + 367
    frame #51: 0x0000000100217d02 libgtk-3.0.dylib`gtk_main_do_event + 1591
    frame #52: 0x00000001006e8888 libgdk-3.0.dylib`gdk_event_dispatch + 50
    frame #53: 0x0000000100a80123 libglib-2.0.0.dylib`g_main_context_dispatch + 276
    frame #54: 0x0000000100a8040d libglib-2.0.0.dylib`g_main_context_iterate + 413
    frame #55: 0x0000000100a80663 libglib-2.0.0.dylib`g_main_loop_run + 207
    frame #56: 0x00000001002175b9 libgtk-3.0.dylib`gtk_main + 74
    frame #57: 0x00000001000663d3 putty`do_config_box + 2792
    frame #58: 0x0000000100076461 putty`cfgbox + 54
    frame #59: 0x0000000100071a83 putty`pt_main + 490
    frame #60: 0x00000001000766db putty`main + 89
    frame #61: 0x00007fff93cc45ad libdyld.dylib`start + 1
    frame #62: 0x00007fff93cc45ad libdyld.dylib`start + 1

@tschoonj
Copy link
Contributor

tschoonj commented Oct 9, 2015

I cloned the putty repository and managed to get the master branch compiling and running properly: no segfault when I launched putty and I managed to make a connection to an SSH server.

I had to make the following changes to configure.ac:

diff --git a/configure.ac b/configure.ac
index 82fae26..9cb517f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,22 +97,6 @@ case "$gtk_version_desired:$gtk" in
     ;;
 esac

-case "$gtk_version_desired:$gtk" in
-  1:none | any:none)
-    ifdef([AM_PATH_GTK],[
-    AM_PATH_GTK([1.2.0], [gtk=1], [])
-    ],[
-    # manual check for gtk1
-    AC_PATH_PROG(GTK1_CONFIG, gtk-config, absent)
-    if test "$GTK1_CONFIG" != "absent"; then
-      GTK_CFLAGS=`"$GTK1_CONFIG" --cflags`
-      GTK_LIBS=`"$GTK1_CONFIG" --libs`
-      gtk=1
-    fi
-    ])
-    ;;
-esac
-
 AM_CONDITIONAL(HAVE_GTK, [test "$gtk" != "none"])

 if test "$gtk" = "2" -o "$gtk" = "3"; then
@@ -170,7 +154,7 @@ AS_IF([test AS_VAR_GET(x_cv_linux_so_peercred) = yes],

 if test "x$GCC" = "xyes"; then
   :
-  AC_SUBST(WARNINGOPTS, ['-Wall -Werror'])
+  AC_SUBST(WARNINGOPTS, [])
 else
   :
   AC_SUBST(WARNINGOPTS, [])

The first part is necessary because I don't have gtk+1 installed (no one should be expected to do that nowadays anyway) and the second part is necessary because gtk_adjustment_changed is marked as deprecated and triggers a compilation error when -Wall is on. This may not be the case when compiling with CC=clang.

Afterwards I ran configure as:

./configure --with-gtk=3 --disable-gtktest --with-quartz

The --with-quartz is necessary otherwise it will try to include some gdk-x11 headers at compile time.

@Rostish
Copy link

Rostish commented Oct 31, 2015

Guys! Hello to everyone.
Solution is exist?
I need putty ;(

@tschoonj
Copy link
Contributor

I recommend you use Cyberduck until a new version of Putty is released that supports gtk+3.

@DomT4
Copy link
Contributor

DomT4 commented Oct 31, 2015

@tschoonj Upstream may well take your patch if you submit it to them. They were interested in getting that fixed.

@tschoonj
Copy link
Contributor

I doubt they would accept my patch: I think they explicitly want to keep the gtk+1 support

@DomT4 DomT4 mentioned this issue Nov 8, 2015
@DomT4
Copy link
Contributor

DomT4 commented Nov 8, 2015

This should work now, per local testing.

brew update && brew install putty --HEAD --with-gtk+3

@DomT4 DomT4 closed this as completed in 33fc01c Nov 8, 2015
@mccanns
Copy link

mccanns commented Mar 18, 2016

This is happening again with the latest HEAD

$ brew update && brew install putty --HEAD --wth-gtk+3
Already up-to-date.
==> Cloning git://git.tartarus.org/simon/putty.git
Updating /Library/Caches/Homebrew/putty--git
==> Checking out branch master
==> ./mkfiles.pl
==> ./mkauto.sh
==> make -C doc
==> ./configure --prefix=/usr/local/Cellar/putty/HEAD --disable-silent-rules --disable-gtktest --without-gtk
==> make VER=-DRELEASE=svn-HEAD
🍺 /usr/local/Cellar/putty/HEAD: 11 files, 1.7M, built in 18 seconds
$ ls /usr/local/Cellar/putty/HEAD/bin/
plink pscp psftp puttygen

@tschoonj
Copy link
Contributor

Theres a typo in your command.

Try

brew install putty --HEAD --with-gtk+3

@mccanns
Copy link

mccanns commented Mar 18, 2016

ha ha, whoops. Cheers!

@yan12125
Copy link

Now the build fails with the following error:

rm -rf unix/PuTTY.app && gtk-mac-bundler unix/putty.bundle
/bin/sh: gtk-mac-bundler: command not found

Installed packages:

$ brew list
atk                          gtk+                            libtool
autoconf                        gtk+3                           openssl
automake                        gtk-mac-integration             pango
brew-rmtree                     halibut                         pixman
cairo                           harfbuzz                        pkg-config
fontconfig                      hicolor-icon-theme              py2cairo
freetype                        htop                            pygobject
gdbm                            icu4c                           pygtk
gdk-pixbuf                      jpeg                            python
gettext                         libepoxy                        readline
glib                            libffi                          sqlite
gobject-introspection           libpng                          sshfs
gsettings-desktop-schemas       libtiff

@yan12125
Copy link

Should I report it to https://github.com/Homebrew/homebrew-core?

@yan12125
Copy link

Reported: Homebrew/homebrew-core#1078.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants