Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: explicitly disallow pattern on build deps
@ 2022-08-08 18:22 Chocimier
  2022-08-08 18:58 ` classabbyamp
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Chocimier @ 2022-08-08 18:22 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org hostmakedepends-pattern
https://github.com/void-linux/void-packages/pull/38540

xbps-src: explicitly disallow pattern on build deps
It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

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

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

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-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, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

From 420a8ca9137fa8e3a3cadb757d0d03b0b03e670a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 8 Aug 2022 20:11:02 +0200
Subject: [PATCH] xbps-src: explicitly disallow pattern on build deps

It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.
---
 common/xbps-src/shutils/build_dependencies.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bc6934fbda1f 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -160,6 +160,8 @@ install_pkg_deps() {
             if [ -f $XBPS_SRCPKGDIR/$f/template ]; then
                 templates+=" $f"
                 continue
+            elif [ "${f/>/}" != "${f}" ] || [ "${f/</}" != "${f}" ]; then
+                msg_error "$pkgver: version pattern in host dependency '$f' is invalid, template version is used always\n"
             fi
             local _repourl=$($XBPS_QUERY_CMD -R -prepository "$f" 2>/dev/null)
             if [ "$_repourl" ]; then
@@ -210,6 +212,8 @@ install_pkg_deps() {
             if [ -f $XBPS_SRCPKGDIR/$f/template ]; then
                 templates+=" $f"
                 continue
+            elif [ "${f/>/}" != "${f}" ] || [ "${f/</}" != "${f}" ]; then
+                msg_error "$pkgver: version pattern in check dependency '$f' is invalid, template version is used always\n"
             fi
             local _repourl=$($XBPS_QUERY_CMD -R -prepository "$f" 2>/dev/null)
             if [ "$_repourl" ]; then
@@ -260,6 +264,8 @@ install_pkg_deps() {
             if [ -f $XBPS_SRCPKGDIR/$f/template ]; then
                 templates+=" $f"
                 continue
+            elif [ "${f/>/}" != "${f}" ] || [ "${f/</}" != "${f}" ]; then
+                msg_error "$pkgver: version pattern in build dependency '$f' is invalid, template version is used always\n"
             fi
             local _repourl=$($XBPS_QUERY_XCMD -R -prepository "$f" 2>/dev/null)
             if [ "$_repourl" ]; then

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
@ 2022-08-08 18:58 ` classabbyamp
  2022-08-08 20:29 ` Chocimier
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: classabbyamp @ 2022-08-08 18:58 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1208492619

Comment:
what about the exact version case? (`foo-1.2_3`)

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
  2022-08-08 18:58 ` classabbyamp
@ 2022-08-08 20:29 ` Chocimier
  2022-08-08 23:12 ` paper42
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2022-08-08 20:29 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1208578735

Comment:
it isn't as easy to tell what is an exact version, and calling xbps-uhelper is costly

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
  2022-08-08 18:58 ` classabbyamp
  2022-08-08 20:29 ` Chocimier
@ 2022-08-08 23:12 ` paper42
  2022-08-10 15:59 ` [PR PATCH] [Updated] " Chocimier
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: paper42 @ 2022-08-08 23:12 UTC (permalink / raw)
  To: ml

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

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1208712139

Comment:
Closes #37837

openocd seems to be the only package that currently uses a version restriction in build depends

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

