InstantiateFromURL.jl icon indicating copy to clipboard operation
InstantiateFromURL.jl copied to clipboard

Only instantiate/precompile from master if the hash has changed

Open jlperla opened this issue 7 years ago • 1 comments

Of course, it needs to be downloaded and unzipped each time, but a small improvement would be to only run the instantitate; precompile on master if things have changed.

I think this can be done with the pax_global_header. To see this, I:

  • downloaded https://github.com/arnavs/InstantiationTest/archive/master.tar.gz which was pointing at https://github.com/arnavs/InstantiationTest/commit/ce2ed6a98f2b67999fb015f670b270ea3dbec0ab at the time
  • unziped and opened the pax_global_header, which had the text
52 comment=ce2ed6a98f2b67999fb015f670b270ea3dbec0ab
  • I don't know what the 52 comment is, or if it changes, but the rest of it is the commit hash!

So, the change could be as follows:

  • When they call the funciton, as long as force = false, you download and expand the tarball as usual, then check if the new pax_global_header (or at least the text after the comment= is identical to the existing one. If it is, then just activate instead of instantiaate/precompile
  • Anytime that it is instantiated/preocmpiled, you put the pax_global_header inside of the directory, or replace it

jlperla avatar Oct 16 '18 17:10 jlperla

Perfect, will look into using this information. The 52 comment looks like it's just defining a field named comment that's 52 chars long: https://github.com/ntruessel/etar/wiki/Header-Formats

arnavs avatar Oct 16 '18 17:10 arnavs