All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
@ 2021-09-01 14:52 Philippe Mathieu-Daudé
  2021-09-01 14:57 ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-09-01 14:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Eric Blake, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée,
	Cédric Le Goater

Properly escape git-describe 'match' pattern to avoid (MinGW):

  $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
    version="$(git describe --match v[0-9]*)";
    mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
  fatal: No names found, cannot describe anything.
  ERROR: Job failed: exit code 1

Reported-by: Cédric Le Goater <clg@kaod.org>
Fixes: 8619b5ddb56 ("ci: build & store windows installer")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 .gitlab-ci.d/crossbuild-template.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
index 10d22dcf6c1..62d33e6661d 100644
--- a/.gitlab-ci.d/crossbuild-template.yml
+++ b/.gitlab-ci.d/crossbuild-template.yml
@@ -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]*')";
       mv -v qemu-setup*.exe qemu-setup-${version}.exe;
       fi
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 14:52 [PATCH] gitlab: Escape git-describe match pattern on Windows hosts Philippe Mathieu-Daudé
@ 2021-09-01 14:57 ` Daniel P. Berrangé
  2021-09-01 15:17   ` Peter Maydell
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-09-01 14:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, Alex Bennée, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Eric Blake,
	Cédric Le Goater

On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
> Properly escape git-describe 'match' pattern to avoid (MinGW):
> 
>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
>     version="$(git describe --match v[0-9]*)";
>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
>   fatal: No names found, cannot describe anything.
>   ERROR: Job failed: exit code 1
> 
> Reported-by: Cédric Le Goater <clg@kaod.org>
> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
> index 10d22dcf6c1..62d33e6661d 100644
> --- a/.gitlab-ci.d/crossbuild-template.yml
> +++ b/.gitlab-ci.d/crossbuild-template.yml
> @@ -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]*')";

Do you have a pointer to a pipeline showing this fix works ?

It is a bit strange to me. AFAICT, the only difference would
be if the unquoted  v[0-9]*  matched a filename in the
current directory, but that doesn't seem like it is the
case here.

Are you sure this isn't just caused by the setting

  container-cross.yml:    GIT_DEPTH: 1

ie we don't have the history depth needed to find any of the
historic git tags.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 14:57 ` Daniel P. Berrangé
@ 2021-09-01 15:17   ` Peter Maydell
  2021-09-01 15:21     ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Maydell @ 2021-09-01 15:17 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Thomas Huth, Philippe Mathieu-Daudé,
	QEMU Developers, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée, Eric Blake,
	Cédric Le Goater

On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
> > Properly escape git-describe 'match' pattern to avoid (MinGW):
> >
> >   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
> >     version="$(git describe --match v[0-9]*)";
> >     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
> >   fatal: No names found, cannot describe anything.
> >   ERROR: Job failed: exit code 1
> >
> > Reported-by: Cédric Le Goater <clg@kaod.org>
> > Fixes: 8619b5ddb56 ("ci: build & store windows installer")
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> >  .gitlab-ci.d/crossbuild-template.yml | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
> > index 10d22dcf6c1..62d33e6661d 100644
> > --- a/.gitlab-ci.d/crossbuild-template.yml
> > +++ b/.gitlab-ci.d/crossbuild-template.yml
> > @@ -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]*')";
>
> Do you have a pointer to a pipeline showing this fix works ?
>
> It is a bit strange to me. AFAICT, the only difference would
> be if the unquoted  v[0-9]*  matched a filename in the
> current directory, but that doesn't seem like it is the
> case here.

We should quote the glob pattern anyway, to avoid possible
really confusing behaviour in the future if such a file ever
does turn up...

-- PMM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 15:17   ` Peter Maydell
@ 2021-09-01 15:21     ` Daniel P. Berrangé
  2021-09-01 15:35       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-09-01 15:21 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Thomas Huth, Philippe Mathieu-Daudé,
	QEMU Developers, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée, Eric Blake,
	Cédric Le Goater

