Bug 216124

Summary: Mk/bsd.port.mk: set LC_COLLATE=C for CONFIGURE_ENV and MAKE_ENV
Product: Ports & Packages Reporter: Gerald Pfeifer <gerald>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed DUPLICATE    
Severity: Affects Many People CC: andreast, dim, jkim, portmgr, ports-bugs, tijl
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210122
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211742
Attachments:
Description Flags
Proposed patch to set LC_COLLATE in CONFIGURE_ENV and MAKE_ENV gerald: maintainer-approval? (portmgr)

Description Gerald Pfeifer freebsd_committer freebsd_triage 2017-01-15 21:20:27 UTC
Created attachment 178935 [details]
Proposed patch to set LC_COLLATE in CONFIGURE_ENV and MAKE_ENV

Starting with FreeBSD 11, awk follows "natural", but unexpected (to many
of us and existing programs) sorting and string comparisons when used in
a locale different than the C locale.

This hit us when building GCC under the new version, cf.
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210122 
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211742

It quite likely is going to hit us in many other cases, not the least
since the behavior of GNU awk matches the original FreeBSD awk behavior
(unless POSIXLY_CORRECT is set in the environment). 

So, and as a general best practice to increase reproducability, let's
set LC_COLLATE=C when building ports and packages per the attached.

I verified this fixes building the lang/gcc* ports when the current
workaround is removed.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2017-01-15 21:50:44 UTC
See also bug #215882
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2017-01-18 13:22:14 UTC

*** This bug has been marked as a duplicate of bug 215882 ***