openmoji icon indicating copy to clipboard operation
openmoji copied to clipboard

Buildsystem caching should respect (git) branches

Open b-g opened this issue 1 year ago • 6 comments

Dear @kriskowal! I hope this github message find you well! :)

The buildsystem you contributed some time ago, is still working like a charm and became an indispensable gift to run the entire OpenMoji project in a sane way. Many thanks again!

However we are working finally on making OpenMojis work on dark background #31. And as testing and tweaking every OpenMoji to make them ready for dark mode will take a long time, it would be handy to have dedicated caching in the buildsystem for branches.

I believe, currently running npm run generate caches all hashes of the build artifacts into .git/memo-index and .git/refs/memos/, completely independent whether the run originated in the Master or a Dev branch. This was in the past no problem as the artifacts were only created out of Master ... but this will matter with the upcoming tasks.

Hence could you help us and modify the buildsystem in a way that every branch has its own cache? This would be super handy to finally tackle the dark mode issue. Many thanks!

b-g avatar Jul 11 '22 16:07 b-g

Thank you for your kind words. I think fondly back on my small contributions to this project.

This is of course possible by incorporating the current branch name in the cache ref. The disadvantage is that you’d build from scratch when you switch branches, but that might be mitigated by copying the cache ref when creating a new branch from the same commitish.

I will not have time to look into this, between my work with both @agoric and @tc39 coming up on a local maximum this week, but I will watch and circle back at some point.

kriskowal avatar Jul 13 '22 17:07 kriskowal

Great + many thanks! There is no rush ... we are totally at a busy end-of-semester-peak too, aiming to have a mellow summer and start tackling the dark mode after summer in September ...

Your other work looks interesting! :)

b-g avatar Jul 14 '22 06:07 b-g

Hi @kriskowal, hope you've had a nice summer! Ping ping :) Any news on the "Buildsystem caching should respect (git) branches" issue? Sorry to bother.

b-g avatar Nov 04 '22 15:11 b-g

Thank you! I’m only slightly closer now to finding time to look into this. I do not mind the occasional poke.

But emphatically, this is a small change and I can more easily spare time to review a PR, even a highly speculative not-even-working draft PR, if someone can be found to understudy.

kriskowal avatar Nov 04 '22 23:11 kriskowal

It occurred to me while I was on leave that we can solve the problem of separate caches better in terms of Git Worktrees instead of branches. This would allow you to switch branches without abandoning a cache, which I expect is common for folks who work off the main branch. Would that make sense?

kriskowal avatar May 08 '23 17:05 kriskowal

Hi @kriskowal, many thanks for circling back to this one! Sounds interesting, to be honest I've never uses a git worktree in my coding life :)

Basically: It would be great to modify the buildsystem in a way that every branch has its own cache e.g.

  • (master) npm run generate // would be used for the ongoing production
  • (dev-dark-mode) npm run generate // would be used to make OpenMojis finally work on dark background #31

If this is done under the hood with a worktree or not if probably not very important for 99% of the users of this repo. I guess either way would be fine. OK?

b-g avatar May 09 '23 06:05 b-g