Discussion:
patch to disable scripts/make.sh GITHASH=...
Add Reply
Thomas
2017-08-04 05:43:04 UTC
Reply
Permalink
Raw Message
GITHASH grabs info from yocto dir (contains toybox*.tgz)
and the final toybox no longer prints out helpful-ver#.
-> dont-hide-version-num.patch

If not this, then some other/official way to make toybox
keep/show helpful-ver# instead of not-toybox GITHASH?
Rob Landley
2017-08-06 01:14:31 UTC
Reply
Permalink
Raw Message
Post by Thomas
GITHASH grabs info from yocto dir (contains toybox*.tgz)
Wait, your git --describe is finding a random tarball in some other
directory?

That's really broken.
Post by Thomas
and the final toybox no longer prints out helpful-ver#.
-> dont-hide-version-num.patch
That's a pretty clear yocto bug (one I can't reproduce), but if you're
adding a workaround for this yocto bug the easy thing to do is keep
GITHASH if it's already be set, not add a second special case variable.

Then yocto can set it to whatever they want, working around their own bug.

Rob
Thomas
2017-08-06 05:58:05 UTC
Reply
Permalink
Raw Message
Post by Rob Landley
Wait, your git --describe is finding a random tarball in some other
directory?
That's really broken.
...
Post by Rob Landley
That's a pretty clear yocto bug (one I can't reproduce), but if you're
adding a workaround for this yocto bug the easy thing to do is keep
GITHASH if it's already be set, not add a second special case variable.
Replace "yocto" with "project using git + building toybox"

make.sh sets GITHASH because the "." directory is "under" git.
/proj/whatever/ ... was checked out of git and contains:
/proj/whatever/things/toybox/download-build-toybox.sh
... "git describe --tags --abbrev=12" prints out the tag/hash
for parent project whatever ... not for toybox.tgz.

GITHASH is technically correct, but annoyingly unhelpful.

How shall I force "toybox --version" to print "toybox 0.7.4"
instead of "toybox whatever-16.0.0-222-ge7bb9e918200"
just because the toybox build dir is "under" a git dir?

The patch I submitted added a check for GITHASH_DISABLE.
If that variable is set, then GITHASH will not be set.
so that "toybox --version" will print "0.7.4"

root-cause-fix would be fixing make/build such that
"toybox --version" prints "toybox 0.7.4.{GITHASH}"

lazy-yocto-fix was sed 's/git describe/git-stopit describe/'
Felix Janda
2017-08-06 11:17:28 UTC
Reply
Permalink
Raw Message
Post by Thomas
Post by Rob Landley
Wait, your git --describe is finding a random tarball in some other
directory?
That's really broken.
...
Post by Rob Landley
That's a pretty clear yocto bug (one I can't reproduce), but if you're
adding a workaround for this yocto bug the easy thing to do is keep
GITHASH if it's already be set, not add a second special case variable.
Replace "yocto" with "project using git + building toybox"
make.sh sets GITHASH because the "." directory is "under" git.
/proj/whatever/things/toybox/download-build-toybox.sh
... "git describe --tags --abbrev=12" prints out the tag/hash
for parent project whatever ... not for toybox.tgz.
GITHASH is technically correct, but annoyingly unhelpful.
How shall I force "toybox --version" to print "toybox 0.7.4"
instead of "toybox whatever-16.0.0-222-ge7bb9e918200"
just because the toybox build dir is "under" a git dir?
Have you looked at the GIT_CEILING_DIRECTORIES variable?

Felix
Thomas
2017-08-06 19:10:24 UTC
Reply
Permalink
Raw Message
Post by Felix Janda
Post by Thomas
Post by Rob Landley
Wait, your git --describe is finding a random tarball in some other
directory?
That's really broken.
...
GITHASH is technically correct, but annoyingly unhelpful.
How shall I force "toybox --version" to print "toybox 0.7.4"
instead of "toybox whatever-16.0.0-222-ge7bb9e918200"
just because the toybox build dir is "under" a git dir?
Have you looked at the GIT_CEILING_DIRECTORIES variable?
GIT_CEILING_DIRECTORIES=$(dirname ${PWD}) works, but seems hacky.

Rather than patching [ -z "$GITHASH" ] && GITHASH=... because setting
$GITHASH=myver seems misleading, the (new) attached .patch lets you set
$TOYBOX_VERSION=myver to end up with -DTOYBOX_VERSION=myver ... supersedes
GITHASH= but still falls back to main.c:#define TOYBOX_VERSION= ... so
projects can override "TOYBOX_VERSION=${PV}-${PR}" to keep "toybox
--version" from printing "toybox $(git describe)".

Unless $CONFIG_TOYBOX_VERSION is a better name than $TOYBOX_VERSION.
Unless introducing -DTOYBOX_VERSION_GITHASH and optionally showing "toybox
$TOYBOX_VERSION-$TOYBOX_VERSION_GITHASH" is better.
Rob Landley
2017-08-07 01:44:17 UTC
Reply
Permalink
Raw Message
Post by Thomas
Post by Rob Landley
Wait, your git --describe is finding a random tarball in some other
directory?
That's really broken.
...
Post by Rob Landley
That's a pretty clear yocto bug (one I can't reproduce), but if you're
adding a workaround for this yocto bug the easy thing to do is keep
GITHASH if it's already be set, not add a second special case variable.
Replace "yocto" with "project using git + building toybox"
Is finding a random tarball in some other directory?
Post by Thomas
make.sh sets GITHASH because the "." directory is "under" git.
/proj/whatever/things/toybox/download-build-toybox.sh
... "git describe --tags --abbrev=12" prints out the tag/hash
for parent project whatever ... not for toybox.tgz.
Ah, so you're saying you're building from a tarball under some _other_
project's git repository, so git is finding a ../../../.git directory
that has nothing to do with toybox.

That wasn't how I read the description in that email, my bad.
Post by Thomas
GITHASH is technically correct, but annoyingly unhelpful.
How shall I force "toybox --version" to print "toybox 0.7.4"
instead of "toybox whatever-16.0.0-222-ge7bb9e918200"
just because the toybox build dir is "under" a git dir?
By checking for a .git directory at the top of the toybox source directory.

Rob

Loading...