gvvaughan / luke

A light-weight, self-bootstrapping software build utility.
MIT License
20 stars 3 forks source link

Incremental build and clean. #4

Open Mikhael-Danilov opened 1 year ago

Mikhael-Danilov commented 1 year ago

Would be rather nice to have. Now it seems to do full rebuild on each invocation, and no clean target (or at least I didn't find one). It tried it on https://github.com/luaposix/luaposix standalone (without luarocks) build.

gvvaughan commented 2 months ago

The vast majority of use for luke is as a one shot build and install via luarocks invocations after which the entire build tree is deleted. I'm happy to use git clean -dfx to remove build file droppings from my project builds while I develop luaposix and others. But, a new clean target seems like a great addition for people building from a tarball rather than a git clone. Would you be interested in submitting a PR?

luaposix is the most complex project I know of that uses luke, and a full rebuild takes a little over 10secs on my machine (and 6 of those are running the Lua code and various build time tests to determine what options to pass to the compiler). At this stage, I don't think the benefit of shaving even 3secs off the full build time is worth sinking a lot of time into developing, debugging and maintaining all the additional complexity of tracking object dependencies and/or file timestamps and potentially even adding another second to the 6 already spent running the configuration.

You might argue that we could also get rid of most of the start up time and configuration tests with better caching, but then we're getting into autotools territory, the complexity of which is what drove me to write luke in the first place. I'm pretty happy with the vastly simpler and faster process of running luke than I was with all the autotools nonsense that was in luaposix before luke.

Having said that, I would definitely consider merging your PR for incremental builds if you can come up with something that does not add significant complexity to luke, and can do way better than shave a few seconds off the luaposix compile time in exchange for adding a second or two to the configure time.