On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
> > > Properly escape git-describe 'match' pattern to avoid (MinGW):
> > >
> > >   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
> > >     version="$(git describe --match v[0-9]*)";
> > >     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
> > >   fatal: No names found, cannot describe anything.
> > >   ERROR: Job failed: exit code 1
> > >
> > > Reported-by: Cédric Le Goater <clg@kaod.org>
> > > Fixes: 8619b5ddb56 ("ci: build & store windows installer")
> > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > > ---
> > >  .gitlab-ci.d/crossbuild-template.yml | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
> > > index 10d22dcf6c1..62d33e6661d 100644
> > > --- a/.gitlab-ci.d/crossbuild-template.yml
> > > +++ b/.gitlab-ci.d/crossbuild-template.yml
> > > @@ -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]*')";
> >
> > Do you have a pointer to a pipeline showing this fix works ?
> >
> > It is a bit strange to me. AFAICT, the only difference would
> > be if the unquoted  v[0-9]*  matched a filename in the
> > current directory, but that doesn't seem like it is the
> > case here.
> 
> We should quote the glob pattern anyway, to avoid possible
> really confusing behaviour in the future if such a file ever
> does turn up...

Sure, I'm happy to see the thing quoted regardless, just want to
make sure the commit behaviour matches the commit message.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 15:21     ` Daniel P. Berrangé
@ 2021-09-01 15:35       ` Philippe Mathieu-Daudé
  2021-09-01 15:53         ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-09-01 15:35 UTC (permalink / raw)
  To: Daniel P. Berrangé, Peter Maydell, Cédric Le Goater
  Cc: Thomas Huth, Eric Blake, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée

On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
> On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
>> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>
>>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
>>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
>>>>
>>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
>>>>     version="$(git describe --match v[0-9]*)";
>>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
>>>>   fatal: No names found, cannot describe anything.
>>>>   ERROR: Job failed: exit code 1
>>>>
>>>> Reported-by: Cédric Le Goater <clg@kaod.org>
>>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>> ---
>>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
>>>> index 10d22dcf6c1..62d33e6661d 100644
>>>> --- a/.gitlab-ci.d/crossbuild-template.yml
>>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
>>>> @@ -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]*')";
>>>
>>> Do you have a pointer to a pipeline showing this fix works ?

It worked on my fork but I have some versioned tag:
https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025

Cédric, do you mind testing on your fork?

>>>
>>> It is a bit strange to me. AFAICT, the only difference would
>>> be if the unquoted  v[0-9]*  matched a filename in the
>>> current directory, but that doesn't seem like it is the
>>> case here.
>>
>> We should quote the glob pattern anyway, to avoid possible
>> really confusing behaviour in the future if such a file ever
>> does turn up...
> 
> Sure, I'm happy to see the thing quoted regardless, just want to
> make sure the commit behaviour matches the commit message.
> 
> 
> Regards,
> Daniel
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 15:35       ` Philippe Mathieu-Daudé
@ 2021-09-01 15:53         ` Daniel P. Berrangé
  2021-09-01 16:24           ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-09-01 15:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Eric Blake, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Cédric Le Goater, Alex Bennée,
	Gerd Hoffmann

On Wed, Sep 01, 2021 at 05:35:42PM +0200, Philippe Mathieu-Daudé wrote:
> On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
> > On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
> >> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >>>
> >>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
> >>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
> >>>>
> >>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
> >>>>     version="$(git describe --match v[0-9]*)";
> >>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
> >>>>   fatal: No names found, cannot describe anything.
> >>>>   ERROR: Job failed: exit code 1
> >>>>
> >>>> Reported-by: Cédric Le Goater <clg@kaod.org>
> >>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
> >>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
> >>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >>>> ---
> >>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
> >>>> index 10d22dcf6c1..62d33e6661d 100644
> >>>> --- a/.gitlab-ci.d/crossbuild-template.yml
> >>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
> >>>> @@ -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]*')";
> >>>
> >>> Do you have a pointer to a pipeline showing this fix works ?
> 
> It worked on my fork but I have some versioned tag:
> https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025

I can reproduce the error msg if I do a shallow clone with no history

$ cd qemu
$ git describe --match v[0-9]*
v6.1.0-171-g5e8c1a0c90

$ cd ..
$ git clone --depth 1 https://gitlab.com/qemu-project/qemu/ qemu.new
$ cd qemu.new/
$ git describe --match v[0-9]*
fatal: No names found, cannot describe anything.

