Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lang/lua/luajit2/test-version.sh
Comment thread
GeorgeSapkin marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# shellcheck shell=busybox

case "$PKG_NAME" in #luajit2 use build number at -v but releases are named by date
luajit2)
exit 0
;;
Comment on lines +5 to +8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhh.. are we sure that this is something that it should be merged? 🤔

I don't mean to be rude, but we have tests here to verify that the application at least runs within CI/CD. Instead, we're just accepting a workaround where we won't test it at all because either upstream or downstream versioning is broken, and we're throwing away the entire run testing for luajit2. That's nonsense, right?

Here is the output from CI/CD:

luajit2: [skip] Version check (/usr/bin/luajit2)

This essentially tells me that we aren't going to test luajit2 and we can completely forget about any run testing. This is not right at all, especially considering luajit2 actually does report its version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most test-version.sh overrides are in that structure(krb5/perl/etc...), so I assumed it's standard for version check override?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a standard for version checks. We shouldn't blindly copy overrides without checking if they actually make sense for the package in question.

Packages like krb5 have overrides because they don't report their version. But if an application does report its version, there is no reason to skip the test. If perl5 is bypassing it, then that test is probably wrong too. We shouldn't just give up on testing when the binary provides the information we need.

For a good reference on how CI/CD runtime testing should actually be done, please take a look at the tests provided by @commodo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be most likely addressed in #29669


*)
echo "Untested package: $PKG_NAME" >&2
exit 1
;;
esac
15 changes: 15 additions & 0 deletions libs/libxslt/test-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# shellcheck shell=busybox

#xsltproc doesn't say it's own version but only depends
case "$PKG_NAME" in
xsltproc|libxslt|libexslt)
exit 0
;;
Comment on lines +5 to +9

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same case as above and shouldn't be merged yet. I don't think this is the right direction, and we shouldn't accept the contribution in this form. I want to emphasize this because it's an important detail to get right.

The whole point of having CI/CD tests is to verify that things actually work. Throwing a test away instead of taking a little time to fix it correctly defeats the purpose of the pipeline.

I looked into this, and it took me just a few minutes to find a working approach by using CI/CD.

I am using OpenWrt 24.10 (yeah, still):

root@turris:~# xsltproc -v -V
Using libxml 21405, libxslt 10142 and libexslt 823
xsltproc was compiled against libxml 21405, libxslt 10142 and libexslt 823
libxslt 10142 was compiled against libxml 21405
libexslt 823 was compiled against libxml 21405
root@turris:~# opkg list-installed | grep xsltproc
xsltproc - 1.1.42-r1

Gemini 3.5 Flash (High) says:

When running xsltproc -V, it reports:

libxml 21405
libxslt 10142
libexslt 823
These numbers are encoded versions using the internal representation format: $$\text{Version Integer} = \text{Major} \times 10000 + \text{Minor} \times 100 + \text{Patch}$$

Specifically:

libxml 21405 corresponds to version 2.14.5 ($2 \times 10000 + 14 \times 100 + 5 = 21405$).
libxslt 10142 corresponds to version 1.1.42 ($1 \times 10000 + 1 \times 100 + 42 = 10142$).
libexslt 823 corresponds to version 0.8.23 ($0 \times 10000 + 8 \times 100 + 23 = 823$).
This is the standard version encoding of the libxml2/libxslt libraries.

Instead of dropping the test, we can just parse the version properly. Here is a working implementation for test-version.sh that handles this encoding:

#!/bin/sh

# shellcheck shell=busybox

pkg="${1:-$PKG_NAME}"
ver="${2:-$PKG_VERSION}"

case "$pkg" in
libxslt|libexslt)
	exit 0
	;;

xsltproc)
	# libxslt / libxml encode version as major * 10000 + minor * 100 + patch.
	# For example, libxslt version 1.1.42 is represented as 10142.
	IFS=. read -r major minor patch <<EOF
$ver
EOF
	major=$(echo "${major:-0}" | tr -cd '0-9')
	minor=$(echo "${minor:-0}" | tr -cd '0-9')
	patch=$(echo "${patch:-0}" | tr -cd '0-9')
	ver_encoded=$((major * 10000 + minor * 100 + patch))

	xsltproc -V 2>&1 | grep -q "libxslt $ver_encoded"
	;;

