creating source releases

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: creating source releases

Post by looo »

wmayer wrote: Sat Oct 30, 2021 11:02 am FYI, the target dist-git is defined in CreatePackagingTargets.cmake and looks like:
For clarification: The goal is to run cmake in a certain way, so FreeCAD produces a source-tarball. Did I understand this correctly? If so what about all the dependencies? I would like to avoid any dependencies in this step.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: creating source releases

Post by wmayer »

looo wrote: Sat Oct 30, 2021 9:29 pm For clarification: The goal is to run cmake in a certain way, so FreeCAD produces a source-tarball. Did I understand this correctly? If so what about all the dependencies? I would like to avoid any dependencies in this step.
The procedure is to checkout the git repo on a system. You then run cmake to generate the Makefiles and start with make the build process. As soon as the target FreeCADApp starts it creates the file Version.h. Here you can break the build and run make dist-git to create the source tarball.
If so what about all the dependencies? I would like to avoid any dependencies in this step.
If you mean with dependencies cmake, the libs, the compiler, ... then I don't know a way to achieve this without them.

I don't know if it's possible to create the Version.h with a GH action. IMO, we anyway should implement a solution independent on where the sources are hosted.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: creating source releases

Post by looo »

wmayer wrote: Sat Oct 30, 2021 10:42 pm The procedure is to checkout the git repo on a system. You then run cmake to generate the Makefiles and start with make the build process.
But to run cmake all the dependencies must be available. Otherwise cmake will fail.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: creating source releases

Post by wmayer »

But can't you simply create the tarball on a system where you have setup the build environment, upload the source tarball to server somewhere and then get this source tarball for your builds?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: creating source releases

Post by wmayer »

The github action to generate the version file and the compressed source code is already done. My question now is, how to use the version-file in the build process? And which information do we need? Currently the version file looks like this:
How does it work to create the Version.h file? What you need now is a way to extract the:
  • number of commits of the branch
  • the date of the last push
  • the url of the repositoy
  • the hash of the last push
  • the name of the branch
If there is a file src/Build/Version.h in the sources then this file will be used as it is.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: creating source releases

Post by looo »

wmayer wrote: Sun Oct 31, 2021 10:58 am
The github action to generate the version file and the compressed source code is already done. My question now is, how to use the version-file in the build process? And which information do we need? Currently the version file looks like this:
How does it work to create the Version.h file? What you need now is a way to extract the:
  • number of commits of the branch
  • the date of the last push
  • the url of the repositoy
  • the hash of the last push
  • the name of the branch
If there is a file src/Build/Version.h in the sources then this file will be used as it is.
wmayer wrote: Sun Oct 31, 2021 10:48 am But can't you simply create the tarball on a system where you have setup the build environment, upload the source tarball to server somewhere and then get this source tarball for your builds?
My current approach is to fill the Version.h.cmake file , commit the changes and use "git archive" to create the archive. Look here:
https://github.com/FreeCAD/FreeCAD-Bund ... .py#L38L44
With this aproach I do not have to pull any dependencies, which is nice as the github-action doesn't need a lot of time.

Still not sure where I should fill in the url, hash and branch-name.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: creating source releases

Post by adrianinsaval »

weekly release version info is broken atm
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.Unknown
Build type: Release
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Spanish/Paraguay (es_PY)
Attachments
Captura de pantalla 2021-11-03 140216.png
Captura de pantalla 2021-11-03 140216.png (89.65 KiB) Viewed 2539 times
Post Reply