-
-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Allow to override build date #3417
Conversation
in builds from a release tarball, there is no git commit to take a date from, so the current date was inserted there. See https://reproducible-builds.org/ for why this matters and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. This patch was done while working on reproducible builds for openSUSE.
I"ll take a closer look later, but I"m really favorable on the concept. Thanks! |
When GRASS GIS is compiled from the release tarball source code (without Git, and without official patch https://github.com/OSGeo/grass/releases/download/8.3.1/core_modules_with_last_commit.patch) getting date is provide with this function Lines 407 to 409 in aaecfc8
Lines 259 to 261 in aaecfc8
Lines 205 to 221 in aaecfc8
Compilation was tested with GRASS GIS official release tarball source code 8.3.1 version under Gentoo GNU/Linux distribution. r.surf.rst module man page example: |
Ok I see patch is for reproducible builds for openSUSE distribution. |
Small note: You can use official patch core_modules_with_last_commit.patch or simple Patch/JSON file is generated for every official release, you can find them under release URL https://github.com/OSGeo/grass/releases page under Assets section. |
Unfortunately we are still on 8.2.1 atm and there is no https://github.com/OSGeo/grass/releases/download/8.2.1/core_modules_with_last_commit.json / patch - is there a way to only take my code-path for when that file is missing? |
Yes you are right, patch/JSON file with core modules commits are generated for version >= 8.3. Doesn"t return this line code |
@tmszi Could that be backported to 8.2? |
I think so, but I will have to look into the source code (and prepare backport PR) to give you the exact answer. |
The source code that is needed to automatically generate core modules with the last commit JSON file and patch file is included in the realeasebranch_8_2 branch. I"m wonder why these files is not automatically created for 8.2.x realease. GitHub workflow config files looks good to me. grass/.github/workflows/create_release_draft.yml Lines 34 to 38 in 0bd5c8d
grass/.github/workflows/create_release_draft.yml Lines 62 to 71 in 0bd5c8d
grass/.github/workflows/create_release_draft.yml Lines 95 to 104 in 0bd5c8d
|
@bmwiedemann It is possible generate JSON/patch file manually for 8.2.1 version:
|
Wouldn"t it be better to – in the process of creating the tarball – create and add a simple textfile containing the git commit? Configure then can try get info from git or if failing so retrieve the same info from the file (if existing). |
Must be better than: Lines 157 to 176 in 25bc70d
…or did I miss something? |
Yes it is improvement, but core_modules_with_last_commit patch/JSON file is not required file by default. Actually all states are handled correctly during compilation process:
Info from the man page will looks like: Accessed: Sunday Feb 18 10:58:31 2024 Lines 216 to 221 in aaecfc8
|
In practice, |
The generated patch/json file is needed in a tarball release, but should be included in the tarball and used by configure. This way it results in a consistent manner. |
#3435 attempt to address this for tarball releases with |
Yes it will be. core_modules_with_last_commit.json file structure: {
"g.version": {
"commit": "f146b2078dadabb79722b8e6b9323b8ae535f40f",
"date": "2022-12-13T16:22:24-03:00"
},
"g.filename": {
"commit": "547ff44e6aecfb4c9cbf6a4717fc14e521bec0be",
"date": "2022-02-03T11:10:06+01:00"
},
} |
So now that #3435 is done, what is the status of this PR? |
With #3435 and #3437, resulting in Git related data included in tarball too, consistent builds are enabled with/without Git and also across platforms. This will be available with GRASS GIS 8.4. |
Allow to override build date with
SOURCE_DATE_EPOCH
becausein builds from a release tarball, there is no git commit to take a date from, so the current date was inserted there.
See https://reproducible-builds.org/ for why this matters and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable.
This patch was done while working on reproducible builds for openSUSE.
note: I only tested the build and only on 8.2.1