All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Repository information during build
@ 2015-01-11 20:29 Thomas Ruschival
  2015-01-11 21:05 ` Bernd Kuhls
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Ruschival @ 2015-01-11 20:29 UTC (permalink / raw)
  To: buildroot

In a cmake project I use a git and some cmake-macros to extract the current
commit hash of the source code and generate a C file with the information.
This way the executable can print out with the revision.

Using Buildroot this aproach fails rather obviously. (Buildroot clones the
repository, checks out the requested branch/tag/commit and generates a
tarball without the git information which is used for build)

I extended the CMakeLists of the project, The git-revision can be also
passed as definition (cmake -DGIT_COMMIT_HASH=12345 ....) and cmake only
uses git to get the commit hash if it is not defined.

Is there a canonical way to access the git revision of a package in the
package.mk file to pass it to the build of the package?

I.e. how do I find out the revision of the "master" branch Buildroot used
to create the tarball?

Thanks in advance & Best regards
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150111/06770916/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Repository information during build
  2015-01-11 20:29 [Buildroot] Repository information during build Thomas Ruschival
@ 2015-01-11 21:05 ` Bernd Kuhls
  2015-01-11 22:17   ` Thomas Ruschival
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Kuhls @ 2015-01-11 21:05 UTC (permalink / raw)
  To: buildroot

Thomas Ruschival <t.ruschival@gmail.com> wrote 
in news:CAAOPk_zdYo4RhifBpQq8mtBQmt4_xfmhm0rQw+ubZ9DOUDy1SQ at mail.gmail.com:

> I.e. how do I find out the revision of the "master" branch Buildroot used
> to create the tarball?

Hi,

an example: 
http://git.buildroot.net/buildroot/tree/package/tvheadend/tvheadend.mk

You are looking for $(TVHEADEND_VERSION).

Regards, Bernd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Repository information during build
  2015-01-11 21:05 ` Bernd Kuhls
@ 2015-01-11 22:17   ` Thomas Ruschival
  2015-01-12  8:17     ` Jeremy Rosen
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Ruschival @ 2015-01-11 22:17 UTC (permalink / raw)
  To: buildroot

Hi Bernd,
thanks for the reply.

> TVHEADEND_VERSION = c051d0bda5b69ce61e64a97fd4a41db899dcfb53
> TVHEADEND_SITE=$(call github,tvheadend,tvheadend,$(TVHEADEND_VERSION))

In your example the version is already in the makefile. The source  is
retrieved by its SHA1.
What I wanted to do is to let the makefile always check out the master
branch. I don't like to update my buildroot makefiles if the master
branch changes its HEAD revision.

... maybe I have to rethink the integration strategy. But even if, I
really would like to have this feature....

Best regards
Thomas



On 01/11/2015 07:05 PM, Bernd Kuhls wrote:
> Thomas Ruschival <t.ruschival@gmail.com> wrote 
> in news:CAAOPk_zdYo4RhifBpQq8mtBQmt4_xfmhm0rQw+ubZ9DOUDy1SQ at mail.gmail.com:
> 
>> I.e. how do I find out the revision of the "master" branch Buildroot used
>> to create the tarball?
> 
> Hi,
> 
> an example: 
> http://git.buildroot.net/buildroot/tree/package/tvheadend/tvheadend.mk
> 
> You are looking for $(TVHEADEND_VERSION).
> 
> Regards, Bernd
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Repository information during build
  2015-01-11 22:17   ` Thomas Ruschival
@ 2015-01-12  8:17     ` Jeremy Rosen
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Rosen @ 2015-01-12  8:17 UTC (permalink / raw)
  To: buildroot

hey Thomas





----- Mail original -----
> Hi Bernd,
> thanks for the reply.
> 
> > TVHEADEND_VERSION = c051d0bda5b69ce61e64a97fd4a41db899dcfb53
> > TVHEADEND_SITE=$(call
> > github,tvheadend,tvheadend,$(TVHEADEND_VERSION))
> 
> In your example the version is already in the makefile. The source
>  is
> retrieved by its SHA1.
> What I wanted to do is to let the makefile always check out the
> master
> branch. I don't like to update my buildroot makefiles if the master
> branch changes its HEAD revision.
> 

This breaks one of buildroot's main selling point : reproducible builds...

The reason why BR checksout a specific ID instead of a branch name is to
make sure that two builds are exactly the same. Yes you have to manually
update your .mk when a new version is released, but you have reproducible
builds which are critical to know what you have on your plateform.

Now I understand that when you want to develop, being able to checkout a
branch is very tempting, but branches are moving targets, BR just checks
if it already has downloaded the package, and doesn't do it again if it 
finds it around. (in other word, there is no infrastructure to check 
"moving targets" like branch names)

That would be an interesting feature to add (I'm not sure how, though) but
any package that you want to upstream will have to target a specific
tag/id, because BR upstream should be reproducible...


> ... maybe I have to rethink the integration strategy. But even if, I
> really would like to have this feature....
> 
> Best regards
> Thomas
> 
> 
> 
> On 01/11/2015 07:05 PM, Bernd Kuhls wrote:
> > Thomas Ruschival <t.ruschival@gmail.com> wrote
> > in
> > news:CAAOPk_zdYo4RhifBpQq8mtBQmt4_xfmhm0rQw+ubZ9DOUDy1SQ at mail.gmail.com:
> > 
> >> I.e. how do I find out the revision of the "master" branch
> >> Buildroot used
> >> to create the tarball?
> > 
> > Hi,
> > 
> > an example:
> > http://git.buildroot.net/buildroot/tree/package/tvheadend/tvheadend.mk
> > 
> > You are looking for $(TVHEADEND_VERSION).
> > 
> > Regards, Bernd
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> > 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-12  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-11 20:29 [Buildroot] Repository information during build Thomas Ruschival
2015-01-11 21:05 ` Bernd Kuhls
2015-01-11 22:17   ` Thomas Ruschival
2015-01-12  8:17     ` Jeremy Rosen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.