@@ -474,9 +474,10 @@ pub fn take_external_v3_report_from_env() ?ExternalCErrorBugReport {
474474 return report
475475}
476476
477- // matches_v3_fallback_inputs confirms that every source V3 recorded was parsed from the
478- // same bytes by the stable compiler. Report paths are never opened: they are compared
479- // only with canonical paths belonging to the stable parser's own AST files.
477+ // matches_v3_fallback_inputs confirms that the stable compiler parsed the same set of
478+ // project sources from the same bytes that V3 recorded. Report paths are never opened:
479+ // they are compared only with canonical paths belonging to the stable parser's own AST
480+ // files.
480481fn (b &Builder) matches_v3_fallback_inputs (report ExternalCErrorBugReport) bool {
481482 if report.kind == external_v3_ notice_only_kind {
482483 return true
@@ -485,11 +486,27 @@ fn (b &Builder) matches_v3_fallback_inputs(report ExternalCErrorBugReport) bool
485486 return false
486487 }
487488 mut stable_digests := map [string ]string {}
489+ vlib_root := os.real_path (os.join_path (b.pref.vroot, 'vlib' )).trim_right (os.path_separator)
488490 for file in b.parsed_files {
489491 if file.path == '' || file.source_digest == '' {
490492 continue
491493 }
492- stable_digests[os.real_path (file.path)] = file.source_digest
494+ path := os.real_path (file.path)
495+ // Mirror macos_v3_fallback_report_sources: V1 and V3 intentionally parse
496+ // different bundled compiler-support files, so compare only caller/project and
497+ // installed-module inputs.
498+ if path == vlib_root || path.starts_with (vlib_root + os.path_separator) {
499+ continue
500+ }
501+ if previous := stable_digests[path] {
502+ if previous != file.source_digest {
503+ return false
504+ }
505+ }
506+ stable_digests[path] = file.source_digest
507+ }
508+ if stable_digests.len != report.input_digests.len {
509+ return false
493510 }
494511 for path, v3_ digest in report.input_digests {
495512 if stable_digests[path] != v3_ digest {
0 commit comments