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...)
openBrain
Posts: 1574
Joined: Fri Nov 09, 2018 5:38 pm

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

Post by openBrain » Sun Jun 23, 2019 5:43 pm

@kkremitzi, as you proposed in the ticket, may you please explain roughly in some lines the current building process ? Thx.

User avatar
kkremitzki
Posts: 1642
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

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

Post by kkremitzki » Sun Jun 23, 2019 7:35 pm

openBrain wrote:
Sun Jun 23, 2019 5:43 pm
@kkremitzi, as you proposed in the ticket, may you please explain roughly in some lines the current building process ? Thx.
Definitely!

The build is controlled by this Launchpad recipe which automatically gets built every day: https://code.launchpad.net/~freecad-mai ... dual-build

Here's the recipe:

Code: Select all

# git-build-recipe format 0.4 deb-version {debupstream}~{time}
lp:~freecad-maintainers/freecad/+git/freecad master
nest-part debian lp:freecad debian debian ppa/daily
So, if you look at lines 2 & 3 you see it pulls in code from two Launchpad repos: https://code.launchpad.net/~freecad-mai ... it/freecad and https://code.launchpad.net/~freecad-mai ... ecad-salsa.

The first is set to automatically sync with github.com/freecad/freecad, the code repo. The second syncs automatically to salsa.debian.org/science-team/freecad, the packaging repo. You can see it pulls in the debian folder from the ppa/daily branch of the science-team repo and combines it with the github master, putting it in ./debian.

From there, the normal Debian build process takes place.

BTW, this issue is also related to the fact that i have to use a patch in order to display "0.18.2" in Help > About FreeCAD and on the splash screen during startup: https://salsa.debian.org/science-team/f ... ecad.patch

So, if we can fix the daily builds showing the git commit hash after 0.19, that solution may also allow us to correctly set the release version number without needing a patch.
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
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan » Sun Jun 23, 2019 7:47 pm

kkremitzki wrote:
Sun Jun 23, 2019 7:35 pm
The first is set to automatically sync with github.com/freecad/freecad, the code repo
It does this about every 5 hours. It's not guaranteed that the source is in-sync with upstream.

openBrain
Posts: 1574
Joined: Fri Nov 09, 2018 5:38 pm

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

Post by openBrain » Mon Jun 24, 2019 2:40 pm

Hi guys,

Thanks for details. Tried to dig a bit. I'm new to this, so tell me if I'm wrong :
  • The build revision displayed in the about box is get from the "BuildRevisionBranch" of the App Config
  • It is populated in the Config by the preprocessor if the "FCRepositoryBranch" macro has been #defined
  • This macro is appended to the code in "SubWCRev.py" which get info through git
  • This script is itself called in CMakeLists.txt at build time
Given that, how does that sound to patch "SubWCRev.py" ? Notice that I actually don't know ATM why it fails. :)

User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan » Mon Jun 24, 2019 8:36 pm

openBrain wrote:
Mon Jun 24, 2019 2:40 pm
Given that, how does that sound to patch "SubWCRev.py" ? Notice that I actually don't know ATM why it fails. :)
The script works as intended.
The issue is that the Lauchpad build process creates a Debian source package. When the source package is created the git info (revision history) is stripped, so the needed info doesn't exist in the package anymore. Further during the build process there is no web access (abdullah tried to use the GithubWeb API to get the info)

EDIT: This link is interesting for future discussion https://docs.travis-ci.com/user/deployment/launchpad/

openBrain
Posts: 1574
Joined: Fri Nov 09, 2018 5:38 pm

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

Post by openBrain » Mon Jul 01, 2019 6:20 pm

Just a thought : couldn't that topic be pushed in the Configuration Management GSoC ?

User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan » Wed Jul 03, 2019 9:56 pm

openBrain wrote:
Mon Jul 01, 2019 6:20 pm
Just a thought : couldn't that topic be pushed in the Configuration Management GSoC ?
Phase 1 was Linux, which is passed.
Phase 2 is Windows.
Maybe if there is extra time at the end (HaHa extra time for packaging configuration management is a pipe dream)

Maybe we could get the date into the About FreeCAD copy to clipboard? Better than nothing as Quick61 points out.

wmayer
Site Admin
Posts: 14426
Joined: Thu Feb 19, 2009 10:32 am

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

Post by wmayer » Thu Jul 04, 2019 7:52 am

As long as the source code is handled by a VCS then the Version.h is created at build time trying to access the information through commands of the VCS.
When creating a tarball stripping the VCS meta data then usually a Version.h doesn't exist and it becomes impossible to determine the needed information afterwards.

So far the only reliable way to create a source tarball with a Version.h is to call make dist-git from within the build directory and where the source directory still has the git meta data.

User avatar
Kunda1
Posts: 4755
Joined: Thu Jan 05, 2017 9:03 pm

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

Post by Kunda1 » Thu Jul 04, 2019 12:05 pm

wmayer wrote:
Thu Jul 04, 2019 7:52 am
So far the only reliable way to create a source tarball with a Version.h is to call make dist-git from within the build directory and where the source directory still has the git meta data.
Does git meta data exist if the tarball is not retrieved from git?
I'm asking about distros/packages that don't compile from the git repo.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features

User avatar
PrzemoF
Posts: 2598
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

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

Post by PrzemoF » Thu Jul 04, 2019 12:27 pm

As far as I know the info is not there. I build for fedora and I use some tricks to get the numbers:

- bash function that generates number of git commits [1]
- section of fedora spec file that fixes Version.h using sed [2]

[1] https://github.com/FreeCAD/FreeCAD/blob ... .macros#L1
[2] https://github.com/FreeCAD/FreeCAD/blob ... .spec#L160

Post Reply