pkgxdev / libpkgx

`import`… but with pkging powers
https://npmjs.com/libpkgx
Apache License 2.0
62 stars 11 forks source link

Fix sync never ending when pantry is not updated in 24 hours #73

Open felipecrs opened 1 month ago

felipecrs commented 1 month ago

To be clear, pkgx is completely broken by now because of this issue.

It turns out that the function that detects whether the sync was last synced recently isn't working properly, because it's relying on the mtime of the pantry/projects folder, which is set to its original mtime when downloaded by either git or tar.

This means the function would always detect outdated sync if there was no commit in the pantry repo in the last 24 hours.

This was just a quick way around it. Other solutions I tried:

  1. ctime (change time). This would work better, but Deno doesn't support it. (node does)

  2. tar's --touch to reset modification time, but it only works for files not for directories. Also, the pantry could have been downloaded with git.

PS: tests are failing but the code is working, and I'm using it in my fork. I will not bother fixing tests as apparently no one is merging code here anyway.

jhheider commented 1 month ago

@felipecrs that's a good find. i know main is currently a work-in-progress, and max's attention has been diverted for the moment. in the interim, i can schedule the ci.pantry.tgz.yml job to run at midnight, which should hopefully alleviate this until we decide on a proper solution.