Opened 13 years ago

Closed 13 years ago

#29135 closed defect (worksforme)

readline: error: 'LC_CTYPE' undeclared

Reported by: bbarth@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: readline

Description (last modified by ryandesign (Ryan Carsten Schmidt))

After a selfupdate, while trying to upgrade outdated packages, I ran into the following problem:

rye(49)$ sudo port upgrade readline
--->  Computing dependencies for readline
--->  Building readline
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for readline is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/main.log
Error: Unable to upgrade port: 1

I tried uninstalling it and re-executing the command to no avail.

Here's the message from the log:

rye(50)$ more /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/main.log
version:1
:msg:main --->  Computing dependencies for readline:info:main .:debug:main Searching for dependency: ncurses
:debug:main Found Dependency: receipt exists for ncurses
:msg:main 
:debug:main Executing org.macports.main (readline)
:debug:main Skipping completed org.macports.fetch (readline)
:debug:main Skipping completed org.macports.checksum (readline)
:debug:main Skipping completed org.macports.extract (readline)
:debug:main Skipping completed org.macports.patch (readline)
:debug:main Skipping completed org.macports.configure (readline)
:msg:main --->  Building readline
:debug:build build phase started at Thu Apr 14 13:36:51 CDT 2011
:debug:build Executing org.macports.build (readline)
:debug:build Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.6'
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/work/readline-6.2" && /usr/bin/make -j4 all'
:info:build rm -f complete.o
:info:build rm -f terminal.o
:info:build rm -f text.o
:info:build rm -f nls.o
:info:build /usr/bin/gcc-4.2 -c -DHAVE_CONFIG_H   -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -pipe -O2 -arch x86_64 complete.c
:info:build /usr/bin/gcc-4.2 -c -DHAVE_CONFIG_H   -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -pipe -O2 -arch x86_64 terminal.c
:info:build /usr/bin/gcc-4.2 -c -DHAVE_CONFIG_H   -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -pipe -O2 -arch x86_64 text.c
:info:build /usr/bin/gcc-4.2 -c -DHAVE_CONFIG_H   -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -pipe -O2 -arch x86_64 nls.c
:info:build nls.c: In function '_rl_init_eightbit':
:info:build nls.c:114: error: 'LC_CTYPE' undeclared (first use in this function)
:info:build nls.c:114: error: (Each undeclared identifier is reported only once
:info:build nls.c:114: error: for each function it appears in.)
:info:build nls.c:114: warning: assignment makes pointer from integer without a cast
:info:build nls.c:117: warning: assignment makes pointer from integer without a cast
:info:build complete.c: In function 'rl_username_completion_function':
:info:build complete.c:2045: warning: assignment makes pointer from integer without a cast
:info:build complete.c:2048: error: dereferencing pointer to incomplete type
:info:build complete.c:2048: error: dereferencing pointer to incomplete type
:info:build complete.c:2062: error: dereferencing pointer to incomplete type
:info:build complete.c:2066: error: dereferencing pointer to incomplete type
:info:build complete.c:2066: error: dereferencing pointer to incomplete type
:info:build complete.c: In function 'rl_filename_completion_function':
:info:build complete.c:2141: error: nested functions are disabled, use -fnested-functions to re-enable
:info:build complete.c:2141: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
:info:build complete.c:2141: error: 'directory' undeclared (first use in this function)
:info:build complete.c:2141: error: (Each undeclared identifier is reported only once
:info:build complete.c:2141: error: for each function it appears in.)
:info:build complete.c:2141: error: 'DIR' undeclared (first use in this function)
:info:build complete.c:2141: error: expected expression before ')' token
:info:build complete.c:2158: error: expected expression before ')' token
:info:build complete.c:2258: warning: assignment makes pointer from integer without a cast
:info:build complete.c:2260: error: dereferencing pointer to incomplete type
:info:build complete.c:2261: error: dereferencing pointer to incomplete type
:info:build complete.c:2293: error: expected expression before ')' token
:info:build complete.c:2321: error: dereferencing pointer to incomplete type
:info:build complete.c:2334: error: dereferencing pointer to incomplete type
:info:build make: *** [nls.o] Error 1
:info:build make: *** Waiting for unfinished jobs....
:info:build make: *** [complete.o] Error 1
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/work/readline-6.2" && /usr/bin/make -j4 all " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"

