Skip to contentSkip to conversation

gitlab: fall back to commit hash in qemu-setup filename

PATCH Applied Stefan Hajnoczi 5 participants 5 messages Jan 25, 2022 – Jan 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitlab: fall back to commit hash in qemu-setup filename

Personal repos may not have release tags (v6.0.0, v6.1.0, etc) and this causes cross_system_build_job to fail when pretty-printing a unique qemu-setup-*.exe name:

  version="$(git describe --match v[0-9]*)";
             ^^^^^^^^^^ fails ^^^^^^^^^^^
  mv -v qemu-setup*.exe qemu-setup-${version}.exe;

Fall back to the short commit hash if necessary. This fixes CI failures that Greg Kurz and I experienced in our personal repos.

Cc Greg Kurz <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
---
 .gitlab-ci.d/crossbuild-template.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.d/crossbuild-template.yml +1 -1
index 10d22dcf6c..29c3c2b826 100644
@@ -14,7 +14,7 @@
     - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
     - if grep -q "EXESUF=.exe" config-host.mak;
       then make installer;
-      version="$(git describe --match v[0-9]*)";
+      version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
       mv -v qemu-setup*.exe qemu-setup-${version}.exe;
       fi
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Tue, 25 Jan 2022 17:34:54 +0000 Stefan Hajnoczi <[email protected]> wrote:

Personal repos may not have release tags (v6.0.0, v6.1.0, etc) and this causes cross_system_build_job to fail when pretty-printing a unique qemu-setup-*.exe name:

  version="$(git describe --match v[0-9]*)";
             ^^^^^^^^^^ fails ^^^^^^^^^^^
  mv -v qemu-setup*.exe qemu-setup-${version}.exe;
Quoted 8 lines

Fall back to the short commit hash if necessary. This fixes CI failures that Greg Kurz and I experienced in our personal repos.

Cc Greg Kurz <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>

---

Thanks for the green CI !

Quoted 16 lines
 .gitlab-ci.d/crossbuild-template.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.d/crossbuild-template.yml +1 -1
index 10d22dcf6c..29c3c2b826 100644
@@ -14,7 +14,7 @@
     - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
     - if grep -q "EXESUF=.exe" config-host.mak;
       then make installer;
-      version="$(git describe --match v[0-9]*)";
+      version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
       mv -v qemu-setup*.exe qemu-setup-${version}.exe;
       fi
 
Reviewed-by Philippe Mathieu-Daudé on v1 1/1
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 10 lines · Stefan Hajnoczi

Personal repos may not have release tags (v6.0.0, v6.1.0, etc) and this causes cross_system_build_job to fail when pretty-printing a unique qemu-setup-*.exe name:

  version="$(git describe --match v[0-9]*)";
             ^^^^^^^^^^ fails ^^^^^^^^^^^
  mv -v qemu-setup*.exe qemu-setup-${version}.exe;

Fall back to the short commit hash if necessary. This fixes CI failures that Greg Kurz and I experienced in our personal repos.

This answers this thread:
https://lore.kernel.org/qemu-devel/[email protected]/

Quoted 13 lines
Cc Greg Kurz <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
---
 .gitlab-ci.d/crossbuild-template.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.d/crossbuild-template.yml +0 -0
index 10d22dcf6c..29c3c2b826 100644

.gitlab-ci.d/crossbuild-template.yml line 20

Quoted 8 lines
.gitlab-ci.d/crossbuild-template.yml +1 -1
@@ -14,7 +14,7 @@
     - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
     - if grep -q "EXESUF=.exe" config-host.mak;
       then make installer;
-      version="$(git describe --match v[0-9]*)";
+      version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
       mv -v qemu-setup*.exe qemu-setup-${version}.exe;
       fi
 
Reviewed-by on v1 1/1
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 24 lines · Stefan Hajnoczi

Personal repos may not have release tags (v6.0.0, v6.1.0, etc) and this causes cross_system_build_job to fail when pretty-printing a unique qemu-setup-*.exe name:

   version="$(git describe --match v[0-9]*)";
              ^^^^^^^^^^ fails ^^^^^^^^^^^
   mv -v qemu-setup*.exe qemu-setup-${version}.exe;

Fall back to the short commit hash if necessary. This fixes CI failures that Greg Kurz and I experienced in our personal repos.

Cc Greg Kurz <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
---
  .gitlab-ci.d/crossbuild-template.yml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
.gitlab-ci.d/crossbuild-template.yml +0 -0
index 10d22dcf6c..29c3c2b826 100644

.gitlab-ci.d/crossbuild-template.yml line 19

Quoted 7 lines
.gitlab-ci.d/crossbuild-template.yml +1 -1
@@ -14,7 +14,7 @@
      - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
      - if grep -q "EXESUF=.exe" config-host.mak;
        then make installer;
-      version="$(git describe --match v[0-9]*)";
+      version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
        mv -v qemu-setup*.exe qemu-setup-${version}.exe;
        fi
Applied
#4 lore raw
In reply to Stefan Hajnoczi
Quoted 8 lines · Stefan Hajnoczi

Personal repos may not have release tags (v6.0.0, v6.1.0, etc) and this causes cross_system_build_job to fail when pretty-printing a unique qemu-setup-*.exe name:

  version="$(git describe --match v[0-9]*)";
             ^^^^^^^^^^ fails ^^^^^^^^^^^
  mv -v qemu-setup*.exe qemu-setup-${version}.exe;
Quoted 7 lines

Fall back to the short commit hash if necessary. This fixes CI failures that Greg Kurz and I experienced in our personal repos.

Cc Greg Kurz <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>

Queued to update-plugins-next-280122, thanks.

Signature · 1 line
Alex Bennée