Incomplete FreeCAD info for Linux packages based on Github source tarball

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Incomplete FreeCAD info for Linux packages based on Github source tarball

Post by NormandC »

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
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

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

Post by wmayer »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan »

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.
"fight the good fight"
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

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

Post by chrisb »

Perhaps stupid, but does GIt support symbolic links? Then there could be different filenames pointing to the same contents.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan »

"fight the good fight"
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

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

Post by NormandC »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

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

Post by sgrogan »

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.
"fight the good fight"
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

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

Post by NormandC »

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

Post by jobermayr »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

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

Post by Kunda1 »

Linking related post: viewtopic.php?f=4&t=19903
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
Post Reply