Uninstalling readline has left me with a bunch of unusable packages, so any help will be greatly appreciated.

Attachments (3)

main.log (18.8 KB) - added by bbarth@… 13 years ago.
main.2.log (18.8 KB) - added by bbarth@… 13 years ago.
config.log (85.6 KB) - added by bbarth@… 13 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 13 years ago by bbarth@…

My title doesn't make a lot of sense. It should say "...fails to upgrade or install". Sorry.

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to mcalhoun@…
Port: readline added
Summary: readline fails to upgrade or uninstallreadline: error: 'LC_CTYPE' undeclared

It might help to have the complete log. Clean and try again and attach the complete main.log file.

sudo port clean readline
sudo port install readline

Changed 13 years ago by bbarth@…

Attachment: main.log added

comment:3 in reply to:  2 Changed 13 years ago by bbarth@…

Done. It didn't help. Complete log file is now attached.

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

Anything in /usr/local/include?

comment:5 Changed 13 years ago by bbarth@…

rye(78)$ ls /usr/local/include/
fuse  fuse.h

That's it. Moving /usr/local/include to /usr/local/include.save and cleaning and reattempting the readline install leads to the same errors.

comment:6 in reply to:  4 Changed 13 years ago by bbarth@…

Any thoughts or updates on this? Is there an easy way that I can list all my installed ports, erase everything and start over? Is there a fix in the works? :)

comment:7 Changed 13 years ago by bbarth@…

Any news? I'm happy to do anything on my end to help diagnose. I'm stranded at the moment.

comment:8 Changed 13 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Status: newassigned

It seems that you get a different set of errors between postings.
In your original posting, the file nls.c had errors, but it did not in the second.
Do you have any idea what changed between the two attempts?

It seems that your build is not properly including system header files (/usr/include/locale.h in the first post, /usr/include/pwd.h, and /usr/include/dirent.h).

Could you please

  • Keep /usr/local/include as /usr/local/include.save
  • Check to see if files named locale.h, pwd.h, or direct.h are in /opt/local/include
  • clean readline and attempt to reinstall
  • post the main.log again
  • post config.log (probably found in /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/readline/work/readline-6.2)

comment:9 Changed 13 years ago by bbarth@…

The only thing that changed between reports was that I followed Ryan's request to clean and reinstall readline. The files you wanted me to look for are missing:

rye(37)$ find /opt/local/include/ -name direct.h rye(38)$ find /opt/local/include/ -name pwd.h rye(39)$ find /opt/local/include/ -name locale.h

What port should they have come from? Maybe a dependency is broken somewhere.

I'm skipping the clean and reinstall for now given that these files don't exist.

comment:10 in reply to:  9 Changed 13 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to bbarth@…:

The only thing that changed between reports was that I followed Ryan's request to clean and reinstall readline. The files you wanted me to look for are missing:

rye(37)$ find /opt/local/include/ -name direct.h rye(38)$ find /opt/local/include/ -name pwd.h rye(39)$ find /opt/local/include/ -name locale.h

What port should they have come from? Maybe a dependency is broken somewhere.

I'm skipping the clean and reinstall for now given that these files don't exist.

Sorry, I meant to confirm that they are NOT be in /opt/local/include (which you did).
If there had been any of these files in /opt/local/include, they would have shadowed the ones in /usr/include, and it would have helped explain the problem.
Since that source of error has been ruled out, we can continue looking for other possibilities.

comment:11 Changed 13 years ago by bbarth@…

Ah, OK. Well I've followed the rest of your instructions and cleaned and reinstalled.

