Incomplete FreeCAD info for Linux packages based on Github source tarball

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby NormandC » Sun Dec 11, 2016 10:33 am

Recent Linux distributions (Fedora, Arch Linux and others) do not provide the full FreeCAD info, and I believe it's because they are based on the automatically generated tarballs on Github.

See this topic as example: viewtopic.php?f=3&t=19077

Typically the FreeCAD info is reported as this:
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1
There's no revision number, no Branch nor Hash entry.

And that's because the tarball at https://github.com/FreeCAD/FreeCAD/releases/tag/0.16 is void of a src/Build/Version.h file. From this source it is thus impossible to get the proper FreeCAD info.

This Arch build recipe shows that the tarball is downloaded and used to compile the package.
(line 23) https://git.archlinux.org/svntogit/comm ... reecad#n23

I think this needs to be addressed, or the FreeCAD info we require here loses a lot its value.

In FreeCAD's source code there's a script to build a source tarball that contains a src/Build/Version.h file. I've used it in the past to create the freecad-stable PPA packages. The downside is that it generates it with a Debian/Ubuntu based name freecad_<version>.orig.tar.gz which may be problematic for other distros because of the underscore and the "orig" suffix. I'm guessing it wouldn't be complicated to add another rule to the script.

Is there a way to switch off the automatic tarball creation on Github, and upload a tarball manually?
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby wmayer » Sun Dec 11, 2016 6:00 pm

In FreeCAD's source code there's a script to build a source tarball that contains a src/Build/Version.h file. I've used it in the past to create the freecad-stable PPA packages. The downside is that it generates it with a Debian/Ubuntu based name freecad_<version>.orig.tar.gz which may be problematic for other distros because of the underscore and the "orig" suffix. I'm guessing it wouldn't be complicated to add another rule to the script.
I don't think we have to worry about other Linux distribution's naming schemes. If they need a different file name it should be easy enough for them to write a function to rename the tarball as needed.
Is there a way to switch off the automatic tarball creation on Github, and upload a tarball manually?
I have no clue if this is possible. Another question is whether it's possible to trigger a certain function that could generate the Version.h file when a user clicks the download button.
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby sgrogan » Sun Dec 11, 2016 6:35 pm

wmayer wrote:I have no clue if this is possible. Another question is whether it's possible to trigger a certain function that could generate the Version.h file when a user clicks the download button.
I have found no way to disable the auto generated tarballs. Additionally there is the problem that the auto generated files correspond to the tag when the release is created, and don't update (same problem for the releases and developer builds) We would need to create new releases and delete the old ones which causes some problems with Travis/Appveyor.
We could deploy tarballs, .deb/.rpm packages w/ version.h from Travis or Appveyor. They would be in addition to the default ones.
chrisb
Posts: 18106
Joined: Tue Mar 17, 2015 9:14 am

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby chrisb » Mon Dec 12, 2016 7:09 am

Perhaps stupid, but does GIt support symbolic links? Then there could be different filenames pointing to the same contents.
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby sgrogan » Mon Dec 12, 2016 12:57 pm

User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby NormandC » Tue Dec 13, 2016 1:45 am

The tarball naming seems like the lesser issue to me. The forced auto-builds is a real bummer.

@ sgrogan: interesting solution explained by the Chakra guy, but I'm not sure other distro maintainers would be willing to do it. I wonder if they're even aware of the missing FreeCAD info in their package, or maybe they don't care :? (just seeing how those Debian guys massacred the freecad-doc package without even looking to fix the issue or ask questions here :| )
User avatar
sgrogan
Posts: 5331
Joined: Wed Oct 22, 2014 5:02 pm

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby sgrogan » Thu Dec 15, 2016 1:10 am

NormandC wrote:The tarball naming seems like the lesser issue to me. The forced auto-builds is a real bummer.
So, do you think it's worth deploying a tarball with version.h? It would be mixed with the win installers and osx disk images. Easy enough to do manually one time.
I'm sure we could do it from Travis automatically, but if nobody knows or is going to use it, it's just work and bandwidth for nothing.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby NormandC » Fri Dec 16, 2016 3:59 am

The problem as I understand it is that there would be three tarballs mixed in the releases: the automatically generated .zip and .tar.gz ones, then the manually made tarball.

My first reaction was that it would be extremely confusing to package maintainers.

Unless a very clear warning was added to the description, expressing not to use the auto-tarballs. I don't like it much but it may be the only solution for now...
jobermayr
Posts: 88
Joined: Fri Dec 02, 2011 4:39 pm
Location: Bavaria that's near Germany

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby jobermayr » Thu Dec 22, 2016 2:03 pm

NormandC wrote:I wonder if they're even aware of the missing FreeCAD info in their package, or maybe they don't care
I use two scripts for openSUSE/Packman packages:

checkout/snapshot script:

Code: Select all

$ sed -i -e "s;Version:.*;Version:        0.16.99+git$(date --utc --date "Jan 1, 1970 00:00:00 +0000 + $(git log origin/master -n 1 --pretty=format:%ct) seconds" +%Y%m%d.%H%M);g" \
-e "s;^FCREVISION=.*;FCREVISION=\"$(git rev-list origin/master | wc -l) (Git)\";g" \
-e "s;^FCREVISIONDATE=.*;FCREVISIONDATE=\"$(date --utc --date "Jan 1, 1970 00:00:00 +0000 + $(git log origin/master -n 1 --pretty=format:%ct) seconds" +"%Y-%m-%d %H:%M:%S") (UTC)\";g" \
-e "s;^FCHASH=.*;FCHASH=\"$(git rev-list -n 1 origin/master)\";g" \
FreeCAD.spec
FreeCAD.spec:

Code: Select all

FCHASH="938daf5c6d20f578c60bbe5caa4dcc15003aabe5"
FCREVISION="9337 (Git)"
FCREVISIONDATE="2016-12-22 10:45:18 (UTC)"
$ echo "$(sed -e "s;\${PACKAGE_WCREF};$FCREVISION \(Packman\);g" \
-e "s;\${PACKAGE_WCDATE};$FCREVISIONDATE;g" \
-e "s;\${PACKAGE_WCURL};https://github.com/FreeCAD/FreeCAD.git;g" \
src/Build/Version.h.cmake)
#define FCRepositoryHash   \"$FCHASH\"
#define FCRepositoryBranch \"master\"" > src/Build/Version.h.cmake
Maybe a git-hook on github which automatically updates src/Build/Version.h.cmake on each commit would be a better solution ...
User avatar
Kunda1
Posts: 5509
Joined: Thu Jan 05, 2017 9:03 pm

Re: Incomplete FreeCAD info for Linux packages based on Github source tarball

Postby Kunda1 » Tue Jan 17, 2017 12:40 am

Linking related post: viewtopic.php?f=4&t=19903
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features