Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
std.Build.Module.addShallowDependencies: fix missing dependencies
De-syncing here was not exposed before because old artifact creation API always called `addShallowDependencies` before user could call `addCSourceFile` etc., and their logic constantly overwrote this one. Example of this de-syncing: `addShallowDependencies` depended only on `RcSourceFile.file` LazyPath, but did not depend on `RcSourceFile.include_paths` LazyPaths. Meanwhile, `addWin32ResourceFile` depended on both. This means that user could not call `addWin32ResourceFile` this way: ```zig const mod = b.createModule(...); mod.addWin32ResourceFile(...); const exe = b.addExecutable2(...); ``` Since `addShallowDependencies` will be called on 1 and 3 line, with incomplete logic, and Step.Compile will miss `include_paths` dependency. I initially tried to do this in standalone test "windows_resources", but it caused errors about file not being generated yet: ```zig getPath() was called on a GeneratedFile that wasn't built yet. source package path: /home/bratishkaerik/github.com/zig/test/standalone/windows_resources Is there a missing Step dependency on step 'WriteFile generated.h'? The step was created by this stack trace: name: 'WriteFile generated.h'. creation stack trace: ``` Now `addShallowDependencies` is synced with all functions and dependecies are same no matter if user calls them before b.addExecutable2 or after it. Signed-off-by: Eric Joldasov <[email protected]>
- Loading branch information