Bug 187174 - lang/python27: pkg-static: lstat(/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/readline.so): No such file or directory
Summary: lang/python27: pkg-static: lstat(/usr/ports/lang/python27/work/stage/usr/loca...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-01 11:30 UTC by O. Hartmann
Modified: 2014-09-11 06:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2014-03-01 11:30:00 UTC
Update fails (as well as lang/python33) after readline has been updated. Automatic update corrupted.

[...]

Install them as needed.
====
====> Compressing man pages (compress-man)
===>  Installing for python27-2.7.6_4
===>   Registering installation for python27-2.7.6_4
pkg-static: lstat(/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/readline.so): No such file or directory
*** Error code 74
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-01 11:30:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-python

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 koobs 2014-03-01 11:43:13 UTC
Can you attach a complete build log please, or at least the relevant
parts if you know what to look for.
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-03-01 14:10:21 UTC
Author: antoine
Date: Sat Mar  1 14:10:13 2014
New Revision: 346625
URL: http://svnweb.freebsd.org/changeset/ports/346625
QAT: https://qat.redports.org/buildarchive/r346625/

Log:
  - Fix build with readline 6.3 from ports
    the patch was obtained from upstream (issue #20374)
  - Add missing USES=readline
  
  PR:		ports/187174
  Reported by:	O. Hartmann
  Reviewed by:	koobs
  Obtained from:	python

Added:
  head/lang/python27/files/patch-issue20374   (contents, props changed)
Modified:
  head/lang/python27/Makefile

Modified: head/lang/python27/Makefile
==============================================================================
--- head/lang/python27/Makefile	Sat Mar  1 14:08:41 2014	(r346624)
+++ head/lang/python27/Makefile	Sat Mar  1 14:10:13 2014	(r346625)
@@ -22,6 +22,7 @@ MAKE_ENV=		VPATH="${PYTHON_WRKSRC}"
 
 INSTALL_TARGET=	altinstall
 
+USES=		readline
 USE_LDCONFIG=	yes
 USE_PYTHON=	yes
 USE_XZ=		yes

Added: head/lang/python27/files/patch-issue20374
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/python27/files/patch-issue20374	Sat Mar  1 14:10:13 2014	(r346625)
@@ -0,0 +1,55 @@
+# Description: fix readline.so build with readline 6.3
+# Patch obtained from upstream, issue #20374
+# http://bugs.python.org/issue20374
+# PR: ports/187174
+
+--- ./Modules/readline.c.orig	2013-11-10 07:36:41.000000000 +0000
++++ ./Modules/readline.c	2014-03-01 12:40:44.000000000 +0000
+@@ -750,14 +750,22 @@
+ }
+ 
+ static int
++#if defined(_RL_FUNCTION_TYPEDEF)
+ on_startup_hook(void)
++#else
++on_startup_hook()
++#endif
+ {
+     return on_hook(startup_hook);
+ }
+ 
+ #ifdef HAVE_RL_PRE_INPUT_HOOK
+ static int
++#if defined(_RL_FUNCTION_TYPEDEF)
+ on_pre_input_hook(void)
++#else
++on_pre_input_hook()
++#endif
+ {
+     return on_hook(pre_input_hook);
+ }
+@@ -852,7 +860,7 @@
+  * before calling the normal completer */
+ 
+ static char **
+-flex_complete(char *text, int start, int end)
++flex_complete(const char *text, int start, int end)
+ {
+ #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+     rl_completion_append_character ='\0';
+@@ -911,12 +919,12 @@
+     rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
+     rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
+     /* Set our hook functions */
+-    rl_startup_hook = (Function *)on_startup_hook;
++    rl_startup_hook = on_startup_hook;
+ #ifdef HAVE_RL_PRE_INPUT_HOOK
+-    rl_pre_input_hook = (Function *)on_pre_input_hook;
++    rl_pre_input_hook = on_pre_input_hook;
+ #endif
+     /* Set our completion function */
+-    rl_attempted_completion_function = (CPPFunction *)flex_complete;
++    rl_attempted_completion_function = flex_complete;
+     /* Set Python word break characters */
+     completer_word_break_characters =
+         rl_completer_word_break_characters =
_______________________________________________
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 4 Christoph Moench-Tegeder freebsd_committer freebsd_triage 2014-03-01 14:20:38 UTC
Hi,

the relevant portion of the build log is here:
: building 'readline' extension
: cc -fPIC -fno-strict-aliasing -O2 -pipe -march=core2 -fno-strict-aliasing -DNDEBUG -I. -IInclude -I./../Include -I/usr/local/include -I/usr/ports/lang/python27/work/Python-2.7.6/Include -I/usr/ports/lang/python27/work/Python-2.7.6/portbld.static -c /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c -o build/temp.freebsd-10.0-RELEASE-amd64-2.7/usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.o
: /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:914:24: error: use of undeclared identifier 'Function'
:    rl_startup_hook = (Function *)on_startup_hook;
:                       ^
: /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:914:34: error: expected expression
:     rl_startup_hook = (Function *)on_startup_hook;
:                                 ^
: /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:916:26: error: use of undeclared identifier 'Function'
:     rl_pre_input_hook = (Function *)on_pre_input_hook;
:                         ^
: /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:916:36: error: expected expression
:     rl_pre_input_hook = (Function *)on_pre_input_hook;
:                                   ^
: /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:919:41: error: use of undeclared identifier 'CPPFunction'; did you mean 'PyCFunction'?
:     rl_attempted_completion_function = (CPPFunction *)flex_complete;
:                                        ^
: /usr/ports/lang/python27/work/Python-2.7.6/Modules/readline.c:919:54: error: expected expression
:     rl_attempted_completion_function = (CPPFunction *)flex_complete;
:                                                     ^
: 6 errors generated.

The "old-style" typedefs (Function, VFunction, CPFunction and CPPFunciton)
where removed from readline 6.3.

Here's a patch which "works for me" (by using the "new-style" typedefs
if available), ready for being used as
ports/lang/python27/files/patch-Modules-readline.c . In case some mail
system mangles this patch, it's also here:
http://burggraben.net/hacks/patch-Modules-readline.c.gz


--- Modules/readline.c.orig	2014-03-01 14:59:16.000000000 +0100
+++ Modules/readline.c	2014-03-01 15:04:48.000000000 +0100
@@ -911,12 +911,24 @@
     rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
     rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
     /* Set our hook functions */
+#ifdef _RL_FUNCTION_TYPEDEF
+    rl_startup_hook = (rl_hook_func_t *)on_startup_hook;
+#else
     rl_startup_hook = (Function *)on_startup_hook;
+#endif
 #ifdef HAVE_RL_PRE_INPUT_HOOK
+#ifdef _RL_FUNCTION_TYPEDEF
+    rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook;
+#else
     rl_pre_input_hook = (Function *)on_pre_input_hook;
 #endif
+#endif
     /* Set our completion function */
+#ifdef _RL_FUNCTION_TYPEDEF
+    rl_attempted_completion_function = (rl_completion_func_t *)flex_complete;
+#else
     rl_attempted_completion_function = (CPPFunction *)flex_complete;
+#endif
     /* Set Python word break characters */
     completer_word_break_characters =
         rl_completer_word_break_characters =



I haven't checked if this has been fixed upstream (I'll have to check
their repo). If not I'll report it there, and in any case I'll report
back with a link to the issue in the python tracker and/or repo.
In the meantime, please review and test my patch :) I believe this
or something very similar should fix the issue in the other python
verions (e.g. PR ports/187176).

Regards,
Christoph

-- 
Spare Space
Comment 5 Christoph Moench-Tegeder freebsd_committer freebsd_triage 2014-03-01 14:34:30 UTC
Never mind, you were faster.

Regards,
Christoph

-- 
Spare Space
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2014-03-01 14:43:38 UTC
State Changed
From-To: open->closed

A patch was committed for this issue, please update your ports tree and verify.
Comment 7 Alonso Schaich freebsd_committer freebsd_triage 2014-09-11 06:01:28 UTC
This (python build emiting lib-dynload/missing_readline.so instead of lib-dynload/readline.so) just reappeared to me using a recent ports tree copy (r367885) on a recent version of FreeBSD10-STABLE (r271403). I gave it some analysis and found out python needs the installed devel/readline to have been built with the TERMCAP option set.

I.e. to reproduce reinstall devel/readline with TERMCAP disabled and attempt to package lang/python27.

Regards,
  Alonso Schaich