Ripgrep tests failures due to bstr update

  • Open
  • quality assurance status badge
Details
3 participants
  • JOULAUD François
  • John Soo
  • Nicolas Goaziou
Owner
unassigned
Submitted by
John Soo
Severity
normal
J
J
John Soo wrote on 4 Mar 2021 17:40
(address . bug-guix@gnu.org)
8735xax46u.fsf@asu.edu
Hi Guix,

I just talked to burntsushi on github about the failing ripgrep tests.
It looks like the version of bstr we are now using changed the
representation of bstrs and caused us test failures. Changing the
version of bstr used in ripgrep@12.1.1 to 0.2.12 should fix the problem.


Thanks!

John
N
N
Nicolas Goaziou wrote on 4 Mar 2021 21:38
(name . John Soo)(address . jsoo1@asu.edu)(address . 46925@debbugs.gnu.org)
87mtvifycw.fsf@nicolasgoaziou.fr
Hello,

John Soo <jsoo1@asu.edu> writes:

Toggle quote (6 lines)
> I just talked to burntsushi on github about the failing ripgrep tests.
> It looks like the version of bstr we are now using changed the
> representation of bstrs and caused us test failures. Changing the
> version of bstr used in ripgrep@12.1.1 to 0.2.12 should fix the
> problem.

I disabled tests in ripgrep a few hours ago for the same reason. This is
not great, but I couldn't find another solution. In particular,
replacing rust-bstr-0.2 with a special rust-bstr-0.2.12 did not work
because regular rust-bstr-0.2 is still used as a transitive dependency.

Do you think of a better way to solve this?

Regards,
--
Nicolas Goaziou
J
J
JOULAUD François wrote on 8 Mar 2021 17:22
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
20210308161856.rme6tdhbbr44zdev@fjo-extia-HPdeb.example.avalenn.eu
Hello,

On Thu, Mar 04, 2021 at 09:38:39PM +0100, Nicolas Goaziou wrote:
Toggle quote (15 lines)
> John Soo <jsoo1@asu.edu> writes:
>
> > I just talked to burntsushi on github about the failing ripgrep tests.
> > It looks like the version of bstr we are now using changed the
> > representation of bstrs and caused us test failures. Changing the
> > version of bstr used in ripgrep@12.1.1 to 0.2.12 should fix the
> > problem.
>
> I disabled tests in ripgrep a few hours ago for the same reason. This is
> not great, but I couldn't find another solution. In particular,
> replacing rust-bstr-0.2 with a special rust-bstr-0.2.12 did not work
> because regular rust-bstr-0.2 is still used as a transitive dependency.
>
> Do you think of a better way to solve this?

Two possibilities seems to be possible here.

Upgrade rust-bstr-0.2 to be 0.2.12, possibly only upgrading needed
dependent packages.

Patch new ripgrep to understand the old bstr debug format in its tests.
This patch must be transitionnal while waiting for a compatible rust-bstr
package in Guix.

Disabling tests is bad. Disabling tests when we diverge from supported
upstream configuration (in this cas as we don't use recommended version
of deps) is in my opinion even worst.

François
N
N
Nicolas Goaziou wrote on 8 Mar 2021 22:40
(name . JOULAUD François via Bug reports for GNU Guix)(address . bug-guix@gnu.org)
875z21494k.fsf@nicolasgoaziou.fr
Hello,

JOULAUD François via Bug reports for GNU Guix <bug-guix@gnu.org> writes:

Toggle quote (5 lines)
> Two possibilities seems to be possible here.
>
> Upgrade rust-bstr-0.2 to be 0.2.12, possibly only upgrading needed
> dependent packages.

Just to be clear, your are suggesting a downgrade, because currently,
Guix packages bstr 0.2.15. Downgrading is not trivial because bstr
0.2.15 is mandatory for bat 0.18.

We might provide both bstr 0.2.12 and 0.2.15. Note that 11 packages are
requiring bstr. Providing two bstr is only possible if none of those
packages are both among bat and ripgrep dependencies. I didn't check but
I'm not very optimistic.

Toggle quote (3 lines)
> Patch new ripgrep to understand the old bstr debug format in its
> tests.

I'll pass, sorry.

Toggle quote (4 lines)
> Disabling tests is bad. Disabling tests when we diverge from supported
> upstream configuration (in this cas as we don't use recommended version
> of deps) is in my opinion even worst.

I'm not sure this kind of generalization helps here. Even if you may be
right in theory, looking at the number of "#:tests #f" among packages,
disabling tests is probably a necessary evil in practice.

Moreover, AFAICT, this incompatibility does not break functionality in
ripgrep. It just breaks its tests. Disabling them for a while does not
sound so bad, after all. Is it?

