Page MenuHomeVyOS Platform

Build from Git tags fail
Closed, ResolvedPublicBUG

Description

Hello everyone!

I used the following build commands:

- git clone -b sagitta --single-branch https://github.com/vyos/vyos-build
- git checkout 1.4.0-epa1
- cd vyos-build
- export VYOS_VERSION=1.4.0-epa1
- make clean
- |
  ./build-vyos-image iso \
    --architecture amd64 \
    --build-by xxxx \
    --build-type release \
    --build-comment "VyOS with packages ready for prometheus node exporter and ansible" \
    --version "${VYOS_VERSION}-$(date +%Y-%m-%d-%H-%M)" \
    --custom-package bmon \
    --custom-package htop \
    --custom-package git \
    --custom-package ansible

Last night I tried to build sagitta from 1.4.0-epa1 but it failed due to the following error message:

build/config
Could not retrieve information from git: HEAD is a detached symbolic reference as it points to 'bcac2eb1f9b49cc15ebda65838e5465543dbb9c6'

I looked further into it and found the issue https://github.com/gitpython-developers/GitPython/issues/633. Working in a detached HEAD, when trying to build from a tagged commit for example, we are not exactly on a branch and therefore build-vyos-image fails to determine the active branch. The script should check if the current checked out commit ID is also referenced as a tag and use the tag name instead of the branch name.

I'm happy to contribute the fix.

Cheers
Sebastian

Details

Difficulty level
Easy (less than an hour)
Version
1.4.0-epa1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)