Bug 76585 - lang/clisp: UTF8 locales break build
Summary: lang/clisp: UTF8 locales break build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-23 00:20 UTC by clemens fischer
Modified: 2005-02-14 16:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description clemens fischer 2005-01-23 00:20:09 UTC
	using any UTF-8 locale breaks the build (LC_CTYPE de_DE.UTF-8 in my
	case).

Fix: 

i used the following:

(before)
...
./minitests > minitests.out
uniq -u < minitests.out > minitests.output.i386-unknown-freebsd5.3
uniq: stdin: Illegal byte sequence
*** Error code 1

(after, using bash(1))
# export LANG=C LC_ALL=C
# localname=$(pwd) && portupgrade -vw ${localname#*/p/}
--->  Reading default options: -v -D -W -l /var/pkgtools/portupgrade.results -L /var/pkgtools/%s__%s.log
--->  Session started at: Sun, 23 Jan 2005 00:52:23 +0100
...

and the build completed.  i'm not sure where to insert this little fix in
the ports "Makefile", though.

regards,  clemens
How-To-Repeat: 	"setenv LC_CTYPE de_DE.UTF-8" and build.  there's an innocent
	looking uniq(1) command in there, which is the culprit.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2005-01-23 00:43:51 UTC
State Changed
From-To: open->feedback

To which port or ports does this PR apply? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76585 

Adding to audit trail:

sorry.  this one is for "ports/lang/clisp", but i suspect many others exhibit
mysterious build errors because of UTF-8 settings in $LANG, $LC_CTYPE etc.

  clemens
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2005-01-24 21:03:41 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2005-01-29 23:02:52 UTC
State Changed
From-To: open->closed

Ok I committed LANG=C bandaid to the port, please test with your locale.
Comment 4 clemens fischer 2005-02-02 16:39:41 UTC
"LANG=C" didn't cut it.  environ(7) says the "$LC*" variables take precedence,
so i thought:

  -MAKE_ENV+= CC="${CC}" LANG=C
  +MAKE_ENV+= CC="${CC}" LC_ALL=C

but this didn't fix it, either.  an explicit "export LC_ALL=C" is needed and
sufficient before starting the build.  unfortunately, i don't know how to
achieve this using make(1).  we'd need a shell wrapper if only for globally
setting "$LC*" stuff.

as a workaround, "LC_ALL=C make LC_ALL=C" works.

"ports/ftp/curl" contains:

  # Setting LC_ALL=C is a kludge; maybe curl/libcurl shouldn't actually use
  # the user's locale when dates are sent to the server.
  test:   build
          @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} LC_ALL=C ${MAKE} test

would it be possible to use a "pre-build" target in a similiar way?

  clemens
Comment 5 clemens fischer 2005-02-14 15:46:45 UTC
* 2005-02-07 Pav Lucistnik:

> Hmm interesting. So you have a working tested patch?

this one works.  i got it from ports/lang/perl5.8.  seems one has to reset
each and every one of the locales-related environment variables.  i think you
can safely commit it, and it might well work in other cases where locales
break building.

  clemens


--- Makefile.0	Mon Feb 14 13:06:26 2005
+++ Makefile	Mon Feb 14 13:12:35 2005
@@ -22,11 +22,18 @@
 USE_GCC=	2.95
 USE_GETTEXT=	yes
 
+# -ino: 20050214-1307 taken from lang/perl5.8:
+LOCALE_CLEANUP= LANG="" LC_ALL="" LC_COLLATE="" LC_CTYPE="" \
+                LC_MESSAGES="" LC_MONETARY="" LC_NUMERIC="" \
+                LC_TIME=""
+CONFIGURE_ENV+= ${LOCALE_CLEANUP}
+MAKE_ENV+=      ${LOCALE_CLEANUP}
+
 # In clisp-2.28, the build dies in the "regexp" module: the build target
 # invokes a configure script, which encounters a different CC variable than
 # the one the top-level configure cached.  We'll explicitly set CC to avoid
 # this.
-MAKE_ENV+= CC="${CC}" LANG=C
+MAKE_ENV+= CC="${CC}"
 CONFIGURE_ENV+= CC="${CC}"
 
 # The build uses INSTALL_* to copy files around, but since the Ports
Comment 6 Pav Lucistnik freebsd_committer freebsd_triage 2005-02-14 16:03:12 UTC
Clemens Fischer pí¹e v po 14. 02. 2005 v 16:46 +0100:
> * 2005-02-07 Pav Lucistnik:
> 
> > Hmm interesting. So you have a working tested patch?
> 
> this one works.  i got it from ports/lang/perl5.8.  seems one has to reset
> each and every one of the locales-related environment variables.  i think you
> can safely commit it, and it might well work in other cases where locales
> break building.


It looks fine. I just checked it in. Thank you!

-- 
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

The Phase Spider. A spider that never seems quite there.