Skip to content

Commit ddb962e

Browse files
committed
v3: snapshot fallback report source paths
1 parent 888c9f2 commit ddb962e

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

vlib/v3/driver/driver.v

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6218,7 +6218,7 @@ fn v3_impure_v_diagnostics(a &flat.FlatAst) []parser.Diagnostic {
62186218
return diagnostics
62196219
}
62206220

6221-
fn request_macos_v3_c_error_fallback(fallback_file string, report_dir string, ccompiler string, c_output string, c_source string, a &flat.FlatAst) bool {
6221+
fn request_macos_v3_c_error_fallback(fallback_file string, report_dir string, ccompiler string, c_output string, c_source string, v_sources []string) bool {
62226222
if fallback_file == '' || report_dir == '' || !os.is_file(c_source) {
62236223
return false
62246224
}
@@ -6242,8 +6242,7 @@ fn request_macos_v3_c_error_fallback(fallback_file string, report_dir string, cc
62426242
os.rmdir_all(report_dir) or {}
62436243
return false
62446244
}
6245-
os.write_file(os.join_path(report_dir, macos_v3_c_error_v_sources_file),
6246-
macos_v3_fallback_report_sources(a).join('\x00')) or {
6245+
os.write_file(os.join_path(report_dir, macos_v3_c_error_v_sources_file), v_sources.join('\x00')) or {
62476246
os.rmdir_all(report_dir) or {}
62486247
return false
62496248
}
@@ -6254,7 +6253,7 @@ fn request_macos_v3_c_error_fallback(fallback_file string, report_dir string, cc
62546253
return true
62556254
}
62566255

6257-
fn request_macos_v3_c_error_fallback_from_message(fallback_file string, report_dir string, ccompiler string, message string, c_sources []string, a &flat.FlatAst) bool {
6256+
fn request_macos_v3_c_error_fallback_from_message(fallback_file string, report_dir string, ccompiler string, message string, c_sources []string, v_sources []string) bool {
62586257
is_c_error := message.starts_with('failed to build C object ')
62596258
|| message.starts_with('failed to build cached module object ')
62606259
|| message.starts_with('failed to build cached program prefix:')
@@ -6265,7 +6264,7 @@ fn request_macos_v3_c_error_fallback_from_message(fallback_file string, report_d
62656264
for c_source in c_sources {
62666265
if os.is_file(c_source) {
62676266
return request_macos_v3_c_error_fallback(fallback_file, report_dir, ccompiler, message,
6268-
c_source, a)
6267+
c_source, v_sources)
62696268
}
62706269
}
62716270
return false
@@ -7691,6 +7690,7 @@ pub fn run(args []string) {
76917690
}
76927691
// Parsing workers canonicalize source-backed node text before their buffers
76937692
// are released. Metadata keys are finalized here before semantic phases begin.
7693+
fallback_report_sources := macos_v3_fallback_report_sources(a)
76947694
p.release_source_storage()
76957695
diagnostic_root := if is_selfhost {
76967696
diagnostic_root_for_input(input_file, user_files)
@@ -9261,7 +9261,7 @@ pub fn run(args []string) {
92619261
message := err.msg()
92629262
if request_macos_v3_c_error_fallback_from_message(macos_v3_fallback_file,
92639263
macos_v3_c_error_dir, c_compiler, message, [published_c_source, cache_plan_file,
9264-
cc_src], a)
9264+
cc_src], fallback_report_sources)
92659265
{
92669266
cleanup_c_build_dir(cc_dir)
92679267
exit(1)
@@ -9446,7 +9446,7 @@ pub fn run(args []string) {
94469446
cache_plan_file,
94479447
published_c_source,
94489448
cc_src,
9449-
], a)
9449+
], fallback_report_sources)
94509450
{
94519451
cleanup_c_build_dir(cc_dir)
94529452
exit(1)
@@ -9481,7 +9481,7 @@ pub fn run(args []string) {
94819481
cache_plan_file,
94829482
published_c_source,
94839483
cc_src,
9484-
], a)
9484+
], fallback_report_sources)
94859485
{
94869486
cleanup_c_build_dir(cc_dir)
94879487
exit(1)
@@ -9502,7 +9502,7 @@ pub fn run(args []string) {
95029502
cache_plan_file,
95039503
published_c_source,
95049504
cc_src,
9505-
], a)
9505+
], fallback_report_sources)
95069506
{
95079507
cleanup_c_build_dir(cc_dir)
95089508
exit(1)
@@ -9661,7 +9661,7 @@ pub fn run(args []string) {
96619661
published_c_source,
96629662
cache_plan_file,
96639663
cc_src,
9664-
], a)
9664+
], fallback_report_sources)
96659665
{
96669666
cleanup_c_build_dir(cc_dir)
96679667
exit(1)
@@ -9679,7 +9679,7 @@ pub fn run(args []string) {
96799679
published_c_source,
96809680
cache_plan_file,
96819681
cc_src,
9682-
], a)
9682+
], fallback_report_sources)
96839683
{
96849684
cleanup_c_build_dir(cc_dir)
96859685
exit(1)
@@ -9739,7 +9739,7 @@ pub fn run(args []string) {
97399739
published_c_source,
97409740
cache_plan_file,
97419741
cc_src,
9742-
], a)
9742+
], fallback_report_sources)
97439743
{
97449744
cleanup_c_build_dir(cc_dir)
97459745
exit(1)
@@ -9952,7 +9952,8 @@ pub fn run(args []string) {
99529952
return
99539953
}
99549954
if request_macos_v3_c_error_fallback(macos_v3_fallback_file, macos_v3_c_error_dir,
9955-
c_compiler, result.output, os.join_path_single(cc_dir, fallback_source), a)
9955+
c_compiler, result.output, os.join_path_single(cc_dir, fallback_source),
9956+
fallback_report_sources)
99569957
{
99579958
cleanup_c_build_dir(cc_dir)
99589959
exit(1)

0 commit comments

Comments
 (0)