* Re: [PR PATCH] [Updated] xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (2 preceding siblings ...)
  2022-08-08 23:12 ` paper42
@ 2022-08-10 15:59 ` Chocimier
  2022-08-10 16:00 ` Chocimier
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2022-08-10 15:59 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org hostmakedepends-pattern
https://github.com/void-linux/void-packages/pull/38540

xbps-src: explicitly disallow pattern on build deps
It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

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

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

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-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, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

From 420a8ca9137fa8e3a3cadb757d0d03b0b03e670a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 8 Aug 2022 20:11:02 +0200
Subject: [PATCH 1/2] xbps-src: explicitly disallow pattern on build deps

It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.
---
 common/xbps-src/shutils/build_dependencies.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index e4e2210d4e56..bc6934fbda1f 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -160,6 +160,8 @@ install_pkg_deps() {
             if [ -f $XBPS_SRCPKGDIR/$f/template ]; then
                 templates+=" $f"
                 continue
+            elif [ "${f/>/}" != "${f}" ] || [ "${f/</}" != "${f}" ]; then
+                msg_error "$pkgver: version pattern in host dependency '$f' is invalid, template version is used always\n"
             fi
             local _repourl=$($XBPS_QUERY_CMD -R -prepository "$f" 2>/dev/null)
             if [ "$_repourl" ]; then
@@ -210,6 +212,8 @@ install_pkg_deps() {
             if [ -f $XBPS_SRCPKGDIR/$f/template ]; then
                 templates+=" $f"
                 continue
+            elif [ "${f/>/}" != "${f}" ] || [ "${f/</}" != "${f}" ]; then
+                msg_error "$pkgver: version pattern in check dependency '$f' is invalid, template version is used always\n"
             fi
             local _repourl=$($XBPS_QUERY_CMD -R -prepository "$f" 2>/dev/null)
             if [ "$_repourl" ]; then
@@ -260,6 +264,8 @@ install_pkg_deps() {
             if [ -f $XBPS_SRCPKGDIR/$f/template ]; then
                 templates+=" $f"
                 continue
+            elif [ "${f/>/}" != "${f}" ] || [ "${f/</}" != "${f}" ]; then
+                msg_error "$pkgver: version pattern in build dependency '$f' is invalid, template version is used always\n"
             fi
             local _repourl=$($XBPS_QUERY_XCMD -R -prepository "$f" 2>/dev/null)
             if [ "$_repourl" ]; then

From 2f41f99043f085f18105dbb8c5495cf8d7283377 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Wed, 10 Aug 2022 17:58:09 +0200
Subject: [PATCH 2/2] openocd: runtime depend on exact version of jimtcl

build time version requrement is not valid an does not ensure runtime
version change
---
 srcpkgs/openocd/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/openocd/template b/srcpkgs/openocd/template
index d6370930edc1..7889b281c981 100644
--- a/srcpkgs/openocd/template
+++ b/srcpkgs/openocd/template
@@ -1,7 +1,7 @@
 # Template file for 'openocd'
 pkgname=openocd
 version=0.11.0+1
-revision=1
+revision=2
 # update to a commit that has a compatible jimtcl version
 _commit=830d70bfc66ada2a68c73283b9e4fa4770d408ee
 _jimtcl_version=0.81
@@ -42,9 +42,9 @@ configure_args="
  --enable-cmsis-dap-v2
  --disable-internal-libjaylink"
 hostmakedepends="automake pkg-config libtool which"
-makedepends="hidapi-devel libftdi1-devel
- jimtcl-devel>=${_jimtcl_version}_1<=${_jimtcl_version}_9999
+makedepends="hidapi-devel libftdi1-devel jimtcl-devel
  libusb-devel libjaylink-devel capstone-devel"
+depends="jimtcl-devel>=${_jimtcl_version}_1<=${_jimtcl_version}_9999"
 short_desc="Open On-Chip Debugger"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="GPL-2.0-or-later"

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (3 preceding siblings ...)
  2022-08-10 15:59 ` [PR PATCH] [Updated] " Chocimier
@ 2022-08-10 16:00 ` Chocimier
  2022-08-10 16:35 ` Duncaen
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2022-08-10 16:00 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1210912257

