openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
103 stars 58 forks source link

Version names via Workflows #108

Closed speters closed 2 years ago

speters commented 2 years ago

Version names are a bit off for build artifacts generated by the Workflows.

Too late, no idea. Will keep workflow as-is for now....

speters commented 2 years ago

From the runner log:

2022-08-30T20:50:17.8099410Z Job defined at: openv/vcontrold/.github/workflows/build_linux.yml@refs/tags/v0.98.11
[...]
2022-08-30T20:50:28.4971771Z From https://github.com/openv/vcontrold
2022-08-30T20:50:28.4973858Z  * [new branch]      code_refactoring       -> origin/code_refactoring
2022-08-30T20:50:28.4975883Z  * [new branch]      feature_newxmlformat   -> origin/feature_newxmlformat
2022-08-30T20:50:28.4977227Z  * [new branch]      fix_58_host_ipv4_w_port_arg -> origin/fix_58_host_ipv4_w_port_arg
2022-08-30T20:50:28.4977771Z  * [new branch]      fix_fno_common_typedef -> origin/fix_fno_common_typedef
2022-08-30T20:50:28.4978182Z  * [new branch]      legacy                 -> origin/legacy
2022-08-30T20:50:28.4978561Z  * [new branch]      master                 -> origin/master
2022-08-30T20:50:28.4978900Z  * [new tag]         v0.98.10               -> v0.98.10
2022-08-30T20:50:28.4979239Z  * [new tag]         v0.98.11               -> v0.98.11
2022-08-30T20:50:28.4979607Z  * [new tag]         v0.98.2-107+IPv6       -> v0.98.2-107+IPv6
2022-08-30T20:50:28.4989478Z  * [new tag]         v0.98.3                -> v0.98.3
2022-08-30T20:50:28.4990462Z  * [new tag]         v0.98.4                -> v0.98.4
2022-08-30T20:50:28.4990871Z  * [new tag]         v0.98.5                -> v0.98.5
2022-08-30T20:50:28.4991206Z  * [new tag]         v0.98.6                -> v0.98.6
2022-08-30T20:50:28.4991536Z  * [new tag]         v0.98.7                -> v0.98.7
2022-08-30T20:50:28.4992063Z  * [new tag]         v0.98.8                -> v0.98.8
2022-08-30T20:50:28.4999909Z  * [new tag]         v0.98.9                -> v0.98.9
2022-08-30T20:50:28.5029913Z [command]/usr/bin/git tag --list v0.98.11
2022-08-30T20:50:28.5062038Z v0.98.11
2022-08-30T20:50:28.5072692Z [command]/usr/bin/git rev-parse refs/tags/v0.98.11
2022-08-30T20:50:28.5130027Z d4e114864aef529891b2c7166b13a385880f36b8
2022-08-30T20:50:28.5140879Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules origin +a715e1af92fe4ccc9495743bb03abc685d645edf:refs/tags/v0.98.11
2022-08-30T20:50:28.5204305Z From https://github.com/openv/vcontrold
2022-08-30T20:50:28.5205264Z  t [tag update]      a715e1af92fe4ccc9495743bb03abc685d645edf -> v0.98.11
2022-08-30T20:50:28.5224812Z ##[endgroup]
2022-08-30T20:50:28.5225799Z ##[group]Determining the checkout info
2022-08-30T20:50:28.5226575Z ##[endgroup]
2022-08-30T20:50:28.5229097Z ##[group]Checking out the ref
2022-08-30T20:50:28.5233755Z [command]/usr/bin/git checkout --progress --force refs/tags/v0.98.11
2022-08-30T20:50:28.5319448Z Note: switching to 'refs/tags/v0.98.11'.
2022-08-30T20:50:28.5320114Z 
2022-08-30T20:50:28.5320784Z You are in 'detached HEAD' state. You can look around, make experimental
[...]
2022-08-30T20:50:28.5323993Z HEAD is now at a715e1a fetch-depth to get entire history
2022-08-30T20:50:28.5326169Z ##[endgroup]
2022-08-30T20:50:28.5373438Z [command]/usr/bin/git log -1 --format='%H'
2022-08-30T20:50:28.5404706Z 'a715e1af92fe4ccc9495743bb03abc685d645edf'
[...]
2022-08-30T20:51:02.8899924Z /usr/local/bin/cmake -DBASE_DIR=/home/runner/work/vcontrold/vcontrold -DCMAKE_BUILD_TYPE= -P /home/runner/work/vcontrold/vcontrold/cmake/UpdateVersion.cmake
2022-08-30T20:51:02.9058856Z -- Updating version information to 0.98.10-32-ga715e1a ...