Regards,
--
Nicolas Goaziou
J
J
JOULAUD François wrote on 9 Mar 2021 12:34
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
20210309113036.gcbr6w6macnwezpr@fjo-extia-HPdeb.example.avalenn.eu
Hello,

On Mon, Mar 08, 2021 at 10:40:27PM +0100, Nicolas Goaziou wrote:
Toggle quote (8 lines)
> JOULAUD François via Bug reports for GNU Guix <bug-guix@gnu.org> writes:
> > Upgrade rust-bstr-0.2 to be 0.2.12, possibly only upgrading needed
> > dependent packages.
>
> Just to be clear, your are suggesting a downgrade, because currently,
> Guix packages bstr 0.2.15. Downgrading is not trivial because bstr
> 0.2.15 is mandatory for bat 0.18.

My mistake here. I thought upstream ripgrep was using a more recent
version than the packaged one. Downgrade could indeed be more work.

Toggle quote (5 lines)
> We might provide both bstr 0.2.12 and 0.2.15. Note that 11 packages are
> requiring bstr. Providing two bstr is only possible if none of those
> packages are both among bat and ripgrep dependencies. I didn't check but
> I'm not very optimistic.

I'm not either. ;-)

Toggle quote (5 lines)
> > Patch new ripgrep to understand the old bstr debug format in its
> > tests.
>
> I'll pass, sorry.

I understand that. TBH I don't volunteer for the work either even if in
this specific case it seems to be a pretty basic substitution and one
that upstream will need to do anyway when it will upgrade to new bstr.

Toggle quote (8 lines)
> > Disabling tests is bad. Disabling tests when we diverge from supported
> > upstream configuration (in this cas as we don't use recommended version
> > of deps) is in my opinion even worst.
>
> I'm not sure this kind of generalization helps here. Even if you may be
> right in theory, looking at the number of "#:tests #f" among packages,
> disabling tests is probably a necessary evil in practice.

I think it is a necessary evil. I just fear that it could become an
initial reflex when dealing with library incompatibility.

But you're probably right that this is a discussion for an other venue.

Toggle quote (4 lines)
> Moreover, AFAICT, this incompatibility does not break functionality in
> ripgrep. It just breaks its tests. Disabling them for a while does not
> sound so bad, after all. Is it?

Yes, in this specific case it seems to only break tests without breaking
anything else (and I trust upstream explanation on this one). But at the
same time, if it ought to be breaking something else you know don't have
the tests to try to catch it.

Regards,
François
J
J
John Soo wrote on 9 Mar 2021 16:39
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
629092da-8a9b-40ad-b7ec-62ac8ef38c23@Johns-iPhone
Hey Nicolas,

I think the breaking tests do actually indicate breaking functionality in this case since there is a whole test suite dedicated to the bytestring representation. Maybe the fix could be using a later commit in which the later bstr is used. There are definitely unreleased commits in ripgrep.

Thanks!

John
Attachment: file
N
N
Nicolas Goaziou wrote on 10 Mar 2021 14:42
(name . John Soo)(address . jsoo1@asu.edu)
87sg532kib.fsf@nicolasgoaziou.fr
Hello,

John Soo <jsoo1@asu.edu> writes:

Toggle quote (4 lines)
> I think the breaking tests do actually indicate breaking functionality
> in this case since there is a whole test suite dedicated to the
> bytestring representation.

I use ripgrep daily, and I haven't encountered a regression so far. Of
course, this proves nothing.

Toggle quote (4 lines)
> Maybe the fix could be using a later commit
> in which the later bstr is used. There are definitely unreleased
> commits in ripgrep.

Latest ripgrep commit still requires bstr 0.2.12, so this is not an
option either.

Regards,
--
Nicolas Goaziou
J
J
John Soo wrote on 10 Mar 2021 14:44
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
cd769778-0b3b-4b17-a1b2-c404fe2d9e1c@Johns-iPhone
Hey Nicolas,

I think the problem is that the version bound is too loose in cargo.toml upstream. What does the cargo.lock say on the current master? I am beginning to think we need to follow the cargo.lock to resolve dependencies first if it exists.

Thanks,

John
Attachment: file
N
N
Nicolas Goaziou wrote on 10 Mar 2021 15:01
(name . John Soo)(address . jsoo1@asu.edu)
87k0qf2jm4.fsf@nicolasgoaziou.fr
John Soo <jsoo1@asu.edu> writes:

Toggle quote (5 lines)
> I think the problem is that the version bound is too loose in
> cargo.toml upstream. What does the cargo.lock say on the current
> master? I am beginning to think we need to follow the cargo.lock to
> resolve dependencies first if it exists.

It's 0.2.12 in Cargo.toml and 0.2.14 in Cargo.lock.


Regards,
?