dlang / dub

Package and build management system for D
MIT License
673 stars 230 forks source link

preGenerateCommands should reparse dub.json/dub.sdl, if needed #2666

Closed WebFreak001 closed 8 months ago

WebFreak001 commented 1 year ago

When running preGenerateCommands, dub will already re-evaluate all the globs and variables from the dub recipe, however it will never actually re-parse the dub recipe. I think if the recipe has changed (modification time), we should also re-parse the recipe, so that more advanced use-cases that edit the recipe are possible.

Note that dub right now only considers itself, not dependencies or dependents when running preGenerateCommands, which is a limitation that keeps the implementation sane though.

Geod24 commented 9 months ago

so that more advanced use-cases that edit the recipe are possible.

I don't see self-modifying code as an advanced use case, it's an error prone hack and I really don't think we should do that.