Can't build from head on os x: history_set_history_state (undeclared identifier)

130 views
Skip to first unread message

Simon Beaumont

unread,
Mar 13, 2013, 5:47:39 AM3/13/13
to pure...@googlegroups.com
autreconf
./configure --enable-release
make

pure.cc:385:3: error: use of undeclared identifier 'history_set_history_state'
  history_set_history_state(my_hist);

same deal with gcc or clang

what am I missing?

Thanks

Albert Graef

unread,
Apr 29, 2013, 5:05:15 AM4/29/13
to pure...@googlegroups.com
Hmm , what readline version do you use? readline or editline? I've seen that error with editline before, but I thought I fixed it in the repo.

If the problem persists, please submit a bug report.

Thanks,
Albert



--
You received this message because you are subscribed to the Google Groups "pure-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pure-lang+...@googlegroups.com.
To post to this group, send email to pure...@googlegroups.com.
Visit this group at http://groups.google.com/group/pure-lang?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  agg...@gmail.com
WWW:    http://www.musikinformatik.uni-mainz.de/ag

Gracjan Polak

unread,
Nov 6, 2013, 6:43:08 PM11/6/13
to pure...@googlegroups.com
Hi,

I've hit the same problem. On Mac OS X Xcode 5 ships with readline:

#define RL_READLINE_VERSION     0x0402

Interestingly enough this readline version has HISTORY_STATE   *history_get_history_state(void); but does not have (neither in header nor in the dylib) void history_set_history_state(HISTORY_STATE   *);

Xcode comes also with editline, same version. editline does not have <editline/history.h> header but has the HISTORY_STATE   *history_get_history_state(void); and does not have void history_set_history_state(HISTORY_STATE   *);

So:
- Mac OS X comes with broken readline
- Mac OS X comes with broken editline
- aclocal.m4 detects that readline has history support but does not detect that it is broken
- aclocal.m4 does not detect that editline has history support but if it did it should detect that history support is broken

The best solution would be probably to not use history_set_history_state at all. Why is it useful?

--
Gracjan

Albert Graef

unread,
Nov 6, 2013, 7:17:20 PM11/6/13
to pure...@googlegroups.com
On Thu, Nov 7, 2013 at 12:43 AM, Gracjan Polak <gracja...@gmail.com> wrote:
> I've hit the same problem. On Mac OS X Xcode 5 ships with readline:

Did you try with the latest source from the hg repo? Specifically, in
rev. 1f5250e I added a check for the history_set_history_state
function which is supposed to get rid of the problem, see
https://bitbucket.org/purelang/pure-lang/commits/1f5250e. If this
doesn't solve the problem then please reopen
https://bitbucket.org/purelang/pure-lang/issue/3.

> Interestingly enough this readline version has HISTORY_STATE
> *history_get_history_state(void); but does not have (neither in header nor
> in the dylib) void history_set_history_state(HISTORY_STATE *);

Then rev. 1f5250e will hopefully detect that situation.

> The best solution would be probably to not use history_set_history_state at
> all. Why is it useful?

It's needed to maintain separate histories for the interpreter,
debugger and the readline module. The interpreter can live without it,
but then all invocations of readline will use the same history.

Albert

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email: agg...@gmail.com
WWW: https://plus.google.com/+AlbertGraef

Ryan Schmidt

unread,
Nov 6, 2013, 8:15:45 PM11/6/13
to pure...@googlegroups.com

On Nov 6, 2013, at 17:43, Gracjan Polak wrote:

> - Mac OS X comes with broken readline
> - Mac OS X comes with broken editline

That’s a shame. Be sure to report that to Apple so they can fix it!

https://bugreport.apple.com/

Albert Graef

unread,
Nov 6, 2013, 8:34:49 PM11/6/13
to pure...@googlegroups.com
On Thu, Nov 7, 2013 at 2:15 AM, Ryan Schmidt <googl...@ryandesign.com> wrote:
> On Nov 6, 2013, at 17:43, Gracjan Polak wrote:
>> - Mac OS X comes with broken readline
>> - Mac OS X comes with broken editline
>
> That’s a shame. Be sure to report that to Apple so they can fix it!

editline ought to be fixed upstream somewhere. I'm not sure which of
the various libedit/editline versions floating around on the net that
would be, but http://thrysoee.dk/editline/ seems to have the most
up-to-date source outside the *BSD trees.

The "readline" on OSX is another matter, though. Maybe it's in fact
just editline in disguise, for license reasons?

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email: agg...@gmail.com
WWW: https://plus.google.com/+AlbertGraef

Ryan Schmidt

unread,
Nov 7, 2013, 4:15:01 PM11/7/13
to pure...@googlegroups.com

On Nov 6, 2013, at 19:34, Albert Graef wrote:

> The "readline" on OSX is another matter, though. Maybe it's in fact
> just editline in disguise, for license reasons?

So it would appear.

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.9
BuildVersion: 13A603
$ ls -l /usr/include/readline/*
lrwxr-xr-x 1 root wheel 22 Oct 23 07:21 /usr/include/readline/history.h -> ../editline/readline.h
lrwxr-xr-x 1 root wheel 22 Oct 23 07:21 /usr/include/readline/readline.h -> ../editline/readline.h
$ head -n 8 /usr/include/editline/readline.h
/* $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $ */

/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jaromir Dolecek.
$


Gracjan Polak

unread,
Nov 8, 2013, 4:34:31 AM11/8/13
to pure...@googlegroups.com

Confirmed that HEAD has history_set_history_state worked around.

-- 
Gracjan

Gracjan Polak

unread,
Nov 8, 2013, 5:23:36 AM11/8/13
to pure...@googlegroups.com
....but the history support seems to work a bit by accident.

I've dug in and reported more details:


TL;RD; Using editline history support configures itself based on readline/history presence. Should not.

-- 

Gracjan


Reply all
Reply to author
Forward
0 new messages