Opened 12 years ago

Closed 12 years ago

#35420 closed defect (fixed)

p5-crypt-passwdmd5: sed: RE error: illegal byte sequence

Reported by: axet (Alexey Kuznetsov) Owned by: ooburai@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: mountainlion Cc: jeremyhu (Jeremy Huddleston Sequoia), pkutzner+macports@…, panther.ru+macports@…, nick@…
Port: p5-crypt-passwdmd5

Description

--->  Computing dependencies for makepasswd
--->  Dependencies to be installed: p5.12-crypt-passwdmd5
--->  Configuring p5.12-crypt-passwdmd5
Error: org.macports.configure for port p5.12-crypt-passwdmd5 returned: command execution failed
Error: Failed to install p5.12-crypt-passwdmd5
Please see the log file for port p5.12-crypt-passwdmd5 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-crypt-passwdmd5/p5.12-crypt-passwdmd5/main.log
Error: The following dependencies were not installed: p5.12-crypt-passwdmd5
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port makepasswd failed

Attachments (1)

main.log (4.5 KB) - added by axet (Alexey Kuznetsov) 12 years ago.

Download all attachments as: .zip

Change History (13)

Changed 12 years ago by axet (Alexey Kuznetsov)

Attachment: main.log added

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: mountainlion added
Owner: changed from macports-tickets@… to ooburai@…
Port: p5-crypt-passwdmd5 added; makepasswd removed
Summary: makepasswd won't build on mac 10.8p5-crypt-passwdmd5: sed: RE error: illegal byte sequence

comment:2 Changed 12 years ago by pkutzner+macports@…

Cc: pkutzner+macports@… added

Cc Me!

comment:3 Changed 12 years ago by panther.ru+macports@…

Cc: panther.ru+macports@… added

Cc Me!

comment:4 Changed 12 years ago by nick@…

Cc: nick@… added

Cc Me!

comment:5 Changed 12 years ago by nick@…

According to https://github.com/Homebrew/homebrew-dupes/pull/21 and linked pages, the problem is Mountain Lion specific and has to do with locale settings and improper handling of these in sed. You have to unset LANG and/or set LC_CTYPE=C and/or LC_ALL=C.

sudo env ... port install ...

did not work for me. However, moving /usr/bin/sed to /usr/bin/sed2 and adding the following executable script /usr/bin/sed

#!/bin/sh

unset LANG
LC_CTYPE=C
LC_ALL=C
export LC_CTYPE LC_ALL

/usr/bin/sed2 "$@"

makes the port install.

comment:6 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

I don't have 10.8 to test on, but this should be fixed by r98206. Reopen if not.

comment:7 Changed 12 years ago by jmroot (Joshua Root)

Cc: jeremyhu@… added
Resolution: fixed
Status: closedreopened

Actually, that's probably not enough. The problem seems to be in the post-configure commands defined in the perl5 portgroup.

Would it be safe to just add env LC_CTYPE=C to those commands?

comment:8 in reply to:  5 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to nick@…:

According to https://github.com/Homebrew/homebrew-dupes/pull/21 and linked pages, the problem is Mountain Lion specific and has to do with locale settings and improper handling of these in sed.

No, the problem is that ML's sed is properly handling the locale setting whereas other implementations are not handling it correctly.

The file is not proper UTF8, so you need to set LC_CTYPE=C

Why not just fix the buggy file?

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

Does using an encoding other than UTF-8 really count as a bug?

comment:10 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

More often than not (of the times I've checked) the file is not properly encoded with any standard. The issue is usually that portions of the file are valid UTF8 whereas other portions are ISO-8859-XX ... usually resulting from developers from different regions all working on the same source code with different settings. Luckily the real code is restricted to the common ASCII subset and these inconsistencies are usually in comments.

comment:11 Changed 12 years ago by jmroot (Joshua Root)

Well in this case the Makefile.PL is valid ISO-8859-1. The author's name (in a string in the perl code) contains a non-ascii character.

I guess the only two solutions are to add code to each affected port to iconv the Makefile.PL to UTF-8, or add a way to tell the portgroup what the encoding is. I think I'd prefer the latter.

Or, if there's a reliable way to sniff encodings, the portgroup could do the conversion or set LC_CTYPE itself.

comment:12 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.