Ticket #4014 - Finding a solution for the 'version.h' issue

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
alberich
Posts: 77
Joined: Thu Aug 17, 2017 2:09 pm
Location: Texas

Re: Finding a solution for the 'version.h' issue

Post by alberich »

Could it be that, for release n, a hash of the code of release n-1 be reported in the Clipboard data? It's not ideal but it would be unique and reproducable. We would just need to understand that the clipboard data is saying, in effect, "I am release (n-1)+1".
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Finding a solution for the 'version.h' issue

Post by reox »

alberich wrote: Tue Jul 09, 2019 9:21 am "I am release (n-1)+1".
That works as long as no one ever builds his own version. And with git, you never know how far off he went, as there is no linear timeline.
And you do not solve the issue of creating the file at build time - the git information might be removed, i.e.when a tarball of the repo is created.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Finding a solution for the 'version.h' issue

Post by Kunda1 »

So where are we on this then?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Finding a solution for the 'version.h' issue

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Finding a solution for the 'version.h' issue

Post by kkremitzki »

For Debian, we're not allowed to call out to the internet, but for the PPA daily builds, it should be possible to just use curl or wget to get the information we need, and then put it in place with a shell script. The problem is that it seems like in order to do that, we would need to re-clone the repository, as the .git directory gets pruned in the build process.

Separate from this, it would be nice to be able to pass the version in via a CMake flag. Right now it's only possible AFAIK to set e.g. 0.18, but not the bugfix release number or to add a commit number, e.g. 0.19.xyz; I have to use a patch to set that.

So, if we could get the information as described in paragraph 1 and then be able to use it as in paragraph 2, that would resolve the issue.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Finding a solution for the 'version.h' issue

Post by sgrogan »

kkremitzki wrote: Sat Jul 20, 2019 6:58 pm For Debian, we're not allowed to call out to the internet, but for the PPA daily builds, it should be possible to just use curl or wget to get the information we need, and then put it in place with a shell script.
The PPA uses Launchpad so I think no internet either.
We can create the version and push it somewhere with our Travis-CI runs. We need to make sure this pushed version.h is in sync with the actual version of the source used.

A possible work flow for the PPA (maybe it could be used for Debian proper as well)

A merge to FreeCAD master happens
This triggers a Travis build, this build could push version.h to the PPA versioning repo (or somewhere more convenient). This repo can be added to the PPA recipe.
The problem here is that the PPA FreeCAD source repo may not be in sync with this version.h My link above suggests a way to force a source repo update, so if this was done with Travis the version.h and the source would be in sync.
"fight the good fight"
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Finding a solution for the 'version.h' issue

Post by kkremitzki »

Did anything ever come of the git hooks idea? If we could just commit the info to a separate version branch at any point, we could assume the PPA will get both master and the version branch in sync, and then we could just use the Launchpad recipes system to grab the file from that branch and combine it with master.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Finding a solution for the 'version.h' issue

Post by openBrain »

kkremitzki wrote: Sat Jul 20, 2019 8:00 pm Did anything ever come of the git hooks idea?
On my side I was stuck mainly because I can't have a clear vision of how git hooks are stored (limited skill inside)... :/
On SVN, it is clear that server-side hooks are stored ... server-side. ;)
But on Git I can't be sure. Even oppositely it "seems" that all hooks are stored client-side, and server-side hooks are passed to the server at pushing time (be cautious, this is my lameous understanding ATM). Which obviously makes it a mess so you can be sure it is run at every push...
Sorry I can't no more help. :?

@Kunda1 : maybe you could prepend the bug ID to the thread title (#4014). ;)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4014 - Finding a solution for the 'version.h' issue

Post by Kunda1 »

openBrain wrote: Mon Jul 22, 2019 12:57 pm @Kunda1 : maybe you could prepend the bug ID to the thread title (#4014).
Done :)
Thanks!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Ticket #4014 - Finding a solution for the 'version.h' issue

Post by openBrain »

What about having a server (maybe the one hosting the website ???) subscribing to GitHub hooks (PushEvent and PullRequestEvent are the 2 I see ATM) through the REST API to update commit ID & hash on somewhere else that would be merged at compile time ?

PS : guys, please tell me if I'm making more noise than helping... ;)
Post Reply