Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] musl: fix strverscmp comparison of digit sequence
@ 2022-12-21 22:46 crtxcr
  2022-12-21 22:52 ` crtxcr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: crtxcr @ 2022-12-21 22:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

There is a new pull request by crtxcr against master on the void-packages repository

https://github.com/crtxcr/void-packages musl_fix_strverscmp
https://github.com/void-linux/void-packages/pull/41228

musl: fix strverscmp comparison of digit sequence
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (n/a)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

The test in https://github.com/void-linux/void-packages/pull/41226 fails due to a bug in musl which causes strverscmp() to behave incorrectly and differently from glibc. 

This PR applies an upstream patch to fix that behavior. After applying the patch, the failed test succeeds 



A patch file from https://github.com/void-linux/void-packages/pull/41228.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl_fix_strverscmp-41228.patch --]
[-- Type: text/x-diff, Size: 2591 bytes --]

From 1495308b5f247d47fdcf58a1152117f8063643fa Mon Sep 17 00:00:00 2001
From: Albert Schwarzkopf <dev-voidlinux@quitesimple.org>
Date: Wed, 21 Dec 2022 23:41:31 +0100
Subject: [PATCH] musl: fix strverscmp comparison of digit sequence

---
 .../patches/fix_strverscmp_comparison.patch   | 40 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/fix_strverscmp_comparison.patch

diff --git a/srcpkgs/musl/patches/fix_strverscmp_comparison.patch b/srcpkgs/musl/patches/fix_strverscmp_comparison.patch
new file mode 100644
index 000000000000..0b7fda952a74
--- /dev/null
+++ b/srcpkgs/musl/patches/fix_strverscmp_comparison.patch
@@ -0,0 +1,40 @@
+From b50eb8c36c20f967bd0ed70c0b0db38a450886ba Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Mon, 7 Nov 2022 22:17:55 -0500
+Subject: fix strverscmp comparison of digit sequence with non-digits
+
+the rule that longest digit sequence not beginning with a zero is
+greater only applies when both sequences being compared are
+non-degenerate. this is spelled out explicitly in the man page, which
+may be deemed authoritative for this nonstandard function: "If one or
+both of these is empty, then return what strcmp(3) would have
+returned..."
+
+we were wrongly treating any sequence of digits not beginning with a
+zero as greater than a non-digit in the other string.
+---
+ src/string/strverscmp.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+(limited to 'src/string/strverscmp.c')
+
+diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c
+index 4daf276d..16c1da22 100644
+--- a/src/string/strverscmp.c
++++ b/src/string/strverscmp.c
+@@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0)
+ 		else if (c!='0') z=0;
+ 	}
+ 
+-	if (l[dp]!='0' && r[dp]!='0') {
+-		/* If we're not looking at a digit sequence that began
+-		 * with a zero, longest digit string is greater. */
++	if (l[dp]-'1'<9U && r[dp]-'1'<9U) {
++		/* If we're looking at non-degenerate digit sequences starting
++		 * with nonzero digits, longest digit string is greater. */
+ 		for (j=i; isdigit(l[j]); j++)
+ 			if (!isdigit(r[j])) return 1;
+ 		if (isdigit(r[j])) return -1;
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index afb33cd868b5..ebac306aef36 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=12
+revision=13
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

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

* Re: musl: fix strverscmp comparison of digit sequence
  2022-12-21 22:46 [PR PATCH] musl: fix strverscmp comparison of digit sequence crtxcr
@ 2022-12-21 22:52 ` crtxcr
  2022-12-22  9:12 ` crtxcr
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: crtxcr @ 2022-12-21 22:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

New comment by crtxcr on void-packages repository

https://github.com/void-linux/void-packages/pull/41228#issuecomment-1362195194

Comment:
CC @Gottox 

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

* Re: musl: fix strverscmp comparison of digit sequence
  2022-12-21 22:46 [PR PATCH] musl: fix strverscmp comparison of digit sequence crtxcr
  2022-12-21 22:52 ` crtxcr
@ 2022-12-22  9:12 ` crtxcr
  2022-12-23 19:39 ` [PR PATCH] [Updated] " crtxcr
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: crtxcr @ 2022-12-22  9:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

New comment by crtxcr on void-packages repository

https://github.com/void-linux/void-packages/pull/41228#issuecomment-1362592636

Comment:
Not sure why "Verify repository state" breaks

```
2022-12-21T23:16:06.6254426Z perl-5.36.0_1 install x86_64-musl https://repo-ci.voidlinux.org/current/musl 74756379 14757854
2022-12-21T23:16:06.6255023Z perl-pcsc-1.4.14_10 install x86_64-musl https://repo-ci.voidlinux.org/current/musl 137135 33670
2022-12-21T23:16:07.0185811Z perl-rrdtool-1.7.2_13: broken, unresolvable shlib `libperl.so.5.36'
```
Doesn't seem it's related to this PR.

However, perl-rrdtool was revbumped in c789421048b07649c9a1d7f7eeb04a7f77a9aadb so dunno what's going on here

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

* Re: [PR PATCH] [Updated] musl: fix strverscmp comparison of digit sequence
  2022-12-21 22:46 [PR PATCH] musl: fix strverscmp comparison of digit sequence crtxcr
  2022-12-21 22:52 ` crtxcr
  2022-12-22  9:12 ` crtxcr
@ 2022-12-23 19:39 ` crtxcr
  2023-03-24  1:54 ` github-actions
  2023-04-08  1:48 ` [PR PATCH] [Closed]: " github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: crtxcr @ 2022-12-23 19:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]