Comment:
Moved version restriction of openocd on jimtcl to `depends`.

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (4 preceding siblings ...)
  2022-08-10 16:00 ` Chocimier
@ 2022-08-10 16:35 ` Duncaen
  2022-11-10  2:13 ` github-actions
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Duncaen @ 2022-08-10 16:35 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1210968053

Comment:
I think this check should go into `setup_pkg` in `common/xbps-src/shutils/common.sh`, this is where we do basic validation on input variables. I would also use pattern matching, either case statement or just `[[` matching.

```bash
for x in "foo>=1" "bar<2" "fizz" "foo-bar-1.0_1" "font-adobe-100dpi-1.8_blah" "cross-x86_64-linux-musl-libc" "perl-PerlIO-utf8-strict-0.008_1" "perl-PerlIO-utf8-strict"; do
    if [[ $x = *[\>\<]* || $x =~ -[^-]+_[0-9]+$ ]]; then 
        echo $x
    fi
done
```

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (5 preceding siblings ...)
  2022-08-10 16:35 ` Duncaen
@ 2022-11-10  2:13 ` github-actions
  2023-02-08  2:35 ` github-actions
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: github-actions @ 2022-11-10  2:13 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/38540#issuecomment-1309672531

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] 18+ messages in thread

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (6 preceding siblings ...)
  2022-11-10  2:13 ` github-actions
@ 2023-02-08  2:35 ` github-actions
  2023-02-13 22:33 ` [PR PATCH] [Updated] " Chocimier
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: github-actions @ 2023-02-08  2:35 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/38540#issuecomment-1421894371

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] 18+ messages in thread

* Re: [PR PATCH] [Updated] xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (7 preceding siblings ...)
  2023-02-08  2:35 ` github-actions
@ 2023-02-13 22:33 ` Chocimier
  2023-02-13 22:33 ` Chocimier
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2023-02-13 22:33 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org hostmakedepends-pattern
https://github.com/void-linux/void-packages/pull/38540

xbps-src: explicitly disallow pattern on build deps
It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

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

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

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-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, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

From 87ec58aed15ea7329ed76a519e07f5a8b6a859f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 8 Aug 2022 20:11:02 +0200
Subject: [PATCH 1/2] xbps-src: explicitly disallow pattern on build deps

It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

Let's detect exact version requirement with regex equivalent to
`xbps-uhelper getpkgname`.

    bash-5.1$ for x in a-{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}; do [[ $x = *[\>\<]* || $x =~ -[^-_]*[0-9][^-_]*_[0-9_]+$ ]]; bash=$?; xbps-uhelper getpkgname $x > /dev/null 2> /dev/null; xbps=$?; if [ $bash != $xbps ]; then echo $x; fi; done
    bash-5.1$

Co-authored-by: Duncaen <duncaen@voidlinux.org>
---
 common/xbps-src/shutils/common.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 1aeeaddc268e..fdc0c5eedd92 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -477,6 +477,12 @@ setup_pkg() {
         fi
     fi
 
+    for x in ${hostmakedepends} ${makedepends} ${checkdepends}; do
+        if [[ $x = *[\<\>]* || $x =~ -[^-_]*[0-9][^-_]*_[0-9_]+$ ]]; then
+            msg_error "$pkgver: specifying version in build dependency '$x' is invalid, template version is used always\n"
+        fi
+    done
+
     FILESDIR=$XBPS_SRCPKGDIR/$sourcepkg/files
     PATCHESDIR=$XBPS_SRCPKGDIR/$sourcepkg/patches
     DESTDIR=$XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/${sourcepkg}-${version}

From 7e178b86b8ce84a73ef3b26da3e8b4772abf09c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Wed, 10 Aug 2022 17:58:09 +0200
Subject: [PATCH 2/2] openocd: runtime depend on exact version of jimtcl

build time version requrement is not valid an does not ensure runtime
version change
---
 srcpkgs/openocd/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/openocd/template b/srcpkgs/openocd/template
index c492f86d321c..9309090c35de 100644
--- a/srcpkgs/openocd/template
+++ b/srcpkgs/openocd/template
@@ -1,7 +1,7 @@
 # Template file for 'openocd'
 pkgname=openocd
 version=0.11.0+1
-revision=1
+revision=2
 # update to a commit that has a compatible jimtcl version
 _commit=830d70bfc66ada2a68c73283b9e4fa4770d408ee
 _jimtcl_version=0.81
@@ -44,6 +44,7 @@ hostmakedepends="automake pkg-config libtool which"
 makedepends="hidapi-devel libftdi1-devel
  jimtcl-devel
  libusb-devel libjaylink-devel capstone-devel"
+depends="jimtcl-devel>=${_jimtcl_version}_1<=${_jimtcl_version}_9999"
 short_desc="Open On-Chip Debugger"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="GPL-2.0-or-later"

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

* Re: [PR PATCH] [Updated] xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (8 preceding siblings ...)
  2023-02-13 22:33 ` [PR PATCH] [Updated] " Chocimier
@ 2023-02-13 22:33 ` Chocimier
  2023-02-13 22:34 ` Chocimier
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2023-02-13 22:33 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org hostmakedepends-pattern
https://github.com/void-linux/void-packages/pull/38540

xbps-src: explicitly disallow pattern on build deps
It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

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

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

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-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, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

From 87ec58aed15ea7329ed76a519e07f5a8b6a859f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 8 Aug 2022 20:11:02 +0200
Subject: [PATCH 1/2] xbps-src: explicitly disallow pattern on build deps

It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

Let's detect exact version requirement with regex equivalent to
`xbps-uhelper getpkgname`.

    bash-5.1$ for x in a-{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}{a,0,-,_}; do [[ $x = *[\>\<]* || $x =~ -[^-_]*[0-9][^-_]*_[0-9_]+$ ]]; bash=$?; xbps-uhelper getpkgname $x > /dev/null 2> /dev/null; xbps=$?; if [ $bash != $xbps ]; then echo $x; fi; done
    bash-5.1$

Co-authored-by: Duncaen <duncaen@voidlinux.org>
---
 common/xbps-src/shutils/common.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 1aeeaddc268e..fdc0c5eedd92 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -477,6 +477,12 @@ setup_pkg() {
         fi
     fi
 
+    for x in ${hostmakedepends} ${makedepends} ${checkdepends}; do
+        if [[ $x = *[\<\>]* || $x =~ -[^-_]*[0-9][^-_]*_[0-9_]+$ ]]; then
+            msg_error "$pkgver: specifying version in build dependency '$x' is invalid, template version is used always\n"
+        fi
+    done
+
     FILESDIR=$XBPS_SRCPKGDIR/$sourcepkg/files
     PATCHESDIR=$XBPS_SRCPKGDIR/$sourcepkg/patches
     DESTDIR=$XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/${sourcepkg}-${version}

From 7e178b86b8ce84a73ef3b26da3e8b4772abf09c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Wed, 10 Aug 2022 17:58:09 +0200
Subject: [PATCH 2/2] openocd: runtime depend on exact version of jimtcl

build time version requrement is not valid an does not ensure runtime
version change
---
 srcpkgs/openocd/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/openocd/template b/srcpkgs/openocd/template
index c492f86d321c..9309090c35de 100644
--- a/srcpkgs/openocd/template
+++ b/srcpkgs/openocd/template
@@ -1,7 +1,7 @@
 # Template file for 'openocd'
 pkgname=openocd
 version=0.11.0+1
-revision=1
+revision=2
 # update to a commit that has a compatible jimtcl version
 _commit=830d70bfc66ada2a68c73283b9e4fa4770d408ee
 _jimtcl_version=0.81
@@ -44,6 +44,7 @@ hostmakedepends="automake pkg-config libtool which"
 makedepends="hidapi-devel libftdi1-devel
  jimtcl-devel
  libusb-devel libjaylink-devel capstone-devel"
+depends="jimtcl-devel>=${_jimtcl_version}_1<=${_jimtcl_version}_9999"
 short_desc="Open On-Chip Debugger"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="GPL-2.0-or-later"

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (9 preceding siblings ...)
  2023-02-13 22:33 ` Chocimier
@ 2023-02-13 22:34 ` Chocimier
  2023-02-13 22:41 ` Duncaen
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2023-02-13 22:34 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1428791435

Comment:
@Duncaen: ok, modified regex to match xbps-uhelper getpkgname.

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (10 preceding siblings ...)
  2023-02-13 22:34 ` Chocimier
@ 2023-02-13 22:41 ` Duncaen
  2023-02-13 22:43 ` Chocimier
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Duncaen @ 2023-02-13 22:41 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1428801544

Comment:
This pattern is more restrictive than the xbps implementation, the only requirement is that revision is numeric not that the version starts with a digit.

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (11 preceding siblings ...)
  2023-02-13 22:41 ` Duncaen
@ 2023-02-13 22:43 ` Chocimier
  2023-02-13 22:48 ` Duncaen
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Chocimier @ 2023-02-13 22:43 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1428803431

Comment:
Version has to contain digit, see commit message.

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (12 preceding siblings ...)
  2023-02-13 22:43 ` Chocimier
@ 2023-02-13 22:48 ` Duncaen
  2023-02-13 22:56 ` Duncaen
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Duncaen @ 2023-02-13 22:48 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1428809023

Comment:
ah right, this is so stupid this shouldn't have been implemented and i hate it, but it is what it is...

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (13 preceding siblings ...)
  2023-02-13 22:48 ` Duncaen
@ 2023-02-13 22:56 ` Duncaen
  2023-02-14  1:09 ` [PR PATCH] [Merged]: " classabbyamp
  2023-02-14  1:10 ` classabbyamp
  16 siblings, 0 replies; 18+ messages in thread
From: Duncaen @ 2023-02-13 22:56 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1428817449

Comment:
Maybe we can just add `=` as alternative pkgver separator in xbps and slowly migrate over to use that as a more sane choice instead of a character that is used in half the packages names already.

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

* Re: [PR PATCH] [Merged]: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (14 preceding siblings ...)
  2023-02-13 22:56 ` Duncaen
@ 2023-02-14  1:09 ` classabbyamp
  2023-02-14  1:10 ` classabbyamp
  16 siblings, 0 replies; 18+ messages in thread
From: classabbyamp @ 2023-02-14  1:09 UTC (permalink / raw)
  To: ml

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

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

xbps-src: explicitly disallow pattern on build deps
https://github.com/void-linux/void-packages/pull/38540

Description:
It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo
already. That it worked when in repo was a coincidence.

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

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

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-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, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Closes #37837

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

* Re: xbps-src: explicitly disallow pattern on build deps
  2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
                   ` (15 preceding siblings ...)
  2023-02-14  1:09 ` [PR PATCH] [Merged]: " classabbyamp
@ 2023-02-14  1:10 ` classabbyamp
  16 siblings, 0 replies; 18+ messages in thread
From: classabbyamp @ 2023-02-14  1:10 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38540#issuecomment-1428949619

Comment:
+1, i think = makes a lot of sense as a version specifier 

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

end of thread, other threads:[~2023-02-14  1:10 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 18:22 [PR PATCH] xbps-src: explicitly disallow pattern on build deps Chocimier
2022-08-08 18:58 ` classabbyamp
2022-08-08 20:29 ` Chocimier
2022-08-08 23:12 ` paper42
2022-08-10 15:59 ` [PR PATCH] [Updated] " Chocimier
2022-08-10 16:00 ` Chocimier
2022-08-10 16:35 ` Duncaen
2022-11-10  2:13 ` github-actions
2023-02-08  2:35 ` github-actions
2023-02-13 22:33 ` [PR PATCH] [Updated] " Chocimier
2023-02-13 22:33 ` Chocimier
2023-02-13 22:34 ` Chocimier
2023-02-13 22:41 ` Duncaen
2023-02-13 22:43 ` Chocimier
2023-02-13 22:48 ` Duncaen
2023-02-13 22:56 ` Duncaen
2023-02-14  1:09 ` [PR PATCH] [Merged]: " classabbyamp
2023-02-14  1:10 ` classabbyamp

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).