Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparations to switch to APK package manager #7007

Open
aparcar opened this issue Mar 21, 2024 · 10 comments
Open

Preparations to switch to APK package manager #7007

aparcar opened this issue Mar 21, 2024 · 10 comments

Comments

@aparcar
Copy link
Member

aparcar commented Mar 21, 2024

Hi all, some fellow developers and me worked for some time now on making APK the new package manager for OpenWrt, replacing the unmaintained OPKG fork we've been using for the longest time.

APK is actively developed and used in multiple other distributions, e.g. Alpine Linux 🎉

While there is till some work ahead, I'd like to prepare everyone who maintains a package to verify that the PKG_VERSION follows Semantic Versioning <major>.<minor>.<fixup>[.<sub1>...]. APK uses a deterministic algorithm to compare versions and does not like random strings, except a valid hash prefixed with a ~.

If in doubt, please use the Docker container below to verify the used version is valid:

docker run --rm -it ghcr.io/aparcar/apk-valid-version <VERSION> [<VERSION> ...]

It will print whatever version is not valid, if you get a zero exit code, you're fine.

Please feel free to reach out for assistance and have a look at the core migration of versions.

@aparcar
Copy link
Member Author

aparcar commented Mar 21, 2024

Below packages that would cause trouble. Please bear in mind that PKG_RELEASE is soonish prefixed with an r and may only contain a number.

Naughty list:

  • luci-app-adblock-fast 1.1.1-5
  • luci-app-advanced-reboot 1.0.1-9
  • luci-app-dockerman v0.5.13-20240317
  • luci-app-https-dns-proxy 2023-11-19-1
  • luci-app-pbr 1.1.1-7
  • luci-proto-nebula 1.6.1-1

@aparcar aparcar pinned this issue Mar 21, 2024
@stangri
Copy link
Member

stangri commented Mar 21, 2024

@aparcar I can pre-emptively add r to the revisions, I just wanted to confirm that it will not break opkg upgrade logic. For example, would opkg consider 1.1.1-r6 higher version than 1.1.1-5? Same question for 2023.11.19-r2 and 2023-11-19-1.

@hnyman
Copy link
Contributor

hnyman commented Mar 21, 2024

would opkg consider 1.1.1-r6 higher version than 1.1.1-5? Same question for 2023.11.19-r2 and 2023-11-19-1.

Easiest is to bump the main version to 1.1.2 at the same time

(not sure about the date comparison with a changed separator)

@systemcrash
Copy link
Contributor

@aparcar I can pre-emptively add r to the revisions, I just wanted to confirm that it will not break opkg upgrade logic. For example, would opkg consider 1.1.1-r6 higher version than 1.1.1-5? Same question for 2023.11.19-r2 and 2023-11-19-1.

Does opkg even do that? I'm under the impression that it does not compare versions.

See parse_version and compare

You could do away with 1.1.1-r6 altogether and just let git handle semantic versioning (at least for the time being), or use dates instead. For devs, the tip of the master branch is latest, for users, if it is updated, it will show as update available.

@systemcrash
Copy link
Contributor

systemcrash commented Mar 21, 2024

@feckert: date format here makes most sense. We won't be updating lua apps (this app is lua) any more so this change should be OK. Alt: update at source? https://github.com/lisaac/luci-app-dockerman

  • luci-app-dockerman v0.5.13-20240317

@stangri
Copy link
Member

stangri commented Mar 21, 2024

docker run --rm -it docker.io/aparcar/apk-version-check [ ...]

BTW:

sudo docker run --rm -it docker.io/aparcar/apk-version-check 1.1.1-5
Unable to find image 'aparcar/apk-version-check:latest' locally
latest: Pulling from aparcar/apk-version-check
bca4290a9639: Pull complete
1ae19ff60baf: Pull complete
75e05e2c02ea: Pull complete
28c83907721f: Pull complete
Digest: sha256:e113fde83c649c3dc7cfed9b7e6c2068b94aad61f950cf9f0bfd93d9bcf69c86
Status: Downloaded newer image for aparcar/apk-version-check:latest
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v2) and no specific platform was requested
exec /usr/bin/apk: exec format error

@aparcar
Copy link
Member Author

aparcar commented Mar 21, 2024

@stangri I added a multi arch container here ghcr.io/aparcar/apk-valid-version

@jow-
Copy link
Contributor

jow- commented Mar 21, 2024

For example, would opkg consider 1.1.1-r6 higher version than 1.1.1-5? Same question for 2023.11.19-r2 and 2023-11-19-1.

root@OpenWrt:~# opkg compare-versions 1.1.1-r6 '>' 1.1.1-5 && echo true || echo false
true
root@OpenWrt:~# opkg compare-versions 2023.11.19-r2 '>' 2023-11-19-1 && echo true || echo false
true
root@OpenWrt:~# opkg compare-versions 1 '>' r1 && echo true || echo false
false
root@OpenWrt:~# opkg compare-versions r1 '>' 1 && echo true || echo false
true
root@OpenWrt:~# 

@stangri
Copy link
Member

stangri commented Mar 23, 2024

@systemcrash
Copy link
Contributor

@feckert - how is dockerman update coming along?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants