Repository navigation
Conversation
|
@erlend-aasland @ned-deily |
This comment was marked as resolved.
This comment was marked as resolved.
|
@erlend-aasland @ned-deily |
| #if defined(_RL_FUNCTION_TYPEDEF) | ||
| on_startup_hook(void) | ||
| { | ||
| #elif defined(__APPLE__) && defined(WITH_EDITLINE) |
There was a problem hiding this comment.
Note that other distributors and users of Python on macOS may be linking to a libedit that is not the Apple-supplied libedit on macOS. For example, MacPorts supplies their own newer version of libedit. So tests like this might not be appropriate. It needs to be tested (see my comments on the issue).
There was a problem hiding this comment.
Ned, then how about defining the new macro WITH_APPLE_READLINE and using it?
(It will only enabled if the user does not designate the readline option through ./configure`)
There was a problem hiding this comment.
Have you established that there aren't also warnings when compiling with versions of editline other than the macOS system one? I literally don't have time to delve into this now as I'm traveling but I did try to do a quick compile with the current MacPorts version of editline I have installed with me and that also produced compile warnings though not exactly the same ones.
There was a problem hiding this comment.
- ./configure: Follow apple readline
- ./configure --with-readline=editline: Follow custom editline
- ./configure --with-readline=readline: Follow custom readline
There was a problem hiding this comment.
Or we can add a version check also: RL_READLINE_VERSION==0x0402, all macOS are using identical versions for built-in readline.
There was a problem hiding this comment.
I'm traveling but I did try to do a quick compile with the current MacPorts version of editline I have installed with me and that also produced compile warnings though not exactly the same ones.
Well, it's up to which commits of Python you are using.
After we reverted Irit's patch, there is no compiler warning for system one too.
But it does not mean that the issue is solved because we don't use proper parameters for apple system built-in library and in the future clang compiler will not skip such a mistake.
Please see my comment: #108588 (comment)
There was a problem hiding this comment.
Well, it's up to which commits of Python you are using.
After we reverted Irit's patch, there is no compiler warning for system one too.
Umm, sorry, it was not reverted yet.
There was a problem hiding this comment.
Have you established that there aren't also warnings when compiling with versions of editline other than the macOS system one?
I will test them and share soon.
There was a problem hiding this comment.
Okay with b89dd4c
I detected the following warnings with homebrew libedit. (./configure --with-readline=editline)
./Modules/readline.c:1269:21: warning: incompatible function pointer types assigning to 'rl_hook_func_t *' (aka 'int (*)(void)') from 'int (const char *, int)' [-Wincompatible-function-pointer-types]
rl_startup_hook = on_startup_hook;
^ ~~~~~~~~~~~~~~~
./Modules/readline.c:1271:23: warning: incompatible function pointer types assigning to 'rl_hook_func_t *' (aka 'int (*)(void)') from 'int (const char *, int)' [-Wincompatible-function-pointer-types]
rl_pre_input_hook = on_pre_input_hook;
And with 67e3a54
there were no compiler warnings.
So I would like to propose updating the policy as I proposed from #108633 (comment)
If people want to custom readline library passing the explicit option looks reasonable and if people want to use the builtin readline library ./configure will be enough.
| [editline|edit], [with_readline=edit], | ||
| [yes|readline], [with_readline=readline], | ||
| [no], [], | ||
| [no], [with_readline=default], |
There was a problem hiding this comment.
This does not feel right; if --with-readline=no we ... default to system readline?
| [Darwin/*], [AC_DEFINE([WITH_APPLE_READLINE], [1]) with_readline=readline], | ||
| [with_readline=readline]) |
There was a problem hiding this comment.
You set with_readline=readline no matter which branch; perhaps you can put that assignment outside the switch.
|
@ned-deily @ronaldoussoren @erlend-aasland |
|
I gave up this PR and promote #108665, which has no side effect for every case. |
Uh oh!
There was an error while loading. Please reload this page.