Note the following:

1

> git describe d4e114864aef529891b2c7166b13a385880f36b8
v0.98.11

2

> git describe a715e1af92fe4ccc9495743bb03abc685d645ed

v0.98.11

note the blank line

3

> git describe v0.98.10-32-ga715e1a
v0.98.11

4

> git show-ref -d
[...]
2eab9828bf523c17f8a1d2a72fefd464cf1f3b43 refs/tags/v0.98.10
1fccd11715b5286890595b9ccd20340e6d3357ec refs/tags/v0.98.10^{}
d4e114864aef529891b2c7166b13a385880f36b8 refs/tags/v0.98.11
a715e1af92fe4ccc9495743bb03abc685d645edf refs/tags/v0.98.11^{}
[...]

Still clueless...

hmueller01 commented 2 years ago

Sry, I don't see the v0.98.11 tag ...

> git pull upstream master
> git show-ref -d
ce9ad826e2c78fbda2d1f8570c6228132414db50 refs/heads/cleanup
0e1082c201b9a8d141c34eb8297e54ba0a57b583 refs/heads/doc-fix-cmd-line-args
37aa8623253a900f79f97b90dbc213dbe62b8801 refs/heads/fix-error-output
3512967e3d0ac91f63316fd295b583e30e22f530 refs/heads/fix-sigpipe-crash
3e91e2082a354707e0d26806dc6385db29b822a9 refs/heads/fix_codescanning_1-1
ff26dc38423aea018342c33f719fad52ef2ac2ff refs/heads/hostname-fix
4a45050191cd80e9834a2f4a54b8e021c37e8012 refs/heads/ignore-version-h
77468172a4cc81f46ca253d346b949b04fe6c00e refs/heads/master
4432fcd641c5b5d2d959c4281549dd589410d3ef refs/heads/vclient-err-handling
77468172a4cc81f46ca253d346b949b04fe6c00e refs/remotes/origin/HEAD
ce9ad826e2c78fbda2d1f8570c6228132414db50 refs/remotes/origin/cleanup
7b15530934db4311f03081a1cc9df57d1447db8c refs/remotes/origin/code_refactoring
0e1082c201b9a8d141c34eb8297e54ba0a57b583 refs/remotes/origin/doc-fix-cmd-line-args
37aa8623253a900f79f97b90dbc213dbe62b8801 refs/remotes/origin/fix-error-output
3512967e3d0ac91f63316fd295b583e30e22f530 refs/remotes/origin/fix-sigpipe-crash
82643c1fcb480050cac2634e2ce918a6ff5ed9fa refs/remotes/origin/fix_codescanning_1-1
ff26dc38423aea018342c33f719fad52ef2ac2ff refs/remotes/origin/hostname-fix
4a45050191cd80e9834a2f4a54b8e021c37e8012 refs/remotes/origin/ignore-version-h
b649d0fa8376b501452d4822614771e5d8b0135d refs/remotes/origin/legacy
77468172a4cc81f46ca253d346b949b04fe6c00e refs/remotes/origin/master
4432fcd641c5b5d2d959c4281549dd589410d3ef refs/remotes/origin/vclient-err-handling
7b15530934db4311f03081a1cc9df57d1447db8c refs/remotes/upstream/code_refactoring
2321a7f4749d89e4e0dfa6865dd2742f34fe71c8 refs/remotes/upstream/feature_newxmlformat
0ebbcd240aa65550d52ad6aed3b78661989aeca5 refs/remotes/upstream/fix_58_host_ipv4_w_port_arg
29000711d587a5d2906c5ac464860748fdb2d5e6 refs/remotes/upstream/fix_fno_common_typedef
b649d0fa8376b501452d4822614771e5d8b0135d refs/remotes/upstream/legacy
77468172a4cc81f46ca253d346b949b04fe6c00e refs/remotes/upstream/master
2eab9828bf523c17f8a1d2a72fefd464cf1f3b43 refs/tags/v0.98.10
1fccd11715b5286890595b9ccd20340e6d3357ec refs/tags/v0.98.10^{}
813b6dbb422dc0831f698464d5d080d0ab3c3a31 refs/tags/v0.98.2-107+IPv6
7a608e8e1583000135e2f14d6627fbaeb0f6cd90 refs/tags/v0.98.2-107+IPv6^{}
804cf8e18c441b1d16565989c7b230a16402ec4d refs/tags/v0.98.3
1ef0b3978e0eab2bbd39d74a8142f11991686912 refs/tags/v0.98.3^{}
9cb5193520f7382be2089b585fbd875cc8df4e4d refs/tags/v0.98.4
c2f88f3f0d2340069a37debd49b2bc59333cc6fd refs/tags/v0.98.4^{}
040aed723a2a7efc12a3e030023b0d94254f7061 refs/tags/v0.98.5
150a840ad3e4943d0d05bbb9182ab0eb1216fda9 refs/tags/v0.98.5^{}
afddfcdba0c77df3fb63ac7fc13e5d539582d955 refs/tags/v0.98.6
34d6f0ffc65e130b02f04ae677e1d0ab0fd2c8ee refs/tags/v0.98.6^{}
a4128a21f64bf756053d6c3afb6520f16ecef90c refs/tags/v0.98.7
aa3f0ada5a18e619f22698bec52e9e1a7d67c4fe refs/tags/v0.98.7^{}
857c7e49ff2c56515133b01a55b8f13410106838 refs/tags/v0.98.8
bff06af785032ec32f8726b41b868cd532e25e1b refs/tags/v0.98.8^{}
d6efd20bf7243e10a1a10da962868f01cd490efe refs/tags/v0.98.9
a51bc41c51cacc8b8177e7771f97653f9648581e refs/tags/v0.98.9^{}
speters commented 2 years ago

