[Toybox] TOYBOX_VERSION

enh enh at google.com
Thu Oct 19 08:31:18 PDT 2017


ping on TOYBOX_VENDOR?

On Mon, Oct 16, 2017 at 5:20 PM, enh <enh at google.com> wrote:
> On Mon, Oct 16, 2017 at 2:24 PM, Rob Landley <rob at landley.net> wrote:
>> Hey, didn't wind up in spam this time! (Gmail learns.)
>>
>> On 10/16/2017 12:29 PM, enh wrote:
>>> i was going to send this patch to allow Android to add "-android"
>>> without having to work out what the toybox version would otherwise
>>> have been:
>>>
>>> diff --git a/main.c b/main.c
>>> index 6025d43..57e53ec 100644
>>> --- a/main.c
>>> +++ b/main.c
>>> @@ -6,7 +6,10 @@
>>>  #include "toys.h"
>>>
>>>  #ifndef TOYBOX_VERSION
>>> -#define TOYBOX_VERSION "0.7.4"
>>> +#ifndef TOYBOX_VENDOR
>>> +#define TOYBOX_VENDOR ""
>>> +#endif
>>> +#define TOYBOX_VERSION "0.7.4"TOYBOX_VENDOR
>>>  #endif
>>>
>>>  // Populate toy_list[].
>>
>> Huh. I'd assumed people wanting that would just override TOYBOX_VERSION
>> from the command line to include the -suffix.
>
> i can do, but i kind of wanted to keep your version number too... it's
> not completely meaningless, even though in reality "0.7.4" is always
> going to mean "somewhere after 0.7.4 but before 0.7.5". it still gives
> a ballpark idea of how old a toybox version a bug report refers to.
>
>>> but i notice that you haven't updated that to 0.7.5 yet, and are
>>> instead relying on `git describe --tags` to override this.
>>>
>>> is that the plan going forward, or was this just an oversight?
>>
>> It's because I'd already pushed the cut rewrite up to github, an then
>> went "this is a can of worms, I should cut the release first", which
>> meant tagging a historical version. In orer to update the TOYBOX_VERSION
>> macro in main, I'd have to branch and I've mostly avoiding branching the
>> history.
>>
>> It wasn't an oversight, it was a hack because I did this release
>> slightly wrong. :)
>>
>>> the reason i bring this up now is that with Treble there are two
>>> (potentially different) copies of toybox on a device: the /system one
>>> and the /vendor one which may lag behind, but is built from the same
>>> source. in the past we've used sed(1) to hack this together, but it
>>> might make more sense to just support this in toybox (similar to what
>>> mksh does). especially for us, because we're moving to a more
>>> declarative build system where that gets a bit more interesting
>>> (https://android-review.googlesource.com/511275).
>>>
>>> but if your plan is for the git tag to be the one true source of
>>> version, we can switch to a git/sed combo...
>>
>> The build system sets TOYBOX_VERSION if there is a .git directory at the
>> top of tree and git describe works. That means it's #defined so the
>> #ifndef doesn't trigger.
>>
>> But the tarballs don't have the .git directory (and git isn't a build
>> prerequisite), so there's a fallback #define that I'm supposed to update
>> every release, but I'm not 100% reliable about that. (It's in my release
>> checklist, but this time I got steps out of order because backtracking.)
>>
>> As for the patch, I don't have a strong opinion. If having two version
>> macros makes life easier for you, I can take the patch. Could you send
>> me one with the headers I can "git am"?
>
> sure, no worries. attached.
>
> [PATCH] Add TOYBOX_VENDOR.
>
> This allows distributions to add their own tag to the toybox version,
> in particular so Android can add "-android" for a version number like
> "0.7.5-android".
> ---
>  main.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
>
>> Thanks,
>>
>> Rob
>>
>> (Thanks for your patience on the other stuff, I drove back from
>> Minneapolis this weekend and then $DAYJOB ate today. Working on it...)
>
> i'm assuming that you'll get round to the groups(1) and setprop(1)
> patches as soon as you have time, and don't actually need us to
> resend, so let me know if i misinterpreted your earlier mail :-)
>
> --
> Elliott Hughes - http://who/enh - http://jessies.org/~enh/
> Android native code/tools questions? Mail me/drop by/add me as a reviewer.



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list