*)
	echo "test-version.sh: unhandled sub-package '$pkg'" >&2
	exit 1
	;;
esac

Of course, it needs to be checked, if it is alright and if it works.


*)
echo "Untested package: $PKG_NAME" >&2
exit 1
;;
esac
6 changes: 3 additions & 3 deletions net/nginx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=nginx
PKG_VERSION:=1.26.3
PKG_RELEASE:=4
PKG_VERSION:=1.30.2
PKG_RELEASE:=1

PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://nginx.org/download/
PKG_HASH:=69ee2b237744036e61d24b836668aad3040dda461fe6f570f1787eab570c75aa
PKG_HASH:=7df3090907fca3cc0e456d6dc00ceb230da74ea88026ceff0affc29dbbd9ac4c

PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> \
Christian Marangi <ansuelsmth@gmail.com>
Expand Down
8 changes: 4 additions & 4 deletions net/nginx/patches/nginx/101-feature_test_fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
ngx_feature_libs=
--- a/auto/unix
+++ b/auto/unix
@@ -853,7 +853,7 @@ ngx_feature_test="void *p; p = memalign(
@@ -835,7 +835,7 @@ ngx_feature_test="void *p; p = memalign(

ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
ngx_feature_name="NGX_HAVE_MAP_ANON"
Expand All @@ -96,7 +96,7 @@
ngx_feature_incs="#include <sys/mman.h>"
ngx_feature_path=
ngx_feature_libs=
@@ -866,7 +866,7 @@ ngx_feature_test="void *p;
@@ -848,7 +848,7 @@ ngx_feature_test="void *p;

ngx_feature='mmap("/dev/zero", MAP_SHARED)'
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
Expand All @@ -105,7 +105,7 @@
ngx_feature_incs="#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>"
@@ -881,7 +881,7 @@ ngx_feature_test='void *p; int fd;
@@ -863,7 +863,7 @@ ngx_feature_test='void *p; int fd;

ngx_feature="System V shared memory"
ngx_feature_name="NGX_HAVE_SYSVSHM"
Expand All @@ -114,7 +114,7 @@
ngx_feature_incs="#include <sys/ipc.h>
#include <sys/shm.h>"
ngx_feature_path=
@@ -895,7 +895,7 @@ ngx_feature_test="int id;
@@ -877,7 +877,7 @@ ngx_feature_test="int id;

ngx_feature="POSIX semaphores"
ngx_feature_name="NGX_HAVE_POSIX_SEM"
Expand Down
4 changes: 2 additions & 2 deletions net/nginx/patches/nginx/105-optional-libexslt.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/auto/options
+++ b/auto/options
@@ -165,6 +165,7 @@ USE_PERL=NO
@@ -166,6 +166,7 @@ USE_PERL=NO
NGX_PERL=perl

USE_LIBXSLT=NO
+USE_LIBEXSLT=NO
USE_LIBGD=NO
USE_GEOIP=NO

@@ -370,6 +371,7 @@ use the \"--with-mail_ssl_module\" optio
@@ -372,6 +373,7 @@ use the \"--with-mail_ssl_module\" optio
--with-pcre-opt=*) PCRE_OPT="$value" ;;
--with-pcre-jit) PCRE_JIT=YES ;;
--without-pcre2) PCRE2=DISABLED ;;
Expand Down
2 changes: 1 addition & 1 deletion net/nginx/patches/nginx/201-ignore-invalid-options.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/auto/options
+++ b/auto/options
@@ -415,8 +415,7 @@ $0: warning: the \"--with-sha1-asm\" opt
@@ -417,8 +417,7 @@ $0: warning: the \"--with-sha1-asm\" opt
--test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;

*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/src/event/quic/ngx_event_quic_protection.c
+++ b/src/event/quic/ngx_event_quic_protection.c
@@ -510,7 +510,7 @@ ngx_quic_crypto_common(ngx_quic_secret_t
@@ -520,7 +520,7 @@ ngx_quic_crypto_common(ngx_quic_secret_t
}
}

Expand Down
Loading