but the odd thing is that I think we should have been hitting the
problem frequently if it was related to git depth. This job passes
fine in current CI pipelines and my own fork.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 15:53         ` Daniel P. Berrangé
@ 2021-09-01 16:24           ` Philippe Mathieu-Daudé
  2021-09-01 16:27             ` Cédric Le Goater
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-09-01 16:24 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Eric Blake, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Cédric Le Goater, Alex Bennée,
	Gerd Hoffmann

On 9/1/21 5:53 PM, Daniel P. Berrangé wrote:
> On Wed, Sep 01, 2021 at 05:35:42PM +0200, Philippe Mathieu-Daudé wrote:
>> On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
>>> On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
>>>> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>>>
>>>>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
>>>>>>
>>>>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
>>>>>>     version="$(git describe --match v[0-9]*)";
>>>>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
>>>>>>   fatal: No names found, cannot describe anything.
>>>>>>   ERROR: Job failed: exit code 1
>>>>>>
>>>>>> Reported-by: Cédric Le Goater <clg@kaod.org>
>>>>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
>>>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>>>> ---
>>>>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
>>>>>> index 10d22dcf6c1..62d33e6661d 100644
>>>>>> --- a/.gitlab-ci.d/crossbuild-template.yml
>>>>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
>>>>>> @@ -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]*')";
>>>>>
>>>>> Do you have a pointer to a pipeline showing this fix works ?
>>
>> It worked on my fork but I have some versioned tag:
>> https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025
> 
> I can reproduce the error msg if I do a shallow clone with no history
> 
> $ cd qemu
> $ git describe --match v[0-9]*
> v6.1.0-171-g5e8c1a0c90
> 
> $ cd ..
> $ git clone --depth 1 https://gitlab.com/qemu-project/qemu/ qemu.new
> $ cd qemu.new/
> $ git describe --match v[0-9]*
> fatal: No names found, cannot describe anything.
> 
> but the odd thing is that I think we should have been hitting the
> problem frequently if it was related to git depth. This job passes
> fine in current CI pipelines and my own fork.

FYI it didn't work out on Cédric fork:
https://gitlab.com/legoater/qemu/-/jobs/1553492082



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 16:24           ` Philippe Mathieu-Daudé
@ 2021-09-01 16:27             ` Cédric Le Goater
  2021-09-01 16:40               ` Philippe Mathieu-Daudé
  2021-09-01 16:47               ` Daniel P. Berrangé
  0 siblings, 2 replies; 13+ messages in thread
From: Cédric Le Goater @ 2021-09-01 16:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Eric Blake, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée

On 9/1/21 6:24 PM, Philippe Mathieu-Daudé wrote:
> On 9/1/21 5:53 PM, Daniel P. Berrangé wrote:
>> On Wed, Sep 01, 2021 at 05:35:42PM +0200, Philippe Mathieu-Daudé wrote:
>>> On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
>>>> On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
>>>>> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>>>>
>>>>>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
>>>>>>>
>>>>>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
>>>>>>>     version="$(git describe --match v[0-9]*)";
>>>>>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
>>>>>>>   fatal: No names found, cannot describe anything.
>>>>>>>   ERROR: Job failed: exit code 1
>>>>>>>
>>>>>>> Reported-by: Cédric Le Goater <clg@kaod.org>
>>>>>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
>>>>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
>>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>>>>> ---
>>>>>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
>>>>>>> index 10d22dcf6c1..62d33e6661d 100644
>>>>>>> --- a/.gitlab-ci.d/crossbuild-template.yml
>>>>>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
>>>>>>> @@ -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]*')";
>>>>>>
>>>>>> Do you have a pointer to a pipeline showing this fix works ?
>>>
>>> It worked on my fork but I have some versioned tag:
>>> https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025
>>
>> I can reproduce the error msg if I do a shallow clone with no history
>>
>> $ cd qemu
>> $ git describe --match v[0-9]*
>> v6.1.0-171-g5e8c1a0c90
>>
>> $ cd ..
>> $ git clone --depth 1 https://gitlab.com/qemu-project/qemu/ qemu.new
>> $ cd qemu.new/
>> $ git describe --match v[0-9]*
>> fatal: No names found, cannot describe anything.
>>
>> but the odd thing is that I think we should have been hitting the
>> problem frequently if it was related to git depth. This job passes
>> fine in current CI pipelines and my own fork.
> 
> FYI it didn't work out on Cédric fork:
> https://gitlab.com/legoater/qemu/-/jobs/1553492082
> 

Indeed.

Thanks Phil,

C.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 16:27             ` Cédric Le Goater
@ 2021-09-01 16:40               ` Philippe Mathieu-Daudé
  2021-09-01 16:47               ` Daniel P. Berrangé
  1 sibling, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-09-01 16:40 UTC (permalink / raw)
  To: Cédric Le Goater, Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Eric Blake, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée

On 9/1/21 6:27 PM, Cédric Le Goater wrote:
> On 9/1/21 6:24 PM, Philippe Mathieu-Daudé wrote:
>> On 9/1/21 5:53 PM, Daniel P. Berrangé wrote:
>>> On Wed, Sep 01, 2021 at 05:35:42PM +0200, Philippe Mathieu-Daudé wrote:
>>>> On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
>>>>> On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
>>>>>> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>>>>>
>>>>>>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
>>>>>>>>
>>>>>>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
>>>>>>>>     version="$(git describe --match v[0-9]*)";
>>>>>>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
>>>>>>>>   fatal: No names found, cannot describe anything.
>>>>>>>>   ERROR: Job failed: exit code 1
>>>>>>>>
>>>>>>>> Reported-by: Cédric Le Goater <clg@kaod.org>
>>>>>>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
>>>>>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
>>>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>>>>>> ---
>>>>>>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
>>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>>
>>>>>>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
>>>>>>>> index 10d22dcf6c1..62d33e6661d 100644
>>>>>>>> --- a/.gitlab-ci.d/crossbuild-template.yml
>>>>>>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
>>>>>>>> @@ -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]*')";
>>>>>>>
>>>>>>> Do you have a pointer to a pipeline showing this fix works ?
>>>>
>>>> It worked on my fork but I have some versioned tag:
>>>> https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025
>>>
>>> I can reproduce the error msg if I do a shallow clone with no history
>>>
>>> $ cd qemu
>>> $ git describe --match v[0-9]*
>>> v6.1.0-171-g5e8c1a0c90
>>>
>>> $ cd ..
>>> $ git clone --depth 1 https://gitlab.com/qemu-project/qemu/ qemu.new
>>> $ cd qemu.new/
>>> $ git describe --match v[0-9]*
>>> fatal: No names found, cannot describe anything.
>>>
>>> but the odd thing is that I think we should have been hitting the
>>> problem frequently if it was related to git depth. This job passes
>>> fine in current CI pipelines and my own fork.

What about not using the best tag if no versioned tag available?
(no default string in case user wants to download and archive artifacts)

-- >8 --
@@ -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 --tags --match 'v[0-9]*' 2>/dev/null ||
git describe --abbrev)";
       mv -v qemu-setup*.exe qemu-setup-${version}.exe;
       fi
---

>> FYI it didn't work out on Cédric fork:
>> https://gitlab.com/legoater/qemu/-/jobs/1553492082
>>
> 
> Indeed.
> 
> Thanks Phil,
> 
> C.
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 16:27             ` Cédric Le Goater
  2021-09-01 16:40               ` Philippe Mathieu-Daudé
