crisidev/homebrew-chunkwm

"brew info chunkwm" not showing installed with "--HEAD" option

ossdesign opened this issue · 3 comments

I might just be a little ignorant here with how Homebrew shows this, but I wanted to start running Chunkwm from HEAD so that any issues/thoughts/feedback I may encounter or have are reported against recent changes given the current moving nature of things.

On reinstall, I cannot see "--HEAD" listed as one of the build options, but maybe this isn't considered an option (looking at the man page, looks like is more of a command flag for install):
"Built from source on 2018-01-21 at 21:05:30 with: --with-tmp-logging"

After reinstall, if I run "chunkwm -v" I get:
"chunkwm 0.2.36"

Which of course is not HEAD but latest stable, though I am pretty sure I am running HEAD just that "chunkwm -v" is returning the latest stable. This is probably in the code, nothing to do with the Homebrew formula. That said, just as a general thought, when running HEAD it would be cool if the results of "chunkwm -v" showed what latest git commit it was built against, but not sure how that would be achieved.

I'm newish to some of this stuff (GitHub, Homebrew, Chunkwm for that matter) so bear with me as I try and figure out where is the right places for things and appropriate way to go about things.

Thanks!

Hello,
let me clarify a couple of things about brew and building app with it.

You cannot see "--HEAD" as a build option because it is not :) "--HEAD" is just a command line flag for brew to tell it to build against git HEAD instead of latest released version. Only options specific to the formula you are building (like "--with-tmp-logging") will be shown there. You can tell you have used HEAD for build by the line "Built from source on 2018-01-21..."

Regarding chunkwm, the "-v" option will tell you the version you have built. The concept on HEAD is git specific and identify the latest commit of a tree. Chunkwm does not have any code to read what was the last commit used to build and the "-v" option is just printing you a constant used to identify the version. This is the piece of code used to print the version with "-v": https://github.com/koekeishiya/chunkwm/blob/ef95bb1af2fde6f7b7b78536a9760b9702d7ddef/src/core/chunkwm.mm#L151 and this is the constant definition: https://github.com/koekeishiya/chunkwm/blob/3b86991f3c6ad23f2dec1e380224e4d23be73aca/src/core/constants.h#L6-L8

From the info you gave me, I can guarantee you are running HEAD. You can trust the line "Built from source on 2018-01-21" from brew info :)

I could start using build-numbers, or something as well for non-releases.

e.g: latest release is 0.2.36

further commits on master would be versioned by build-number:

e.g: 0.2.36-whatever

whatever would start at 1 and increase or something.

Then new release would reset the build-number,
so the next brew update would be versioned: 0.2.37

I suppose there is probably a way to have the makefile read the current git hash and perform a sed of the constants.h file before compilation starts, but I have never looked into this.

@crisidev
Thanks you for the details. I am just getting up to speed with things, though tend to be a quick learner (well, hope so!) I was starting to think --HEAD was not so much an option, more a flag to "brew install", which you have confirmed (thanks!)

@koekeishiya
As far as what gets returned via "chunkwm -v", I wouldn't want you to waste too much time on anything unless it had value to you. I just wanted to confirm what I was seeing. For the time being I intend to run against --HEAD just because I am guessing the code is changing a bit and want to participate in reporting any bugs, feedback, etc.

@crisidev & @koekeishiya
Thanks to both of you. I am enjoying this project as window management is one area I felt macOS to be lacking in, especially for more "power" use cases.