Skip to content
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

phase1: builds on clean workers always fail on gitverify step #5

Open
ynezz opened this issue May 16, 2023 · 0 comments
Open

phase1: builds on clean workers always fail on gitverify step #5

ynezz opened this issue May 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ynezz
Copy link
Member

ynezz commented May 16, 2023

Following build step utilizing Git() stock buildbot build step when performed on a clean worker:

factory.addStep(Git(
		name = "git",
		repourl = repo_url,
		mode = 'full',
		method = 'fresh',
		locks = NetLockDl,
		haltOnFailure = True,
	))

leaves the cloned Git repository in the detached HEAD state and consecutive gitverify check thus always fail:

git rev-parse --abbrev-ref HEAD | grep -vxqF HEAD || git show-ref --tags --dereference 2>/dev/null | sed -ne "/^$(git rev-parse HEAD) / { s|^.*/||; s|\\^.*||; p }" | grep -qE "^v[0-9][0-9]\\."

So every first build on ephemeral VPS results in a failure, each second build then goes fine as Git() checkouts the branch correctly.

Output of the Git() step on a fresh worker, 1st build (BAD case)

git --version
 in dir /builder/master_bcm47xx_mips74k/build (timeout 1200 secs)
...
git version 2.30.2
program finished with exit code 0
...
stat: No such file or directory: /builder/master_bcm47xx_mips74k/build/.buildbot-patched
program finished with exit code 0
git clone --branch master https://git.openwrt.org/openwrt/openwrt.git . --progress
 in dir /builder/master_bcm47xx_mips74k/build (timeout 1200 secs)
...
program finished with exit code 0
elapsedTime=17.474384
git checkout -f 466be0612aaed4034e15095b9fc63ce4cd99b87a
 in dir /builder/master_bcm47xx_mips74k/build (timeout 1200 secs)
...
Note: switching to '466be0612aaed4034e15095b9fc63ce4cd99b87a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
...
HEAD is now at 466be0612a e2fsprogs: fix compilation with musl 1.2.4
program finished with exit code 0
elapsedTime=0.453183
git rev-parse HEAD
...
466be0612aaed4034e15095b9fc63ce4cd99b87a
program finished with exit code 0
elapsedTime=0.008105

Output of the Git() step on a fresh worker, 2nd build (GOOD case)

git --version
 in dir /builder/master_malta_be/build (timeout 1200 secs)
...
git version 2.30.2
program finished with exit code 0
elapsedTime=0.007659
program finished with exit code 2
stat: No such file or directory: /builder/master_malta_be/build/.buildbot-patched
program finished with exit code 0
git clean -f -f -d -x
 in dir /builder/master_malta_be/build (timeout 1200 secs)
...
program finished with exit code 0
elapsedTime=0.048432
git cat-file -e 466be0612aaed4034e15095b9fc63ce4cd99b87a
 in dir /builder/master_malta_be/build (timeout 1200 secs)
...
program finished with exit code 0
elapsedTime=0.007559
git checkout -f 466be0612aaed4034e15095b9fc63ce4cd99b87a
 in dir /builder/master_malta_be/build (timeout 1200 secs)
...
HEAD is now at 466be0612a e2fsprogs: fix compilation with musl 1.2.4
program finished with exit code 0
elapsedTime=0.049798
git checkout -B master
 in dir /builder/master_malta_be/build (timeout 1200 secs)
...
Switched to and reset branch 'master'
Your branch is up to date with 'origin/master'.
program finished with exit code 0
elapsedTime=0.052273
git rev-parse HEAD
...
466be0612aaed4034e15095b9fc63ce4cd99b87a
program finished with exit code 0
elapsedTime=0.007634
@ynezz ynezz added the bug Something isn't working label May 16, 2023
ynezz added a commit that referenced this issue May 17, 2023
Currently every 1st build on ephemeral build worker results in the
failure of the `gitverify` build step as the stock buildbot Git() build
step for some reasons just clones the Git repository into detached HEAD
state.

On the 2nd build using the same build worker Git() checkouts the branch
and thus makes `gitverify` step happy and the builds then continues
normally.

This needs to be fixed properly, either by adjusting the `gitverify`
check or adding suitable `mode` into Git() build step, but this needs
more time and testing.

So for now, lets simply workaround that issue by running Git() step two
times.

References: #5
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant