Skip to content

Conversation

@GeorgeSapkin
Copy link
Member

@GeorgeSapkin GeorgeSapkin commented Dec 23, 2025

📦 Package Details

Maintainer: @Ansuel, @heil cc: @ptpt52

Description:

  • nginx modules must not provide nginx which causes them to not be able to be installed alongside nginx due to the new apk provide fixes:
ERROR: unable to select packages:                                                                                                                                                                 
  nginx-ssl-1.26.3-r2:                                                                                                                                                                            
    conflicts: nginx-mod-ubus-1.26.3-r2[nginx=1.26.3-r2]                                                                                                                                          
    satisfies: world[nginx-ssl] luci-nginx-25.356.52243~18fe56d[nginx] nginx-mod-luci-1.26.3-r2[nginx-ssl] nginx-mod-ubus-1.26.3-r2[nginx-ssl]                                                    
  nginx-mod-ubus-1.26.3-r2:                                                                                                                                                                       
    conflicts: nginx-ssl-1.26.3-r2[nginx=1.26.3-r2]                                                                                                                                               
    satisfies: world[nginx-mod-ubus] luci-nginx-25.356.52243~18fe56d[nginx] nginx-mod-luci-1.26.3-r2[nginx-mod-ubus]
  • Remove PROVIDES from modules.
  • Remove nginx-ssl from PROVIDES as there is no non-ssl variant, i.e. all version provide ssl.
  • Set nginx-ssl as the default variant.
  • Switch etebase from nginx-ssl to nginx. etebase is the only package depending on it.
  • Remove non-existent config value.

There's an unrelated issues (as far as I can tell) with nginx Kconfig recursive dependency that happens on 25.12-rc1 without the apk fix. This PR doesn't cover that.

Related:


🧪 Run Testing Details

  • OpenWrt Version: SNAPSHOT
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: QEMU

nginx and modules can be installed side-by-side and modules don't provide nginx anymore:

root@OpenWrt:/tmp# apk add --allow-untrusted ./nginx-ssl-1.26.3-r3.apk ./nginx-mod-ubus-1.26.3-r3.apk ./nginx-mod-luci-1.26.3-r3.apk 
(1/9) Installing libxml2-16 (2.15.1-r1)
  Executing libxml2-16-2.15.1-r1.post-install
(2/9) Installing nginx-ssl (1.26.3-r3)
  Executing nginx-ssl-1.26.3-r3.post-install
  * Created self-signed SSL certificate '/etc/nginx/conf.d/_lan.crt' with key '/etc/nginx/conf.d/_lan.key'.
  * nginx_init: NOT using conf file!
  * show config to be used by: nginx -T -c '/etc/nginx/uci.conf'
(3/9) Installing nginx-mod-ubus (1.26.3-r3)
  Executing nginx-mod-ubus-1.26.3-r3.post-install
(4/9) Installing libcap (2.69-r1)
  Executing libcap-2.69-r1.post-install
(5/9) Installing uwsgi (2.0.30-r1)
  Executing uwsgi-2.0.30-r1.post-install
(6/9) Installing uwsgi-cgi-plugin (2.0.30-r1)
  Executing uwsgi-cgi-plugin-2.0.30-r1.post-install
(7/9) Installing uwsgi-syslog-plugin (2.0.30-r1)
  Executing uwsgi-syslog-plugin-2.0.30-r1.post-install
(8/9) Installing uwsgi-luci-support (2.0.30-r1)
  Executing uwsgi-luci-support-2.0.30-r1.post-install
(9/9) Installing nginx-mod-luci (1.26.3-r3)
  Executing nginx-mod-luci-1.26.3-r3.pre-install
  Installing file to etc/nginx/conf.d/luci.locations.apk-new
  Executing nginx-mod-luci-1.26.3-r3.post-install
OK: 28.8 MiB in 159 packages

root@OpenWrt:/tmp# apk query --fields name,version,provides nginx-full nginx-ssl
Name: nginx-full
Version: 1.26.3-r3
Provides: nginx=1.26.3-r3

Name: nginx-ssl
Version: 1.26.3-r3
Provides: nginx=1.26.3-r3

nginx-full correctly conflicts with nginx-ssl on the basis of both of them providing nginx:

