Skip to content

Rebuild not triggered when deletion with nested modules #5152

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

Closed
rickyvetter opened this issue May 25, 2021 · 4 comments
Closed

Rebuild not triggered when deletion with nested modules #5152

rickyvetter opened this issue May 25, 2021 · 4 comments

Comments

@rickyvetter
Copy link
Contributor

It seems in some cases when working with nested modules there can be some correctness issue with the build. Here's a minimal repro I've found:

// Test_A.res
let foo = 1
// Test_B.res
module A = Test_A
// Test_C.res
let bar = Test_B.A.foo

Expecting a compile error after deleting Test_B.res.

@rickyvetter rickyvetter changed the title Compiler correctness on deletion Compiler correctness on deletion with nested modules May 25, 2021
@bobzhang
Copy link
Member

bobzhang commented May 26, 2021

I can reproduce it, it seems that Test_B is only a bunch of module aliases that we treat it specially.
Edit: So Test_B is indeed removed, it is that the build system believes that Test_B is a namespace file, hence Test_C treat it specially. @rickyvetter can you confirm that in your real world cases that Test_B is just a list of module aliases?

@rickyvetter
Copy link
Contributor Author

Yup. There are some additional module type statements, but it's basically just module aliases.

I can also repro the same thing with a single include at top level, but that's a rarer case and I know include causes issues anyway.

@bobzhang
Copy link
Member

bobzhang commented May 26, 2021

Taking a closer look.
test_c.d indeed changed,
so we can either fix in the generator level
or in the ninja level.
Note this was an intentional tradeoff to avoid too much recompilation when file deletion/addition happens, but I think we can get a more robust fix now.
Edit: so we are going to fix this in ninja, if the contents of dynamic dependencies changed it is gonna trigger a rebuild.

@bobzhang bobzhang changed the title Compiler correctness on deletion with nested modules Rebuild not triggered when deletion with nested modules May 26, 2021
bobzhang added a commit to rescript-lang/ninja that referenced this issue May 29, 2021
@bobzhang
Copy link
Member

fixed in this commit rescript-lang/ninja@61651e2

bobzhang added a commit that referenced this issue May 29, 2021
bobzhang added a commit that referenced this issue May 30, 2021
bobzhang added a commit that referenced this issue Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants