Skip to content
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

Indirect recursion with AutoDeps #818

Open
jacereda opened this issue Jan 12, 2022 · 2 comments
Open

Indirect recursion with AutoDeps #818

jacereda opened this issue Jan 12, 2022 · 2 comments

Comments

@jacereda
Copy link
Contributor

jacereda commented Jan 12, 2022

I'm adapting my build to use multiple outputs in rules and --share. The problem I'm facing is that the .lib files associated with .dlls seem to be marked properly detected as writes on the first invocation but are detected as reads on subsequent invocations (assuming no exported symbol was changed).

When this happens, I think the code in

-- If something both reads and writes to a file, it isn't eligible to be an autodeps
should really do something like If something both reads and writes to a file or the file is an output of the rule, the file in question isn't eligible to be an autodeps.

How could the is an output of the rule be determined?

@ndmitchell
Copy link
Owner

I think a reasonable rule would be that outputs are just ignored by AutoDeps, since they never make sense. As to the outputs, there is a produces annotation, which modifies localProduces which can be grabbed from inside the Action monad.

I'm not sure if %> etc set the localProduces or not (I think maybe they must do since otherwise the history functions wouldn't work?), but even if they don't, you could add produces ["test.lib"] in your rule to avoid the recursion. Does that seem plausible?

@jacereda
Copy link
Contributor Author

jacereda commented Jan 16, 2022 via email

jacereda added a commit to jacereda/shake that referenced this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants