-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
fix: passively rebuild modules imported by importModule
#8595
fix: passively rebuild modules imported by importModule
#8595
Conversation
✅ Deploy Preview for rspack canceled.Built without sensitive environment variables
|
This process does not seem to be any different from the current process. I guess this error might be caused by the |
They are different. Let's assume one of the loaders of module A import module B by If you think it's not the root cause or it's not appropriate, I'm also glad to help refactor the anything. |
emmm...Let me review current logic.
From the above process, I think this PR just postpones the timing of rebuilding moduleB. @CPunisher It would be more helpful if you could add some test cases for this case. |
@CPunisher Good edge case, but this PR will introduce other bugs. Lets see a example:
I have written a test case for it. f782685 Look back to the issue that this PR will fixed, I think we can fix it by just remove the dependency at request_dep_map from the
pub enum MakeParam {
...,
ForceSkipDeps(HashSet<DependencyId>)
}
pub fn cutout_artifact() {
let skip_deps = HashSet::default();
...
for item in params {
match item {
MakeParam::ForceSkipDeps(deps) => {
skip_deps.extend(deps);
}
}
}
...
force_build_deps.filter(|item| !skip_deps.includes(item))
}
update_module_graph(vec![..., MakeParam::ForceSkipDeps(self.request_dep_map.values())]) |
@jerrykingxyz I agree with your idea. I will try it. |
@jerrykingxyz OK, after trying I find that we have to merge our ideas. Let's continue your example. We should consider three cases.
|
For case 3, the build_dependencies returned by The follow code will remove the dependencies to build ModuleC. |
Only defining a new MakeParam and skip rebuilding moduleB is not enough. We also need to get Based on above, I give up the new MakeParam since we can directly mutate the |
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.
LGTM. This fix is a good one for now. I think we'll have better options once we refactor the "finish_check" logic.
@CPunisher Thanks for fixing this. I'll create a new issue to provide context about the |
Summary
Investigation: #7805 (comment) and #7805 (comment)
Changes: The executor doesn't rebuilt the referenced modules but only updates the module graph. Since the referencing module also contains file dependecies of the referenced module, the
importModule
will be called again and the referenced module is rebuilt. Finally we fix the artifact after finishing all modules.closes #7805
closes #8208
Checklist