Skip to content

Add missing LANG=C for make sort - #766

Merged
lukhnos merged 1 commit into
openvanilla:masterfrom
lukhnos:fix-make-sort
Dec 31, 2025
Merged

Add missing LANG=C for make sort#766
lukhnos merged 1 commit into
openvanilla:masterfrom
lukhnos:fix-make-sort

Conversation

@lukhnos

@lukhnos lukhnos commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

This makes sure that the files are indeed sorted according to the UTF-8 order.

Copilot AI review requested due to automatic review settings December 29, 2025 21:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds LANG=C to two sort commands in the Makefile to ensure consistent, byte-wise sorting. This is a good change for build reproducibility.

However, I've found a critical issue with how the sorted files are updated. The current pattern of redirecting output to a temporary file and then moving it is not atomic. If the sort pipeline fails, the original file could be overwritten with an empty or incomplete one, leading to data loss. I've added suggestions to fix this for the changed lines by chaining commands with && and using unique temporary filenames.

This unsafe pattern is present in other parts of the sort target as well (lines 52-59). I strongly recommend applying the same fix to all of them to ensure the Makefile is robust.

Additionally, for consistency, you might want to check other sort commands in this file (e.g., in the check target on lines 65-66) and add LANG=C to them as well, to ensure all sorting operations behave identically.

Comment thread Source/Data/Makefile Outdated
Comment thread Source/Data/Makefile Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds env LANG=C to the sort commands for phrase.occ and BPMFMappings.txt in the Makefile to ensure files are sorted consistently using C locale ordering, which is critical for the dictionary data files.

  • Updates two sort commands to use env LANG=C to enforce C locale sorting
  • Aligns these commands with the existing pattern used for other file sorts in the same target (lines 52-59)

Comment thread Source/Data/Makefile Outdated
Comment thread Source/Data/Makefile Outdated
This makes sure that the files are indeed sorted according to the UTF-8
order.
@lukhnos
lukhnos merged commit eaf08b5 into openvanilla:master Dec 31, 2025
10 checks passed
@lukhnos
lukhnos deleted the fix-make-sort branch December 31, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants