New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libssh2 does not get properly cleaned #967

Open
nnposter opened this Issue Aug 14, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@nnposter

nnposter commented Aug 14, 2017

Targets clean and distclean leave build leftovers for libssh2. In addition the library uninstall target is called without properly setting libdir so the action fails completely because it is attempted against an incorrect directory.

These remnants are complicating package builds so I am proposing the following change:

--- a/Makefile.in
+++ b/Makefile.in
@@ -140,7 +140,7 @@
 	@echo Compiling libpcap; cd $(LIBPCAPDIR) && $(MAKE)
 
 build-libssh2: $(LIBSSH2DIR)/src/Makefile
-	@echo Compiling libssh2; cd $(LIBSSH2DIR)/src && $(MAKE);
+	@echo Compiling libssh2; cd $(LIBSSH2DIR) && $(MAKE);
 	cd $(LIBSSH2DIR)/src && $(MAKE) libdir="/lib" prefix="" DESTDIR=$(NDIR)/$(LIBSSH2DIR) install-libLTLIBRARIES;
 
 build-zlib: $(ZLIBDIR)/Makefile
@@ -220,8 +220,7 @@
 	-cd $(LIBPCAPDIR) && $(MAKE) clean
 
 clean-libssh2:
-	-cd $(LIBSSH2DIR)/src && $(MAKE) prefix="" DESTDIR=$(NDIR)/$(LIBSSH2DIR) uninstall-libLTLIBRARIES
-	-cd $(LIBSSH2DIR)/src && $(MAKE) prefix="" DESTDIR=$(NDIR)/$(LIBSSH2DIR) clean
+	-cd $(LIBSSH2DIR)/src && $(MAKE) libdir="/lib" prefix="" DESTDIR=$(NDIR)/$(LIBSSH2DIR) uninstall-libLTLIBRARIES
 	-cd $(LIBSSH2DIR) && $(MAKE) clean
 
 clean-zlib:
@@ -269,8 +268,7 @@
 distclean-pcap:
 	-cd $(LIBPCAPDIR) && $(MAKE) distclean
 
-distclean-libssh2:
-	-cd $(LIBSSH2DIR)/src && $(MAKE) prefix="" DESTDIR=$(NDIR)/$(LIBSSH2DIR) distclean
+distclean-libssh2: clean-libssh2
 	-cd $(LIBSSH2DIR) && $(MAKE) distclean
 
 distclean-zlib:

@dmiller-nmap Could you please review? I am not quite sure why the libssh2 targets were originally defined this particular way so I might be missing some important aspect.

@ionreflex

This comment has been minimized.

Show comment
Hide comment
@ionreflex

ionreflex Aug 29, 2017

Could that explain the issue I reported to the nmap-dev list identified "Broken git process after checkout/clean"?

ionreflex commented Aug 29, 2017

Could that explain the issue I reported to the nmap-dev list identified "Broken git process after checkout/clean"?

@ionreflex

This comment has been minimized.

Show comment
Hide comment
@ionreflex

ionreflex Sep 3, 2017

... anybody looking at this? The issue is still present and hasn't been acknowledged...

Just checking!

ionreflex commented Sep 3, 2017

... anybody looking at this? The issue is still present and hasn't been acknowledged...

Just checking!

@dmiller-nmap

This comment has been minimized.

Show comment
Hide comment
@dmiller-nmap

dmiller-nmap Sep 11, 2017

I haven't tested this yet, but here are some thoughts:

  1. Definitely need to define libdir any time we $(MAKE) in libssh2. I should have caught this, but I was focused only on the build for OS X.
  2. The libssh2 build process is very strange because we build and install it in order to link against it. Other included libs just get built and then statically linked by pointing directly to the .a archive. IIRC, libssh2's use of libtool makes it hard to do this. But it would be preferable if possible.
  3. There's something odd about running make from the libssh2 directory as opposed to libssh2/src/. But I can't remember what it was.

dmiller-nmap commented Sep 11, 2017

I haven't tested this yet, but here are some thoughts:

  1. Definitely need to define libdir any time we $(MAKE) in libssh2. I should have caught this, but I was focused only on the build for OS X.
  2. The libssh2 build process is very strange because we build and install it in order to link against it. Other included libs just get built and then statically linked by pointing directly to the .a archive. IIRC, libssh2's use of libtool makes it hard to do this. But it would be preferable if possible.
  3. There's something odd about running make from the libssh2 directory as opposed to libssh2/src/. But I can't remember what it was.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment