Bug 252720

Summary: [GTK][WPE] Wrong WebKit version recorded on the MiniBrowser of the built-products generated on the bots.
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: WebKitGTKAssignee: Carlos Alberto Lopez Perez <clopez>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Carlos Alberto Lopez Perez 2023-02-21 19:31:26 PST
The GTK and WPE nightly bots at https://build.webkit.org/#/builders/30 and https://build.webkit.org/#/builders/2 run once per day generating a build-product for Ubuntu 20.04

Those products are uploaded to https://webkitgtk.org/built-products/x86_64/release/nightly/Ubuntu-20.04/MiniBrowser/ and https://wpewebkit.org/built-products/x86_64/release/nightly/Ubuntu-20.04/MiniBrowser/


The issue is that when you download one of those build-products and you execute "MiniBrowser --version" the version it outputs is from more than 6 months ago.


Check: http://sprunge.us/CIKgiW
   - Version MiniBrowser_gtk_260526@main.zip is downloaded but when running `MiniBrowser --version` it outputs 252782@main


Digging into this the problem is caused by how the script Tools/glib/apply-build-revision-to-files.py obtains the current version of WebKit.
It uses origin/HEAD instead of HEAD and that causes a mistmatch with how the buildbot updates the git repository on the bots.

See how buildbot updates the git repository: https://build.webkit.org/#/builders/30/builds/8422/steps/3/logs/stdio

It basically does:

git fetch -f - https://github.com/WebKit/WebKit.git HEAD --progress
git reset --hard FETCH_HEAD --

instead of doing "git pull" or similar.

So on the bot GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004 is currently happening this on the build checkout

buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git status
On branch main
Your branch is ahead of 'origin/main' by 7808 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git describe HEAD
webkitgtk-2.39.7-966-gf07b7ad2599f
buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git describe FETCH_HEAD
webkitgtk-2.39.7-966-gf07b7ad2599f
buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git describe origin/HEAD
webkitgtk-2.37.1-406-g7a065485d2f1
buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git log -1 --pretty="%H %cD" HEAD
f07b7ad2599f5c00c5e5464508485e879930364d Mon, 20 Feb 2023 21:35:36 -0800
buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git log -1 --pretty="%H %cD" FETCH_HEAD
f07b7ad2599f5c00c5e5464508485e879930364d Mon, 20 Feb 2023 21:35:36 -0800
buildbot@bb-webkit-packaging-ubuntu2004-64:~/webkitgtk/nightly/GTK-Linux-64bit-Release-Packaging-Nightly-Ubuntu2004/build$ git log -1 --pretty="%H %cD" origin/HEAD
7a065485d2f19a25311e51a57b78a5210e3518f4 Mon, 25 Jul 2022 04:45:50 -0700

As you see origin/HEAD doesn't match the current HEAD checkout (is off by more than 6 months) because of the way the bot updates the git repo
Comment 1 Carlos Alberto Lopez Perez 2023-02-21 19:54:57 PST
This is easy to reproduce:

Just checkout any commit of main from the past and compare the difference between HEAD (what is checked out) and origin/HEAD.
Comment 2 Carlos Alberto Lopez Perez 2023-02-21 20:03:05 PST
Pull request: https://github.com/WebKit/WebKit/pull/10491
Comment 3 EWS 2023-02-22 04:37:00 PST
Committed 260673@main (8e68aca2bb75): <https://commits.webkit.org/260673@main>

Reviewed commits have been landed. Closing PR #10491 and removing active labels.