Skip to content

Commit

Permalink
find associated build file in case of missing build config data
Browse files Browse the repository at this point in the history
The associated build file resolution mechanism may fail to find the
build file because the necessary build config from running
the build.zig may not have finished yet.

These changes should ensure that the associated build file is kept
unresolved until all necessary information is available.
  • Loading branch information
Techatrix committed Jan 30, 2024
1 parent 8f0a621 commit 397a6e3
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/ComptimeInterpreter.zig
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ pub fn interpret(
} };
}

const import_uri = (try interpreter.document_store.uriFromImportStr(interpreter.allocator, interpreter.getHandle().*, import_str[1 .. import_str.len - 1])) orelse return error.ImportFailure;
const import_uri = (try interpreter.document_store.uriFromImportStr(interpreter.allocator, interpreter.getHandle(), import_str[1 .. import_str.len - 1])) orelse return error.ImportFailure;

Check warning on line 895 in src/ComptimeInterpreter.zig

View check run for this annotation

Codecov / codecov/patch

src/ComptimeInterpreter.zig#L895

Added line #L895 was not covered by tests
defer interpreter.allocator.free(import_uri);

const import_handle = interpreter.document_store.getOrLoadHandle(import_uri) orelse return error.ImportFailure;
Expand Down
Loading

0 comments on commit 397a6e3

Please sign in to comment.