Sorry, desperately pushed references again, then had to remove some old stale branches again...

The CodeQL action uses no fetch-depth: 0option, so it cannot get entire history. This leads to

2022-08-31T18:59:46.5327085Z CMake Warning at /home/runner/work/vcontrold/vcontrold/cmake/GitDescription.cmake:33 (message):
2022-08-31T18:59:46.5327444Z   Error was: fatal: No annotated tags can describe
2022-08-31T18:59:46.5327806Z   '90a82af6b1b12f2226ab671de7770d5d512f81f0'.
2022-08-31T18:59:46.5327966Z 
2022-08-31T18:59:46.5328736Z   However, there were unannotated tags: try --tags.

In the case of CodeQL scanning workflow, it does not matter.

But the build actions do set fetch-depth: 0 as pointed out in https://github.com/actions/checkout In the latest build run:

2022-08-31T18:59:18.2861357Z /usr/local/bin/cmake -DBASE_DIR=/home/runner/work/vcontrold/vcontrold -DCMAKE_BUILD_TYPE= -P /home/runner/work/vcontrold/vcontrold/cmake/UpdateVersion.cmake
2022-08-31T18:59:18.3020816Z -- Updating version information to 0.98.10-34-g90a82af .

The test workflow logs this:

2022-08-31T19:12:09.9153451Z /usr/local/bin/cmake -DBASE_DIR=/home/runner/work/vcontrold/vcontrold -DCMAKE_BUILD_TYPE= -P /home/runner/work/vcontrold/vcontrold/cmake/UpdateVersion.cmake
2022-08-31T19:12:09.9253416Z -- Updating version information to 0.98.11 ...

All mentioned workflows were run on Commit 90a82af.

speters commented 2 years ago

Just discovered that it might be related to https://github.com/actions/checkout/issues/290

speters commented 2 years ago

Finally got it sorted. Workaround fixed it.