Page MenuHomeFreeBSD

Makefile.inc1: Set LC_COLLATE in distributeworld for glibc compatibility
ClosedPublic

Authored by jrtc27 on Jul 14 2022, 12:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 3:30 PM
Unknown Object (File)
Wed, Jun 26, 11:54 PM
Unknown Object (File)
Wed, Jun 12, 1:01 PM
Unknown Object (File)
Apr 27 2024, 5:43 PM
Unknown Object (File)
Jan 15 2024, 12:43 AM
Unknown Object (File)
Jan 14 2024, 10:17 AM
Unknown Object (File)
Dec 22 2023, 11:29 PM
Unknown Object (File)
Dec 20 2023, 3:13 PM
Subscribers
None

Details

Summary

distributeworld relies on "foo" sorting directly before "foo type=...",
but with glibc both en_US and en_GB have "fooa" sort between "foo" and
"foo z", resulting in some files (in particular, id due to "ident"
sorting before "id type=" but after "id") not being included in the meta
files and thus not included in the dist tarballs. Forcing use of the C
locale ensures this does not occur.

Obtained from: CheriBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrtc27 created this revision.

It looks like we use LC_COLLATE=C sort elsewhere in this file.

I wonder if the comments should reflect the use of LC_*=C.

I also wonder if we shouldn't just have a SORTCMD=LC_COLLATE=C sort that we use in place of bare sort

LC_COLLATE=C isn't sufficient in the case LC_ALL is set in the (user's/server's) environment and is probably why I picked LC_ALL=C instead, but that's addressed elsewhere by env -i. There are a bunch of other places that run sort without setting LC_COLLATE and I don't think they really matter, so I'd rather leave those alone. Currently testing whether env -i LC_COLLATE=C works or there's something I've forgotten in the few months since I originally wrote this for CheriBSD.

Switch to env -i LC_COLLATE=C and pull out existing copies of the pattern to a common variable

This revision is now accepted and ready to land.Jul 14 2022, 11:26 PM
jrtc27 retitled this revision from Makefile.inc1: Force LC_ALL in distributeworld for glibc compatibility to Makefile.inc1: Set LC_COLLATE in distributeworld for glibc compatibility.Jul 15 2022, 10:00 PM