Open jordwalke opened 7 years ago
I've started working on this issue and will update it as soon as I complete reviewing the impacted code and/or have something to share.
Hi there, Just as a means of update, I've been able to get a high-level understanding of how the build process for esy works, and am now contemplating how to insert the hash checking logic for local packages and where to do that.
@omefire that's the place where local vs non-local builds take different build paths — https://github.com/reasonml/esy/blob/esy/src/esy/buildEjectCommand/runtime.sh#L98-L105
@andreypopp , thanks. That's the exact place I'm currently looking at. How I wish I was dealing with Javascript code, not Bash. :smile:
@omefire there's JS builder in refactor/build-repr
branch. I think it is possible we could add such feature only in JS build but now it is too early to decide as JS builder isn't working properly yet (I need few days to finish it). Also @jordwalke may have different opinion on that.
Anyway, I think the approach for deciding if we need to rebuild the dep could be the same both for ejected (to Makefile) builds and for JS driven builds...
@andreypopp , I would suggest that we go ahead and add this feature to Bash (is Bash == ejected to Makefile ?) for now and later circle back and add it to JS driven builds as well.
@omefire right, I agree
I have PR which is still a Work In Progress here: https://github.com/reasonml/esy/pull/17
Once I get more free time, I'll finish it off, polish it, test it and submit a final PR.
Right now for local dependencies (symlinks or local file:// dependencies)
esy build
will rebuild them every time even if nothing changed, because we don't detect if anything changed.Instead, we should only rebuild them when some file inside the local dependency has been changed. Perhaps computing a hash of the source files will be sufficient.