Fix case-insensitive parsing of non-ASCII (e.g. Cyrillic) unit names #175
Fix case-insensitive parsing of non-ASCII (e.g. Cyrillic) unit names #175vojtechtrefny wants to merge 3 commits into
Conversation
strncasecmp only handles ASCII case folding, so translated unit names like "миб" (lowercase Cyrillic for MiB) failed to match "МиБ". Replace with a new u8_casecmp helper that converts to wchar_t via mbstowcs and compares with wcsncasecmp, which handles multibyte case folding correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add misc/alpine.Dockerfile and .github/workflows/test-musl.yml to run tests in an Alpine container via podman - Pass LIBS="-lintl" to configure for musl where dgettext is in a separate libintl rather than libc - Use "C" as default test locale instead of "en_US.utf8" so non-locale-specific tests run on systems without glibc locale data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds UTF-8-aware case-insensitive unit-string matching to libbytesize's size parser, introduces an Alpine Linux Dockerfile for containerized builds, and validates the locale-aware parsing with Russian unit tests. ChangesUTF-8 Unit Parsing
Alpine Build Image
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
misc/alpine.Dockerfile (1)
1-1: ⚡ Quick winPin the Alpine base image to a specific version.
Using
alpine:latestcreates a moving target that can introduce unexpected changes or breakage in builds over time. Pinning to a specific version (e.g.,alpine:3.19) improves reproducibility and makes builds more predictable.🔧 Suggested fix
-FROM alpine:latest +FROM alpine:3.19🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@misc/alpine.Dockerfile` at line 1, The Dockerfile uses a floating base image reference "FROM alpine:latest"; change this to a pinned, explicit Alpine version (for example "FROM alpine:3.19") to ensure reproducible builds — update the "FROM alpine:latest" line in misc/alpine.Dockerfile to a specific version (or to a project-wide pinned variable/tag if you maintain one) and commit that change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@misc/alpine.Dockerfile`:
- Line 1: The Dockerfile uses a floating base image reference "FROM
alpine:latest"; change this to a pinned, explicit Alpine version (for example
"FROM alpine:3.19") to ensure reproducible builds — update the "FROM
alpine:latest" line in misc/alpine.Dockerfile to a specific version (or to a
project-wide pinned variable/tag if you maintain one) and commit that change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 90a42d35-05a1-43e0-baa0-3db174ca03d2
⛔ Files ignored due to path filters (2)
.github/workflows/test-musl.ymlis excluded by!.github/**po/libbytesize.potis excluded by!po/**
📒 Files selected for processing (3)
misc/alpine.Dockerfilesrc/bs_size.ctests/libbytesize_unittest.py
On Debian LANGUAGE is set to the default language (en_US in most cases) so we need to clear it to make sure our locale tests actually work.
Summary by CodeRabbit
Bug Fixes
Tests
Chores