Bug 187472 - lang/ruby21 -- configure has mistakes/errors relating to pthread detection
lang/ruby21 -- configure has mistakes/errors relating to pthread detection
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Steve Wills
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-12 05:30 UTC by Jeremy Chadwick
Modified: 2014-03-23 15:40 UTC (History)
0 users

See Also:


Attachments
ruby_thread_fix_1.diff.txt (4.52 KB, text/plain; charset=us-ascii)
2014-03-20 06:03 UTC, Steve Wills
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Chadwick 2014-03-12 05:30:00 UTC
	This may affect other ruby ports (ruby19, ruby20), I haven't checked.

	During configure-time, the following lines are shown (and easily
	missed because they scroll by so fast):

checking for pthread_kill in -lpthread... yes
./configure: pthread,: not found
checking for pthread_np.h... yes

	The problem appears to be around line 19613 of the configure script (not
	configure.in, I haven't reviewed that):

19608     if test x"$rb_with_pthread" = xyes; then
19609         $as_echo "#define _REENTRANT 1" >>confdefs.h
19610
19611         $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
19612
19613         pthread,  MAINLIBS="-pthread $MAINLIBS",
19614         $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h

	This looks quite broken.  Since autoconf is used, the "source" for
	this comes from configure.in.  The code for that:

2431     if test x"$rb_with_pthread" = xyes; then
2432         AC_DEFINE(_REENTRANT)
2433         AC_DEFINE(_THREAD_SAFE)
2434         [pthread],  [MAINLIBS="-pthread $MAINLIBS"],
2435         AC_DEFINE(HAVE_LIBPTHREAD)

	Line 2434 shown above comes directly from files/patch-configure.in,
	so it appears to me someone needs to investigate the following:

	1) If files/patch-configure.in is TRULY doing the correct thing
	for ruby21 (and possibly the other ports) -- or if it's even
	necessary (someone may want to talk to the Ruby folks), and,

	2) Examination of post-patch in Makefile to make sure it's doing the
	right thing as well.

	I tried looking at the SVN annotations for this port, but the commit
	lfor the section where post-patch is is so old that it precedes use
	of Subversion thus the commit reason is unknown.

Fix: 

Correct fix unknown at this time.
How-To-Repeat: 	See above.
Comment 1 Edwin Groothuis freebsd_committer 2014-03-12 05:30:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Steve Wills freebsd_committer 2014-03-13 19:36:28 UTC
Responsible Changed
From-To: ruby->swills

I'll take it.
Comment 3 Steve Wills freebsd_committer 2014-03-20 06:03:24 UTC
Hi,

Thanks for the report. You are indeed right. It seems I broke this in r292221,
a long time ago, so it's in all lang/ruby* ports. Please see attached patch
which at least undoes the damage.

I'm really not sure the thread related changes need to be done at all any more,
figuring that out will take a little more time.

Steve
Comment 4 dfilter freebsd_committer 2014-03-23 15:31:48 UTC
Author: swills
Date: Sun Mar 23 15:31:43 2014
New Revision: 348863
URL: http://svnweb.freebsd.org/changeset/ports/348863
QAT: https://qat.redports.org/buildarchive/r348863/

Log:
  - Fix patch broken in r292221
  
  PR:		ports/187472
  Redported by:	Jeremy Chadwick <jdc@koitsu.org>

Modified:
  head/Mk/bsd.ruby.mk
  head/lang/ruby19/files/patch-configure.in
  head/lang/ruby20/files/patch-configure.in
  head/lang/ruby21/files/patch-configure.in

Modified: head/Mk/bsd.ruby.mk
==============================================================================
--- head/Mk/bsd.ruby.mk	Sun Mar 23 15:22:36 2014	(r348862)
+++ head/Mk/bsd.ruby.mk	Sun Mar 23 15:31:43 2014	(r348863)
@@ -177,7 +177,7 @@ RUBY?=			${LOCALBASE}/bin/${RUBY_NAME}
 # Ruby 1.9
 #
 RUBY_RELVERSION=	1.9.3
-RUBY_PORTREVISION=	1
+RUBY_PORTREVISION=	2
 RUBY_PORTEPOCH=		1
 RUBY_PATCHLEVEL=	484
 
@@ -193,7 +193,7 @@ RUBY21=			"@comment "
 # Ruby 2.0
 #
 RUBY_RELVERSION=	2.0.0
-RUBY_PORTREVISION=	4
+RUBY_PORTREVISION=	5
 RUBY_PORTEPOCH=		1
 RUBY_PATCHLEVEL=	353
 
@@ -209,7 +209,7 @@ RUBY21=			"@comment "
 # Ruby 2.1
 #
 RUBY_RELVERSION=	2.1.1
-RUBY_PORTREVISION=	0
+RUBY_PORTREVISION=	1
 RUBY_PORTEPOCH=		1
 RUBY_PATCHLEVEL=	0
 

Modified: head/lang/ruby19/files/patch-configure.in
==============================================================================
--- head/lang/ruby19/files/patch-configure.in	Sun Mar 23 15:22:36 2014	(r348862)
+++ head/lang/ruby19/files/patch-configure.in	Sun Mar 23 15:31:43 2014	(r348863)
@@ -1,6 +1,6 @@
---- configure.in.orig	2013-02-11 14:33:14.000000000 +0000
-+++ configure.in	2013-02-11 14:30:13.000000000 +0000
-@@ -1129,11 +1129,11 @@
+--- configure.in.orig	2014-03-20 05:49:55.847385089 +0000
++++ configure.in	2014-03-20 05:50:09.238383528 +0000
+@@ -1139,11 +1139,11 @@
  [superux*], [	ac_cv_func_setitimer=no
  		],
  [	LIBS="-lm $LIBS"])