@ 2021-09-01 16:47               ` Daniel P. Berrangé
  2021-09-01 16:51                 ` Philippe Mathieu-Daudé
  2021-10-05  8:40                 ` Cédric Le Goater
  1 sibling, 2 replies; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-09-01 16:47 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Peter Maydell, Thomas Huth, Philippe Mathieu-Daudé,
	QEMU Developers, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée, Eric Blake

On Wed, Sep 01, 2021 at 06:27:37PM +0200, Cédric Le Goater wrote:
> On 9/1/21 6:24 PM, Philippe Mathieu-Daudé wrote:
> > On 9/1/21 5:53 PM, Daniel P. Berrangé wrote:
> >> On Wed, Sep 01, 2021 at 05:35:42PM +0200, Philippe Mathieu-Daudé wrote:
> >>> On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
> >>>> On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
> >>>>> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >>>>>>
> >>>>>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
> >>>>>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
> >>>>>>>
> >>>>>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
> >>>>>>>     version="$(git describe --match v[0-9]*)";
> >>>>>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
> >>>>>>>   fatal: No names found, cannot describe anything.
> >>>>>>>   ERROR: Job failed: exit code 1
> >>>>>>>
> >>>>>>> Reported-by: Cédric Le Goater <clg@kaod.org>
> >>>>>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
> >>>>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
> >>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >>>>>>> ---
> >>>>>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
> >>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>>>
> >>>>>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
> >>>>>>> index 10d22dcf6c1..62d33e6661d 100644
> >>>>>>> --- a/.gitlab-ci.d/crossbuild-template.yml
> >>>>>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
> >>>>>>> @@ -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]*')";
> >>>>>>
> >>>>>> Do you have a pointer to a pipeline showing this fix works ?
> >>>
> >>> It worked on my fork but I have some versioned tag:
> >>> https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025
> >>
> >> I can reproduce the error msg if I do a shallow clone with no history
> >>
> >> $ cd qemu
> >> $ git describe --match v[0-9]*
> >> v6.1.0-171-g5e8c1a0c90
> >>
> >> $ cd ..
> >> $ git clone --depth 1 https://gitlab.com/qemu-project/qemu/ qemu.new
> >> $ cd qemu.new/
> >> $ git describe --match v[0-9]*
> >> fatal: No names found, cannot describe anything.
> >>
> >> but the odd thing is that I think we should have been hitting the
> >> problem frequently if it was related to git depth. This job passes
> >> fine in current CI pipelines and my own fork.
> > 
> > FYI it didn't work out on Cédric fork:
> > https://gitlab.com/legoater/qemu/-/jobs/1553492082
> > 
> 
> Indeed.

I'm curious if you go to

  https://gitlab.com/legoater/qemu/-/settings/ci_cd

and expand "General pipelines", what value is set for the

  "Git shallow clone"

setting.  In my fork it is 0 which means unlimited depth, but in
gitlab docs I see reference to repos getting this set to 50
since a particular gitlab release.

Likewise same question for Phil in ?

  https://gitlab.com/philmd_rh/qemu/-/settings/ci_cd

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 16:47               ` Daniel P. Berrangé
@ 2021-09-01 16:51                 ` Philippe Mathieu-Daudé
  2021-10-05  8:40                 ` Cédric Le Goater
  1 sibling, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-09-01 16:51 UTC (permalink / raw)
  To: Daniel P. Berrangé, Cédric Le Goater
  Cc: Peter Maydell, Thomas Huth, Eric Blake, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée

On 9/1/21 6:47 PM, Daniel P. Berrangé wrote:
> On Wed, Sep 01, 2021 at 06:27:37PM +0200, Cédric Le Goater wrote:
>> On 9/1/21 6:24 PM, Philippe Mathieu-Daudé wrote:
>>> On 9/1/21 5:53 PM, Daniel P. Berrangé wrote:
>>>> On Wed, Sep 01, 2021 at 05:35:42PM +0200, Philippe Mathieu-Daudé wrote:
>>>>> On 9/1/21 5:21 PM, Daniel P. Berrangé wrote:
>>>>>> On Wed, Sep 01, 2021 at 04:17:48PM +0100, Peter Maydell wrote:
>>>>>>> On Wed, 1 Sept 2021 at 15:59, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>>>>>>
>>>>>>>> On Wed, Sep 01, 2021 at 04:52:29PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>>>>> Properly escape git-describe 'match' pattern to avoid (MinGW):
>>>>>>>>>
>>>>>>>>>   $ if grep -q "EXESUF=.exe" config-host.mak; then make installer;
>>>>>>>>>     version="$(git describe --match v[0-9]*)";
>>>>>>>>>     mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi
>>>>>>>>>   fatal: No names found, cannot describe anything.
>>>>>>>>>   ERROR: Job failed: exit code 1
>>>>>>>>>
>>>>>>>>> Reported-by: Cédric Le Goater <clg@kaod.org>
>>>>>>>>> Fixes: 8619b5ddb56 ("ci: build & store windows installer")
>>>>>>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/591
>>>>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>>>>>>> ---
>>>>>>>>>  .gitlab-ci.d/crossbuild-template.yml | 2 +-
>>>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>>>
>>>>>>>>> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
>>>>>>>>> index 10d22dcf6c1..62d33e6661d 100644
>>>>>>>>> --- a/.gitlab-ci.d/crossbuild-template.yml
>>>>>>>>> +++ b/.gitlab-ci.d/crossbuild-template.yml
>>>>>>>>> @@ -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]*')";
>>>>>>>>
>>>>>>>> Do you have a pointer to a pipeline showing this fix works ?
>>>>>
>>>>> It worked on my fork but I have some versioned tag:
>>>>> https://gitlab.com/philmd_rh/qemu/-/jobs/1553450025
>>>>
>>>> I can reproduce the error msg if I do a shallow clone with no history
>>>>
>>>> $ cd qemu
>>>> $ git describe --match v[0-9]*
>>>> v6.1.0-171-g5e8c1a0c90
>>>>
>>>> $ cd ..
>>>> $ git clone --depth 1 https://gitlab.com/qemu-project/qemu/ qemu.new
>>>> $ cd qemu.new/
>>>> $ git describe --match v[0-9]*
>>>> fatal: No names found, cannot describe anything.
>>>>
>>>> but the odd thing is that I think we should have been hitting the
>>>> problem frequently if it was related to git depth. This job passes
>>>> fine in current CI pipelines and my own fork.
>>>
>>> FYI it didn't work out on Cédric fork:
>>> https://gitlab.com/legoater/qemu/-/jobs/1553492082
>>>
>>
>> Indeed.
> 
> I'm curious if you go to
> 
>   https://gitlab.com/legoater/qemu/-/settings/ci_cd
> 
> and expand "General pipelines", what value is set for the
> 
>   "Git shallow clone"
> 
> setting.  In my fork it is 0 which means unlimited depth, but in
> gitlab docs I see reference to repos getting this set to 50
> since a particular gitlab release.
> 
> Likewise same question for Phil in ?
> 
>   https://gitlab.com/philmd_rh/qemu/-/settings/ci_cd