rye(40)$ sudo port clean readline
Password:
--->  Cleaning readline
rye(41)$ sudo port install readline
--->  Computing dependencies for readline
--->  Fetching readline
--->  Verifying checksum(s) for readline
--->  Extracting readline
--->  Applying patches to readline
--->  Configuring readline
--->  Building readline
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for readline is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_readline/main.log

Changed 13 years ago by bbarth@…

Attachment: main.2.log added

Changed 13 years ago by bbarth@…

Attachment: config.log added

comment:12 Changed 13 years ago by bbarth@…

Any news?

comment:13 Changed 13 years ago by bbarth@…

ping?

comment:14 Changed 13 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

I am sorry, but I am at a loss as to what the problem might be.
As far as I can tell, certain system header files are being detected during the configure phase but aren't being included in the build phase.
I do not know why.

Is there anything you can think of that would make your system nonstandard?

comment:15 Changed 13 years ago by bbarth@…

There's nothing that I can think of.

Do you think it's worth making a list of all my ports, wiping MacPorts off my system, and starting over from scratch? Do you think that would do something useful?

Also, is it possible to go run the build by hand in the build directory? Perhaps I could poke at it until I figure it out, but I wouldn't know where to start looking for the build.

comment:16 in reply to:  15 Changed 13 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to bbarth@…:

There's nothing that I can think of.

Do you think it's worth making a list of all my ports, wiping MacPorts off my system, and starting over from scratch? Do you think that would do something useful?

Also, is it possible to go run the build by hand in the build directory? Perhaps I could poke at it until I figure it out, but I wouldn't know where to start looking for the build.

I would only reinstall MacPorts as a last resort.
It is possible to have more than one MacPorts installation (http://guide.macports.org/#installing.macports.source.multiple)
If you are willing to put up with inconvenience, you could reinstall (or upgrade) XCode.
It might help.

To find the script file used to build readline, run the command

port dir readline

In that directory, there is a link to the build directory (called work).

comment:17 Changed 13 years ago by bbarth@…

Thanks for the info. Here's an update with some success and more questions:

I got the directory, did a "sudo su -" and cded there. Then I did a "make". And got the following which is the same as in the logs.

rye:readline-6.2 root# make
rm -f complete.o
/usr/bin/gcc-4.2 -c -DHAVE_CONFIG_H   -I/opt/local/include -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -pipe -O2 -arch x86_64 complete.c
complete.c: In function 'rl_username_completion_function':
complete.c:2045: warning: assignment makes pointer from integer without a cast
complete.c:2048: error: dereferencing pointer to incomplete type
complete.c:2048: error: dereferencing pointer to incomplete type
complete.c:2062: error: dereferencing pointer to incomplete type
complete.c:2066: error: dereferencing pointer to incomplete type
complete.c:2066: error: dereferencing pointer to incomplete type
complete.c: In function 'rl_filename_completion_function':
complete.c:2141: error: nested functions are disabled, use -fnested-functions to re-enable
complete.c:2141: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
complete.c:2141: error: 'directory' undeclared (first use in this function)
complete.c:2141: error: (Each undeclared identifier is reported only once
complete.c:2141: error: for each function it appears in.)
complete.c:2141: error: 'DIR' undeclared (first use in this function)
complete.c:2141: error: expected expression before ')' token
complete.c:2158: error: expected expression before ')' token
complete.c:2258: warning: assignment makes pointer from integer without a cast
complete.c:2260: error: dereferencing pointer to incomplete type
complete.c:2261: error: dereferencing pointer to incomplete type
complete.c:2293: error: expected expression before ')' token
complete.c:2321: error: dereferencing pointer to incomplete type
complete.c:2334: error: dereferencing pointer to incomplete type

Then, I looked in config.log, copied the configure line, ran it, and reran make. At that point, it built just fine!

Can I ask port to install this now that it's built? Does that provide you any hints?

comment:18 Changed 13 years ago by bbarth@…

OK, it appears that just running port upgrade outdated finished the install of readline. I appear to be in business, but I don't know why.

comment:19 Changed 13 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.