Kode / khamake

Kha's build tool.
http://kha.tech
15 stars 43 forks source link

Automate kha_version define #169

Closed luboslenco closed 5 years ago

luboslenco commented 6 years ago

There is a kha_version defined at: https://github.com/Kode/khamake/blob/master/src/main.ts#L105

However it does not always get updated on Kha changes. Somehow automating it per commit would be handy.

#if (kha_version >= commit_xyz)
// Do new thing
#else
// Do old thing
#end
RobDangerous commented 6 years ago

But commits in git do not have a well defined order, a >= isn't really possible. I think the best solution would be a bot that adds a version commit once per month.

luboslenco commented 6 years ago

Yes the commit_xyz thing was a just silly example. Even a monthly auto-update would be great.

luboslenco commented 6 years ago

Thinking about this more, it could indeed cause more trouble than worth in the end. Maybe getting rid of the define would force us into a more robust solutions.

For me it started with Kha being slow to clone (armory needs fast update mechanism) but using Krab as a basis it now seems I will be able to just make it clone fast enough.

RobDangerous commented 6 years ago

krab (with a small k like all the command line tools) just uses --depth 3 for all _bin repos, pretty simple. Starting with 2019 I plan to use yearly branches for the bin repos so regular clones are also getting faster. Also looked into git-lfs to speed things up but sadly it's horrible on github (but could just use bitbucket for the bin repos) and hard to install on macOS. But, yes, not too happy about people using kha_version defines anyways but not sure about just getting rid of it either.

luboslenco commented 5 years ago

The fastest way I found so far, if you only need shallow copy to start with: git clone --recursive https://github.com/Kode/Kha --depth 1 --shallow-submodules --jobs 4

This finishes in ~80 seconds for me, of which haxe_bin takes up to 40 seconds. Once haxe3 is out it could maybe fit into 1 minute which is reasonable.