0 too.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-09-01 16:47               ` Daniel P. Berrangé
  2021-09-01 16:51                 ` Philippe Mathieu-Daudé
@ 2021-10-05  8:40                 ` Cédric Le Goater
  2021-10-05  8:43                   ` Daniel P. Berrangé
  1 sibling, 1 reply; 13+ messages in thread
From: Cédric Le Goater @ 2021-10-05  8:40 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Peter Maydell, Thomas Huth, Philippe Mathieu-Daudé,
	QEMU Developers, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée, Eric Blake

> I'm curious if you go to
> 
>    https://gitlab.com/legoater/qemu/-/settings/ci_cd
> 
> and expand "General pipelines", what value is set for the
> 
>    "Git shallow clone"
> 
> setting.  In my fork it is 0 which means unlimited depth, but in
> gitlab docs I see reference to repos getting this set to 50
> since a particular gitlab release.

Sorry for the late reply.

Setting the value to 0 fixed the windows build on gitlab.

Thanks,

C.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] gitlab: Escape git-describe match pattern on Windows hosts
  2021-10-05  8:40                 ` Cédric Le Goater
@ 2021-10-05  8:43                   ` Daniel P. Berrangé
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel P. Berrangé @ 2021-10-05  8:43 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Peter Maydell, Thomas Huth, Philippe Mathieu-Daudé,
	QEMU Developers, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Gerd Hoffmann, Alex Bennée, Eric Blake

On Tue, Oct 05, 2021 at 10:40:00AM +0200, Cédric Le Goater wrote:
> > I'm curious if you go to
> > 
> >    https://gitlab.com/legoater/qemu/-/settings/ci_cd
> > 
> > and expand "General pipelines", what value is set for the
> > 
> >    "Git shallow clone"
> > 
> > setting.  In my fork it is 0 which means unlimited depth, but in
> > gitlab docs I see reference to repos getting this set to 50
> > since a particular gitlab release.
> 
> Sorry for the late reply.
> 
> Setting the value to 0 fixed the windows build on gitlab.

Ok, so we've got two options

 - Change the code so it has sane fallback if the tags are all missing

 - Set GIT_DEPTH in the affected jobs to a value that is larger than
   the maximum number of commits we expect in the course of a single
   dev cycle, plus 20% grace on top, so that we're guaranteed enough
   history to describe one tag.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-10-05  8:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 14:52 [PATCH] gitlab: Escape git-describe match pattern on Windows hosts Philippe Mathieu-Daudé
2021-09-01 14:57 ` Daniel P. Berrangé
2021-09-01 15:17   ` Peter Maydell
2021-09-01 15:21     ` Daniel P. Berrangé
2021-09-01 15:35       ` Philippe Mathieu-Daudé
2021-09-01 15:53         ` Daniel P. Berrangé
2021-09-01 16:24           ` Philippe Mathieu-Daudé
2021-09-01 16:27             ` Cédric Le Goater
2021-09-01 16:40               ` Philippe Mathieu-Daudé
2021-09-01 16:47               ` Daniel P. Berrangé
2021-09-01 16:51                 ` Philippe Mathieu-Daudé
2021-10-05  8:40                 ` Cédric Le Goater
2021-10-05  8:43                   ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.