There is an updated pull request by crtxcr against master on the void-packages repository

https://github.com/crtxcr/void-packages musl_fix_strverscmp
https://github.com/void-linux/void-packages/pull/41228

musl: fix strverscmp comparison of digit sequence
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (n/a)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

The test in https://github.com/void-linux/void-packages/pull/41226 fails due to a bug in musl which causes strverscmp() to behave incorrectly and differently from glibc. 

This PR applies an upstream patch to fix that behavior. After applying the patch, the failed test succeeds 



A patch file from https://github.com/void-linux/void-packages/pull/41228.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl_fix_strverscmp-41228.patch --]
[-- Type: text/x-diff, Size: 2593 bytes --]

From 1b9fe5e79276d7f5972b0f4d35606b792b29a22a Mon Sep 17 00:00:00 2001
From: Albert Schwarzkopf <dev-voidlinux@quitesimple.org>
Date: Wed, 21 Dec 2022 23:41:31 +0100
Subject: [PATCH] musl: fix strverscmp() comparison of digit sequence

---
 .../patches/fix_strverscmp_comparison.patch   | 40 +++++++++++++++++++
 srcpkgs/musl/template                         |  2 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/fix_strverscmp_comparison.patch

diff --git a/srcpkgs/musl/patches/fix_strverscmp_comparison.patch b/srcpkgs/musl/patches/fix_strverscmp_comparison.patch
new file mode 100644
index 000000000000..0b7fda952a74
--- /dev/null
+++ b/srcpkgs/musl/patches/fix_strverscmp_comparison.patch
@@ -0,0 +1,40 @@
+From b50eb8c36c20f967bd0ed70c0b0db38a450886ba Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Mon, 7 Nov 2022 22:17:55 -0500
+Subject: fix strverscmp comparison of digit sequence with non-digits
+
+the rule that longest digit sequence not beginning with a zero is
+greater only applies when both sequences being compared are
+non-degenerate. this is spelled out explicitly in the man page, which
+may be deemed authoritative for this nonstandard function: "If one or
+both of these is empty, then return what strcmp(3) would have
+returned..."
+
+we were wrongly treating any sequence of digits not beginning with a
+zero as greater than a non-digit in the other string.
+---
+ src/string/strverscmp.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+(limited to 'src/string/strverscmp.c')
+
+diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c
+index 4daf276d..16c1da22 100644
+--- a/src/string/strverscmp.c
++++ b/src/string/strverscmp.c
+@@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0)
+ 		else if (c!='0') z=0;
+ 	}
+ 
+-	if (l[dp]!='0' && r[dp]!='0') {
+-		/* If we're not looking at a digit sequence that began
+-		 * with a zero, longest digit string is greater. */
++	if (l[dp]-'1'<9U && r[dp]-'1'<9U) {
++		/* If we're looking at non-degenerate digit sequences starting
++		 * with nonzero digits, longest digit string is greater. */
+ 		for (j=i; isdigit(l[j]); j++)
+ 			if (!isdigit(r[j])) return 1;
+ 		if (isdigit(r[j])) return -1;
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index afb33cd868b5..ebac306aef36 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=12
+revision=13
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

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

* Re: musl: fix strverscmp comparison of digit sequence
  2022-12-21 22:46 [PR PATCH] musl: fix strverscmp comparison of digit sequence crtxcr
                   ` (2 preceding siblings ...)
  2022-12-23 19:39 ` [PR PATCH] [Updated] " crtxcr
@ 2023-03-24  1:54 ` github-actions
  2023-04-08  1:48 ` [PR PATCH] [Closed]: " github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2023-03-24  1:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/41228#issuecomment-1482141889

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Closed]: musl: fix strverscmp comparison of digit sequence
  2022-12-21 22:46 [PR PATCH] musl: fix strverscmp comparison of digit sequence crtxcr
                   ` (3 preceding siblings ...)
  2023-03-24  1:54 ` github-actions
@ 2023-04-08  1:48 ` github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2023-04-08  1:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

There's a closed pull request on the void-packages repository

musl: fix strverscmp comparison of digit sequence
https://github.com/void-linux/void-packages/pull/41228

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (n/a)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl

The test in https://github.com/void-linux/void-packages/pull/41226 fails due to a bug in musl which causes strverscmp() to behave incorrectly and differently from glibc. 

This PR applies an upstream patch to fix that behavior. After applying the patch, the failed test succeeds 



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

end of thread, other threads:[~2023-04-08  1:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 22:46 [PR PATCH] musl: fix strverscmp comparison of digit sequence crtxcr
2022-12-21 22:52 ` crtxcr
2022-12-22  9:12 ` crtxcr
2022-12-23 19:39 ` [PR PATCH] [Updated] " crtxcr
2023-03-24  1:54 ` github-actions
2023-04-08  1:48 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).