Hacker News new | ask | show | jobs
by ahartmetz 1809 days ago
The main reason why not enumerating all the files in the build system is a bad idea is that the build system won't know to rerun itself and re-scan dependencies after you added a file. If you do enumerate the files, you need to change a build system file to add an entry for the new source code file, and that tells the build system to rerun itself and re-scan dependencies. And in the grand order of things, adding a file to the build system is a triviality compared to actually writing the code in it.
2 comments

And, in general, adding a source file can automatically insert a record into the build system if you follow a convention.
Couldn't a build system use a hash of the accumulated files as a cache key and rebuild it's internal state when that changes?

I'm not seeing a big downside, but maybe I'm missing something obvious.