-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find associated build file in case of missing build config data #1738
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1738 +/- ##
==========================================
- Coverage 75.87% 75.70% -0.17%
==========================================
Files 35 35
Lines 10141 10203 +62
==========================================
+ Hits 7694 7724 +30
- Misses 2447 2479 +32 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason it doesn't resolve 1629 is because it stops iterating at the first is_associated
.
397a6e3
to
66d2fec
Compare
Resolving the build configs in reverse order appears to resolve it. diff --git a/src/DocumentStore.zig b/src/DocumentStore.zig
index 765c2de0..fbff1a33 100644
--- a/src/DocumentStore.zig
+++ b/src/DocumentStore.zig
@@ -304,7 +304,10 @@ pub const Handle = struct {
var has_missing_build_config = false;
- var it = unresolved.has_been_checked.iterator(.{ .kind = .unset });
+ var it = unresolved.has_been_checked.iterator(.{
+ .kind = .unset,
+ .direction = .reverse,
+ });
while (it.next()) |i| {
const build_file_uri = unresolved.potential_build_files[i];
const build_file = document_store.getOrLoadBuildFile(build_file_uri) orelse continue; |
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.
66d2fec
to
7376916
Compare
Naturally, but how would that affect the original use-case #688? In testing this I simply iterated over all of the potential build files, storing the index of the last |
This also reverts the change to the iteration order of #1738
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.
fixes #1629