root@OpenWrt:/tmp# apk add --allow-untrusted ./nginx-full-1.26.3-r3.apk 
ERROR: unable to select packages:
  nginx-full-1.26.3-r3:
    conflicts: nginx-ssl-1.26.3-r3[nginx=1.26.3-r3]
    satisfies: world[nginx-full><Q1UaDCZ3EfTeoNyLVJX+xyU8YxBd4=] nginx-mod-luci-1.26.3-r3[nginx]
               nginx-mod-ubus-1.26.3-r3[nginx]
  nginx-ssl-1.26.3-r3:
    conflicts: nginx-full-1.26.3-r3[nginx=1.26.3-r3]
    satisfies: world[nginx-ssl><Q1JNNMA25+i7ZG2B/WyJZm3PDk74I=] nginx-mod-luci-1.26.3-r3[nginx]
               nginx-mod-ubus-1.26.3-r3[nginx]

luci-nginx still installs on top of this PR's changes.

etebase builds and installs, but the package is broken due to some Python dependencies, even without this PR's changes.

@ptpt52 can you test on your end?


✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

nginx modules must not provide nginx which causes them to not be able
to be installed alongside nginx due to the new apk provide fixes.

Remove PROVIDES from modules.

Remove nginx-ssl from PROVIDES as there is no non-ssl variant, i.e. all
version provide ssl.

Set nginx-ssl as the default variant.

Remove non-existent config value.

Signed-off-by: George Sapkin <george@sapk.in>
All nginx variants provide ssl so switch from nginx-ssl to nginx.

Signed-off-by: George Sapkin <george@sapk.in>
GeorgeSapkin referenced this pull request in openwrt/openwrt Dec 23, 2025
The updated logic for the APK dependencies and provides is as follows:

- If ABI version is defined:
  - package is named `package_name-ABI_version`
  - package implicitly provides
    `package_name-ABI_version=package_version`
    this implies that only one version of a package per ABI can be
    installed at the same time
  - additionally provide `package_name` so multiple packages can be
    looked up by its base name
  - for each `provides`, provide `provide-ABI_version=package_version`
    this implies that only one version of a provide can be installed at
    the same time

- else if ABI version is _not_ defined
  - package is named `package_name`
  - package implicitly provides `package_name=package_version`
    this implies that only one version of a package can be installed at
    the same time
  - if `alternatives` is defined
    - for each `provides`, provide `provide`
      this implies that multiple versions of a provide can be installed
      at the same time
  - else if `alternatives` is _not_ defined
    - for each `provides`, provide `provide=package_version`
      this implies that only one version of a provide can be installed
      at the same time

Both cases a package can be looked up by its base name.

ABI version `alternatives`, `conffiles`, `conffiles_static`, `list` and
`rusers` files so multiple versions of the same ABI package can be
installed side by side, and so they don't overwrite each other's
packaging files.

ABI version `EXTRA_DEPENDS` so dependencies can be correctly looked up
using the existing OpenWrt semantics without the ABI specified. This is
needed since ABI-versioned libraries no longer provide
`package_name=package_version`, so that they can be installed side by
side.

Remove duplicate dependencies when `EXTRA_DEPENDS` specifies a versioned
one that is already in `DEPENDS`.

ABI is defined
------------------------------------------------------------------------

`libsqlite3` has `PROVIDES` set to `libfake` and has two different ABI
versions installed. `libfake` is just an example to demonstrate the
mechanics, as the library can already be depended upon using e.g.
`libsqlite3-0=3.51.0-r1`. Note the ABI-versioned lists.