@@ -17,7 +17,7 @@
  if test "${enable_win95}" = maybe; then
      AC_HAVE_LIBRARY(unicows, [enable_win95=yes], [enable_win95=no])
  fi
-@@ -1828,7 +1828,7 @@
+@@ -1789,7 +1789,7 @@
  fi
  
  if test x"$enable_pthread" = xyes; then
@@ -26,15 +26,15 @@
  	AC_CHECK_LIB($pthread_lib, pthread_kill,
  		     rb_with_pthread=yes, rb_with_pthread=no)
  	if test "$rb_with_pthread" = "yes"; then break; fi
-@@ -1836,6 +1836,7 @@
-     if test x"$rb_with_pthread" = xyes; then
- 	AC_DEFINE(_REENTRANT)
- 	AC_DEFINE(_THREAD_SAFE)
+@@ -1803,6 +1803,7 @@
+ 	[c],    [],
+ 	[root], [],
+ 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
 +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
- 	AC_DEFINE(HAVE_LIBPTHREAD)
- 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
- 	AS_CASE([$pthread_lib],
-@@ -2080,7 +2081,6 @@
+ 	        [AS_CASE(["$target_os"],
+ 		    [openbsd*], [LIBS="-pthread $LIBS"],
+ 		    [LIBS="-l$pthread_lib $LIBS"])])
+@@ -2041,7 +2042,6 @@
  			: ${LDSHARED='$(CC) -shared'}
  			if test "$rb_cv_binary_elf" = yes; then
  			    LDFLAGS="$LDFLAGS -rdynamic"
@@ -42,7 +42,7 @@
  			else
  			  test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
  			fi
-@@ -2385,6 +2385,7 @@
+@@ -2348,6 +2348,7 @@
      [freebsd*|dragonfly*], [
  	SOLIBS='$(LIBS)'
  	LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'

Modified: head/lang/ruby20/files/patch-configure.in
==============================================================================
--- head/lang/ruby20/files/patch-configure.in	Sun Mar 23 15:22:36 2014	(r348862)
+++ head/lang/ruby20/files/patch-configure.in	Sun Mar 23 15:31:43 2014	(r348863)
@@ -1,5 +1,5 @@
---- configure.in.orig	2014-02-17 23:37:01.241643774 +0000
-+++ configure.in	2014-02-17 23:38:03.349639470 +0000
+--- configure.in.orig	2014-03-20 05:47:33.807394460 +0000
++++ configure.in	2014-03-20 05:47:49.855394229 +0000
 @@ -1386,11 +1386,11 @@
  AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
  @%:@include <errno.h>])
@@ -26,14 +26,14 @@
  	AC_CHECK_LIB($pthread_lib, pthread_kill,
  		     rb_with_pthread=yes, rb_with_pthread=no)
  	if test "$rb_with_pthread" = "yes"; then break; fi
-@@ -2089,6 +2089,7 @@
-     if test x"$rb_with_pthread" = xyes; then
- 	AC_DEFINE(_REENTRANT)
- 	AC_DEFINE(_THREAD_SAFE)
+@@ -2095,6 +2095,7 @@
+ 	[c],    [],
+ 	[root], [],
+ 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
 +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
- 	AC_DEFINE(HAVE_LIBPTHREAD)
- 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
- 	AS_CASE([$pthread_lib],
+ 	        [AS_CASE(["$target_os"],
+ 		    [openbsd*], [LIBS="-pthread $LIBS"],
+ 		    [LIBS="-l$pthread_lib $LIBS"])])
 @@ -2326,7 +2327,6 @@
  			: ${LDSHARED='$(CC) -shared'}
  			if test "$rb_cv_binary_elf" = yes; then

Modified: head/lang/ruby21/files/patch-configure.in
==============================================================================
--- head/lang/ruby21/files/patch-configure.in	Sun Mar 23 15:22:36 2014	(r348862)
+++ head/lang/ruby21/files/patch-configure.in	Sun Mar 23 15:31:43 2014	(r348863)
@@ -1,5 +1,5 @@
---- configure.in.orig	2014-02-21 23:32:34.000000000 +0000
-+++ configure.in	2014-02-24 14:54:59.432610152 +0000
+--- configure.in.orig	2014-03-20 05:40:57.873422152 +0000
++++ configure.in	2014-03-20 05:40:57.873422152 +0000
 @@ -1084,10 +1084,10 @@
    ],
  [	LIBS="-lm $LIBS"])
@@ -33,14 +33,14 @@
  	AC_CHECK_LIB($pthread_lib, pthread_kill,
  		     rb_with_pthread=yes, rb_with_pthread=no)
  	if test "$rb_with_pthread" = "yes"; then break; fi
-@@ -2431,6 +2431,7 @@
-     if test x"$rb_with_pthread" = xyes; then
- 	AC_DEFINE(_REENTRANT)
- 	AC_DEFINE(_THREAD_SAFE)
+@@ -2437,6 +2437,7 @@
+ 	[c],    [],
+ 	[root], [],
+ 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
 +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
- 	AC_DEFINE(HAVE_LIBPTHREAD)
- 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
- 	AS_CASE([$pthread_lib],
+ 	        [AS_CASE(["$target_os"],
+ 		    [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"],
+ 		    [LIBS="-l$pthread_lib $LIBS"])])
 @@ -2668,7 +2669,6 @@
  			: ${LDSHARED='$(CC) -shared'}
  			if test "$rb_cv_binary_elf" = yes; then
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Steve Wills freebsd_committer 2014-03-23 15:32:04 UTC
State Changed
From-To: open->closed

Patch committed.