Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#63371 closed defect (duplicate)

base: if readline is installed in the source directory that is specified by --with-curlprefix and if --enable-readline is added to the configure args, then the build of macports-base will fail

Reported by: snowflake (Dave Evans) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.7.99
Keywords: Cc:
Port:

Description

When building the port command, adding additional configure options breaks the compilation of readline.

I modified standard_configure.sh to read:

env PATH=/usr/bin:/bin:/usr/sbin:/sbin CFLAGS="-pipe -Os" ./configure --enable-readline --with-curlprefix=/opt/local "$@"

Now make comes up with an error when building readline.o:

clang -std=gnu11 -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -pipe -Os -std=c99 -Wextra -Wall -pedantic  -I/opt/local/include   -DHAVE_CONFIG_H -I/Users/davidevans/macports/sources/github.com/macports/macports-base/src -I/Users/davidevans/macports/sources/github.com/macports/macports-base/src -I. -I/Users/davidevans/macports/sources/github.com/macports/macports-base/vendor/vendor-destroot/opt/local/libexec/macports/include -I./../compat -fno-common readline.c -o readline.o
readline.c:133:23: error: use of undeclared identifier
      'username_completion_function'; did you mean
      'rl_username_completion_function'?
  ...generator_func = USERNAME_COMPLETION_FUNCTION;
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      rl_username_completion_function
readline.c:54:39: note: expanded from macro 'USERNAME_COMPLETION_FUNCTION'
#       define USERNAME_COMPLETION_FUNCTION     username_completion_function
                                                ^
/opt/local/include/readline/readline.h:485:14: note: 
      'rl_username_completion_function' declared here
extern char *rl_username_completion_function PARAMS((const char *, int));
             ^
1 error generated.

Change History (10)

comment:1 Changed 3 years ago by kencu (Ken)

I've built MacPorts hundreds of times on systems from 10.4 PPC to Ubuntu using --with-curlprefix=/path/to/curl, and it always works.

Just download source, run ./configure --with-curlprefix=/path/to/curl, then make and sudo make install.

Why did you feel you needed to edit something? Please just give it a try with a clean copy of the unedited source, and it's likely to work...it has every single time for me.

comment:2 in reply to:  1 Changed 3 years ago by snowflake (Dave Evans)

Replying to kencu:

I've built MacPorts hundreds of times on systems from 10.4 PPC to Ubuntu using --with-curlprefix=/path/to/curl, and it always works.

I thought curl + readline might be useful together.

comment:3 Changed 3 years ago by kencu (Ken)

well perhaps they are...If I wanted to reproduce your issue myself exactly as you see it, can you tell me the specific steps you would do from no macports installed at all to seeing the error you see?

comment:4 Changed 3 years ago by jmroot (Joshua Root)

Building against things in the same prefix you're building base for is always going to be problematic. You at least need --disable-flag-sanitization for it to work, and you may find you end up using more things in the prefix than you wanted to.

comment:5 in reply to:  3 Changed 3 years ago by snowflake (Dave Evans)

Replying to kencu:

well perhaps they are...If I wanted to reproduce your issue myself exactly as you see it, can you tell me the specific steps you would do from no macports installed at all to seeing the error you see?

I already have Macports installed.

  1. Edit standard_configure.sh to change the line to the one I posted above.
  1. make clean and run standard_configure.sh
  1. Run make and observe the error I posted above.
  1. Remove --enable-readline from standard_configure.sh
  1. Repeat step 2.
  1. make
  1. Get a successful build and install it.
  1. Observe that mpstats submit works on Mountain Lion, which is what I was trying to achieve in the first place, as it does not work with the system curl.

I realise that there is a chicken-and-egg problem in a fresh install. I can live without the readline facility in port as I do not use it very much.

Trying to upgrade curl may also have problems.

comment:6 Changed 3 years ago by kencu (Ken)

Thanks.

I have been building MacPorts for many years using a newer curl on older systems. What I do is install a second MacPorts in /opt/bootstrap, install curl in that, and then reference that curl when I install the main macports in /opt/local.

I have never touched standard_configure.sh in all these years.

I use ./configure --with-curlprefix=/opt/bootstrap

I will try ./configure --with-curlprefix=/opt/bootstrap --enable-readline. That ought to work without errors. If that fails, then I think we may have something to fix.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:7 Changed 3 years ago by kencu (Ken)

So yes, if readline is installed in the source directory that is specified by --with-curlprefix and if --enable-readline is added to the configure args, then the build of macports-base will fail as you noted.

I presume at some point Josh might get around to making base build against the newer readline, maybe. Someday :>

comment:8 Changed 3 years ago by kencu (Ken)

Summary: base port: Adding extra configure options breaks readline buildbase: if readline is installed in the source directory that is specified by --with-curlprefix and if --enable-readline is added to the configure args, then the build of macports-base will fail

comment:9 Changed 3 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed

So duplicate of #57160 then.

Fun fact: the reason --enable-readline is not on by default is that many users had broken readline installations in /usr/local.

comment:10 Changed 3 years ago by kencu (Ken)

yes, always feels like such a waste of effort to sort out the problem only to find out it's been like this for years and sitting in the attic there...but that's the game. You waste time sometimes.

Sounds like enable-readline is an option we might be better off without, but that's possibly because I have no idea why anyone would ever want it anyway...

Note: See TracTickets for help on using tickets.