Semantic Diff

#8925 Look up compiled files under the module name as written first

1 commit, rendered from its record.

Summary

RangeCommitsChangelogAreasJS output changesFormatsFailed checks
58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-89251๐Ÿ› Bug fixtypecheckercodegentests0none0

Changelog draft

๐Ÿ› Bug fix
  • Find compiled files under the module's name as written before its uncapitalized form, so error messages on case-insensitive file systems show ABC.cmi instead of aBC.cmi.

58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-8925

150594dda ยท Christoph Knittel ยท Oct 19, 2026

Look up compiled files under the module name as written first

๐Ÿ› Bug fixtypecheckercodegentests

Load-path lookups (Misc.find_in_path_uncap, Config_util.find_opt and the .cmi loader in Bs_cmi_load) accept a file under the module name as written or uncapitalized, and tried the uncapitalized name first. On a case-insensitive file system both spellings match the same file, so the returned path read src/aBC.cmi in "does not match the interface" errors and in other messages naming the file. The lookups now try the name as written first and fall back to the uncapitalized one. On a case-sensitive file system only one spelling exists for a module, so the result is the same file as before.

Diagnostic output

Before: does not match the interface src/aBC.cmi:
After:  does not match the interface src/ABC.cmi:
๐Ÿ› Bug fixFind compiled files under the module's name as written before its uncapitalized form, so error messages on case-insensitive file systems show ABC.cmi instead of aBC.cmi.

Review

No effect
Output: unchanged
Tests
ounit tests/ounit_tests/+ ounit_find_in_path_tests.ml~ ounit_tests_main.ml
7 files ยท +108 โˆ’13 ยท changelog 1 ยท codegen 2 ยท compiler 2 ยท tests 2
Achanges/cmi-lookup-as-written.fix.md+1โˆ’0
Mcompiler/core/bs_cmi_load.ml+1โˆ’1
Mcompiler/core/config_util.ml+9โˆ’6
Mcompiler/ext/misc.ml+4โˆ’4
Mcompiler/ext/misc.mli+2โˆ’2
Atests/ounit_tests/ounit_find_in_path_tests.ml+90โˆ’0
Mtests/ounit_tests/ounit_tests_main.ml+1โˆ’0
with Claude Opus 5.5