```
root@OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-0-3.51.0-r1.apk
(1/1) Installing libsqlite3-0 (3.51.0-r1)
libsqlite3-0-3.51.0-r1.post-install: Executing script...
OK: 22 MiB in 157 packages

root@OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-1-4.00.0-r1.apk
(1/1) Installing libsqlite3-1 (4.00.0-r1)
libsqlite3-1-4.00.0-r1.post-install: Executing script...
OK: 23 MiB in 158 packages

root@OpenWrt:/tmp# apk query --fields name,version,contents,provides libsqlite3-0 libsqlite3-1
Name: libsqlite3-0
Version: 3.51.0-r2
Provides: libfake-0=3.51.0-r2 libsqlite3
Contents:
  lib/apk/packages/libsqlite3-0.list
  usr/lib/libsqlite3.so.0
  usr/lib/libsqlite3.so.3.51.0

Name: libsqlite3-1
Version: 4.00.0-r1
Provides: libfake-1=4.00.0-r1 libsqlite3
Contents:
  lib/apk/packages/libsqlite3-1.list
  usr/lib/libsqlite3.so.1
  usr/lib/libsqlite3.so.4.00.0

root@OpenWrt:/tmp# ls -lh /usr/lib/libsqlite3.so.*
lrwxrwxrwx    1 root     root          20 Nov 20 00:23 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.3.51.0
lrwxrwxrwx    1 root     root          20 Nov 20 00:27 /usr/lib/libsqlite3.so.1 -> libsqlite3.so.4.00.0
-rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.3.51.0
-rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.4.00.0
```

ABI is not defined
------------------------------------------------------------------------

Both `avahi-dbus-daemon` and `avahi-nodbus-daemon` provide `avahi-daemon`,
but have no ABI specified. This results in `avahi-daemon=0.8-r11` provides
for both packages and only one being able to be installed at the same time:

```
root@OpenWrt:/tmp# apk add --allow-untrusted ./avahi-nodbus-daemon-0.8-r11.apk
(1/4) Installing libavahi-nodbus-support (0.8-r10)
libavahi-nodbus-support-0.8-r10.post-install: Executing script...
(2/4) Installing libdaemon (0.14-r5)
libdaemon-0.14-r5.post-install: Executing script...
(3/4) Installing libexpat (2.7.3-r1)
libexpat-2.7.3-r1.post-install: Executing script...
(4/4) Installing avahi-nodbus-daemon (0.8-r11)
avahi-nodbus-daemon-0.8-r11.post-install: Executing script...
23 MiB in 160 packages

root@OpenWrt:/tmp# apk query --fields provides avahi-nodbus-daemon
Provides: avahi-daemon=0.8-r11

root@OpenWrt:/tmp# apk add --allow-untrusted ./avahi-dbus-daemon-0.8-r11.apk
ERROR: unable to select packages:
  avahi-dbus-daemon-0.8-r11:
    conflicts: avahi-nodbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
    satisfies: world[avahi-dbus-daemon><Q1R111s+ke9Vf+eCxDHX2BZVUK54Q=]
  avahi-nodbus-daemon-0.8-r11:
    conflicts: avahi-dbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
    satisfies: world[avahi-nodbus-daemon><Q1BAu7nLI2MgRabpveLTGO2ksQz7E=]
```

Provides and alternatives
------------------------------------------------------------------------

Both `uclient-fetch` and `wget-nossl` provide `wget` and specify
alternatives, so provides are not versioned and both packages can be
installed at the same time:

```
root@OpenWrt:/tmp# apk query --fields name,version,contents,provides uclient-fetch wget-nossl
Name: uclient-fetch
Version: 2025.10.03~dc909ca7-r1
Provides: wget
Contents:
  bin/uclient-fetch
  lib/apk/packages/uclient-fetch.alternatives
  lib/apk/packages/uclient-fetch.list

Name: wget-nossl
Version: 1.25.0-r1
Provides: gnu-wget wget
Contents:
  lib/apk/packages/wget-nossl.alternatives
  lib/apk/packages/wget-nossl.list
  usr/libexec/wget-nossl

```

Fixes: #20582
Fixes: #20802
Signed-off-by: George Sapkin <george@sapk.in>
Link: #20819
Signed-off-by: Robert Marko <robimarko@gmail.com>
@ptpt52
Copy link
Contributor

ptpt52 commented Dec 23, 2025

tested, and fixed

@lorand-horvath
Copy link

@GeorgeSapkin Just wondering if this fix has anything to do with the recently increased image size for mediatek/filogic and qualcommax/ipq50xx targets by almost 500 kB. If no correlation, please disregard my comment.

@robimarko robimarko merged commit 8e535fd into openwrt:master Dec 24, 2025
8 of 12 checks passed
@GeorgeSapkin GeorgeSapkin deleted the nginx-fix-provides branch December 24, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants