Problem with "base" release repositories

Jo-Philipp Wich jo at mein.io
Tue Jun 25 08:03:45 PDT 2019


Hi,

some updates.

I managed to track down the root cause to some bad interaction between
buildbot and Git.

When buildbot tries to switch an already cloned repo back from a
previously checked out tag to a branch, it performs this series of commands:

git clean -f -d -x
git fetch -t https://git.openwrt.org/openwrt/openwrt.git $BRANCHNAME
git reset --hard $SHA1
git branch -M $BRANCHNAME

The last command currently fails with:

error: refname refs/heads/HEAD not found
fatal: Branch rename failed

... leaving the Git tree in detached HEAD state neither pointing to a
proper tag, nor a proper branch.

Eventually, during the SDK build, buildroot will call "git rev-parse
--abbrev-ref HEAD" to determine the current branch name which will
simply return "HEAD" in detached head state, which is then subsequently
filtered away, leading to a branchless base URL getting emitted in the
SDKs which ultimately leads to the broken base repos getting built.


It appears that an unconditional "git checkout master" before buildbot's
native Git clone/pull magic will solve the issue for now, I am going to
implement this workaround now and see if the situation improves.

I'll also add further checks to abort future builds early in case the
problem ever resurfaces.

~ Jo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-adm/attachments/20190625/9e291d11/attachment.sig>


More information about the openwrt-adm mailing list