This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
-
openBrain
- Posts: 2323
- Joined: Fri Nov 09, 2018 5:38 pm
Post
by openBrain » Thu Jul 04, 2019 5:31 pm
Sorry if this is b*llsh*t, but couldn't that be a way to use a git hook among pre-push, pre-receive, update or post-receive ?
So the version.h is updated at push time & not at compile time.

-
Kunda1
- Posts: 5903
- Joined: Thu Jan 05, 2017 9:03 pm
Post
by Kunda1 » Thu Jul 04, 2019 5:56 pm
openBrain wrote: ↑Thu Jul 04, 2019 5:31 pm
Sorry if this is b*llsh*t, but couldn't that be a way to use a git hook among pre-push, pre-receive, update or post-receive ?
So the version.h is updated at push time & not at compile time.
This makes sense but if I recall correctly from some time ago that there may be a security concern involved with this approach.
Perhaps @kkremitzki remembers?
-
kkremitzki
- Posts: 1789
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Texas
Post
by kkremitzki » Thu Jul 04, 2019 6:36 pm
The file has to be made at build-time. You can't take a hash of a repository and then put it in a file in that repository because it changes the hash.
-
openBrain
- Posts: 2323
- Joined: Fri Nov 09, 2018 5:38 pm
Post
by openBrain » Thu Jul 04, 2019 6:46 pm
Sure. But at least the commit number used in the version could be managed that way, right ?
EDIT : it's tricky but could hash be written in a file in a different repo/branch and this file being integrated at compile time ?
EDIT2 : even trickier, a pre-push hook that will append to the last commit message the hash (hopefully commit messages aren't took into account into the hash)
-
reox
- Posts: 666
- Joined: Sat Aug 13, 2016 10:06 am
-
Contact:
Post
by reox » Thu Jul 04, 2019 7:15 pm
openBrain wrote: ↑Thu Jul 04, 2019 6:46 pm
EDIT : it's tricky but could hash be written in a file in a different repo/branch and this file being integrated at compile time ?
this is what the old daily build did. But the repo grows to very large size and traversing all the objects takes a long time...
So yes, IIRC you can create a "update" hook which has the sha1 hash of the pushed commit and you could write this into some other repo and push it server side.
I'm not sure if it would be possible to create a new commit in the same repo inside the hook... I guess that is prone to infinit recursions and disregarded
openBrain wrote: ↑Thu Jul 04, 2019 6:46 pm
EDIT2 : even trickier, a pre-push hook that will append to the last commit message the hash (hopefully commit messages aren't took into account into the hash)
I would never rewrite anything server side - I'm not sure if this is even possible.
-
openBrain
- Posts: 2323
- Joined: Fri Nov 09, 2018 5:38 pm
Post
by openBrain » Thu Jul 04, 2019 7:26 pm
reox wrote: ↑Thu Jul 04, 2019 7:15 pm
openBrain wrote: ↑Thu Jul 04, 2019 6:46 pm
EDIT2 : even trickier, a pre-push hook that will append to the last commit message the hash (hopefully commit messages aren't took into account into the hash)
I would never rewrite anything server side - I'm not sure if this is even possible.
AFAIK pre-push is client side.

-
reox
- Posts: 666
- Joined: Sat Aug 13, 2016 10:06 am
-
Contact:
Post
by reox » Thu Jul 04, 2019 7:44 pm
openBrain wrote: ↑Thu Jul 04, 2019 7:26 pm
reox wrote: ↑Thu Jul 04, 2019 7:15 pm
openBrain wrote: ↑Thu Jul 04, 2019 6:46 pm
EDIT2 : even trickier, a pre-push hook that will append to the last commit message the hash (hopefully commit messages aren't took into account into the hash)
I would never rewrite anything server side - I'm not sure if this is even possible.
AFAIK pre-push is client side.
ah sorry

okay but this does not solve the issue. everyone developing for FC must have this hook then, and merges on github would not work with this...
-
jmaustpc
- Posts: 9566
- Joined: Tue Jul 26, 2011 6:28 am
- Location: Australia
Post
by jmaustpc » Sun Jul 07, 2019 3:25 pm
As other have said, couldn't we include a new line with "build time and date"?
-
kkremitzki
- Posts: 1789
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Texas
Post
by kkremitzki » Sun Jul 07, 2019 4:13 pm
Including build date/time in the packaging output is not an ideal solution, it prevents FreeCAD from ever having reproducible builds. The ideal thing would be some property we get or calculate from the source. We are using a synced copy from the Github repo so the commits should be the same. I noticed the daily build does not have git as a build dependency, so I've added this just now to see what effect it has on today's builds re: the version number.