Skip to content

libwebsockets: full variant provides OpenSSL - #19701

Merged
BKPepe merged 2 commits into
openwrt:masterfrom
turris-cz:libwebsockets-conflicts-provides
Oct 25, 2022
Merged

libwebsockets: full variant provides OpenSSL#19701
BKPepe merged 2 commits into
openwrt:masterfrom
turris-cz:libwebsockets-conflicts-provides

Conversation

@BKPepe

@BKPepe BKPepe commented Oct 25, 2022

Copy link
Copy Markdown
Member

Maintainer: @karlp
Compile tested: Turris 1.1, OpenWrt 21.02.5, mpc85xx/p2020
Run tested:

  • conflicts OpenSSL and full variant:

Before:

root@turris:~# opkg list-installed | grep libwebsockets
libwebsockets-openssl - 3.1.0-2
root@turris:~# opkg install libwebsockets-full
Installing libwebsockets-full (3.1.0-2) to root...
Downloading https://repo.turris.cz/hbk/omnia/packages/packages/libwebsockets-full_3.1.0-2_arm_cortex-a9_vfpv3-d16.ipk
Collected errors:
* check_data_file_clashes: Package libwebsockets-full wants to install file /usr/lib/libwebsockets.so
   But that file is already provided by package  * libwebsockets-openssl
* check_data_file_clashes: Package libwebsockets-full wants to install file /usr/lib/libwebsockets.so.14
   But that file is already provided by package  * libwebsockets-openssl
* opkg_install_cmd: Cannot install package libwebsockets-full.

After:

root@turris:~# opkg install libwebsockets-full_3.1.0-3_powerpc_8548.ipk 
Installing libwebsockets-full (3.1.0-3) to root...
Configuring libwebsockets-full.
root@turris:~# opkg install libwebsockets-openssl_3.1.0-3_powerpc_8548.ipk 
Installing libwebsockets-openssl (3.1.0-3) to root...
Collected errors:
* check_conflicts_for: The following packages conflict with libwebsockets-openssl:
* check_conflicts_for: 	libwebsockets-full * 
* opkg_install_cmd: Cannot install package libwebsockets-openssl.

  • full variant provides OpenSSL:
root@turris:~# opkg list-installed | grep libwebsockets
libwebsockets-full - 3.1.0-2
root@turris:~# opkg install ttyd
Installing ttyd (1.6.3-3) to root...
Downloading https://repo.turris.cz/hbt/turris1x/packages/packages/ttyd_1.6.3-3_powerpc_8548.ipk
Configuring ttyd.
root@turris:~# opkg install mosquitto-ssl
Package mosquitto-ssl (2.0.15-1) installed in root is up to date.

root@turris:~# opkg remove libwebsockets-full
No packages removed.
Collected errors:
 * print_dependents_warning: Package libwebsockets-full is depended upon by packages:
 * print_dependents_warning: 	ttyd
 * print_dependents_warning: 	mosquitto-ssl
 * print_dependents_warning: These might cease to work if package libwebsockets-full is removed.

 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.

Description:

For some time, it is not possible to install ttyd and mosquitto-ssl at the same time, so let's solve it that libwebsockets-full provides libwebsockets-openssl. This allows to install ttyd and mosquitto at the same time.

Also, we need to add conflict, because we should not have installed libwebsockets-openssl and libwebsockets-full at the same time as they provides the same files.

Fixes: #11632

For some time, it is not possible to install ttyd and mosquitto-ssl at the
same time, so let's solve it that libwebsockets-full provides
libwebsockets-openssl. This allows to install ttyd and mosquitto at
the same time.

Also, we need to add conflict, because we should not have installed
libwebsockets-openssl and libwebsockets-full at the same time as they
provides the same files.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
@karlp

karlp commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

IMO the right solution is to just drop the other versions. Lol, now it looks like LWS has changed again, and mbedtls is back to being a fully supported variant.

Re-looking at it again, yeah, this seems like a decent enough solution. I'd personalyl rather just drop the full version altogether and make the openssl version be full, but apparently that annoyed other people.

@karlp

karlp commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

Go for it, this won't interact with any of my packages.

@BKPepe

BKPepe commented Oct 25, 2022

Copy link
Copy Markdown
Member Author

I've just pushed another commit please check it. If it is alright, I will merge it.

@BKPepe
BKPepe force-pushed the libwebsockets-conflicts-provides branch 2 times, most recently from 32a920c to ff09054 Compare October 25, 2022 10:21
endef

define Package/libwebsockets-mbedtls
$(call Package/$(PKG_NAME)/Default)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am thinking if I should not split this change to its own commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Personally, I don't think it should be changed at all, it's just style. :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's true. It should be in sync with others, but let's drop this. Unrelated to my change.

They provide the same files, but they don't conflict to each other, this
means that users can install them side by side.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
@BKPepe
BKPepe force-pushed the libwebsockets-conflicts-provides branch from ff09054 to 676c5c7 Compare October 25, 2022 10:27
@karlp

karlp commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

I think you should just leave the mbedtls changes out of this altogether. They might not technically conflict, as they'll just replace each other, but they're still not the same, and you can't have them both at the same time, as they have the same lib name.

@BKPepe

BKPepe commented Oct 25, 2022

Copy link
Copy Markdown
Member Author

They might not technically conflict, as they'll just replace each other, but they're still not the same, and you can't have them both at the same time, as they have the same lib name.

You could, and users are doing that or suggesting it to each other by forcing it.

Before my commit:

First, I checked which libwebsockets I have installed, then verified with the usual way that mbedtls can not be installed, and then enforced and managed to install it.

root@turris:~# opkg list-installed | grep libwebsockets
libwebsockets-openssl - 3.1.0-2
root@turris:~# opkg install libwebsockets-mbedtls
Installing libwebsockets-mbedtls (3.1.0-2) to root...
Downloading https://repo.turris.cz/hbk/omnia/packages/packages/libwebsockets-mbedtls_3.1.0-2_arm_cortex-a9_vfpv3-d16.ipk
Installing libmbedtls (2.16.12-1) to root...
Downloading https://repo.turris.cz/hbk/omnia/packages/base/libmbedtls_2.16.12-1_arm_cortex-a9_vfpv3-d16.ipk
Configuring libmbedtls.
Collected errors:
 * check_data_file_clashes: Package libwebsockets-mbedtls wants to install file /usr/lib/libwebsockets.so
	But that file is already provided by package  * libwebsockets-openssl
 * check_data_file_clashes: Package libwebsockets-mbedtls wants to install file /usr/lib/libwebsockets.so.14
	But that file is already provided by package  * libwebsockets-openssl
 * opkg_install_cmd: Cannot install package libwebsockets-mbedtls.
root@turris:~# opkg install libwebsockets-mbedtls --force-overwrite
Installing libwebsockets-mbedtls (3.1.0-2) to root...
Downloading https://repo.turris.cz/hbk/omnia/packages/packages/libwebsockets-mbedtls_3.1.0-2_arm_cortex-a9_vfpv3-d16.ipk
Configuring libwebsockets-mbedtls.
root@turris:~# opkg list-installed | grep libwebsockets
libwebsockets-mbedtls - 3.1.0-2
libwebsockets-openssl - 3.1.0-2
root@turris:~# opkg files libwebsockets-openssl
Package libwebsockets-openssl (3.1.0-2) is installed on root and has the following files:
root@turris:~# opkg files libwebsockets-mbedtls
Package libwebsockets-mbedtls (3.1.0-2) is installed on root and has the following files:
/usr/lib/libwebsockets.so.14
/usr/lib/libwebsockets.so

TL;DR: I installed two libwebsockets packages at the same time by forcing it based on this suggested approach https://forum.openwrt.org/t/rpi4-community-build/69998/994 and this should not happen as it might lead to some cases when you are confused, which libraries are used for the package.

After my commit:

root@turris:~# opkg install libwebsockets-openssl_3.1.0-3_powerpc_8548.ipk 
Installing libwebsockets-openssl (3.1.0-3) to root...
Configuring libwebsockets-openssl.
root@turris:~# opkg install libwebsockets-mbedtls_3.1.0-3_powerpc_8548.ipk
Installing libwebsockets-mbedtls (3.1.0-3) to root...
Collected errors:
 * check_conflicts_for: The following packages conflict with libwebsockets-mbedtls:
 * check_conflicts_for: 	libwebsockets-openssl * 
 * opkg_install_cmd: Cannot install package libwebsockets-mbedtls.
root@turris:~# opkg install libwebsockets-mbedtls_3.1.0-3_powerpc_8548.ipk --force-overwrite
Installing libwebsockets-mbedtls (3.1.0-3) to root...
Collected errors:
 * check_conflicts_for: The following packages conflict with libwebsockets-mbedtls:
 * check_conflicts_for: 	libwebsockets-openssl * 
 * opkg_install_cmd: Cannot install package libwebsockets-mbedtls.

TL;DR: Conflicts ensure that those packages can not be installed at the same time.

@karlp

karlp commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

yeah, if it says they're both installed, that's unhelpful. You only ever get one of them actually installed. ok, go for it.

@BKPepe
BKPepe merged commit 02eb18a into openwrt:master Oct 25, 2022
@BKPepe

BKPepe commented Oct 25, 2022

Copy link
Copy Markdown
Member Author

Backported to all stable OpenWrt branches.

@karlp

karlp commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

Backporting this to both 1907 and 1806 seems far out of scope, and not something I endorse at all, those have wildly different lws versions and are fully EOL. (Not least of which, I don't actually believe PROVIDES and CONFLICTS work properly in those older branches)

@hnyman

hnyman commented Oct 25, 2022

Copy link
Copy Markdown
Contributor

This seems to cause recursive dependency errors in master, shown by e.g. make defconfig:

perus@ub2210:/Openwrt/r7800$ make defconfig
tmp/.config-package.in:59141:error: recursive dependency detected!
tmp/.config-package.in:59141:	symbol PACKAGE_libwebsockets-openssl is selected by PACKAGE_libwebsockets-mbedtls
tmp/.config-package.in:59125:	symbol PACKAGE_libwebsockets-mbedtls depends on PACKAGE_libwebsockets-openssl
For a resolution refer to Documentation/kbuild/kconfig-language.rst
subsection "Kconfig recursive dependency limitations"

#
# No change to .config
#

Strange that this apparently already got backported also to the branches already at end-of-life status.

@BKPepe

BKPepe commented Oct 25, 2022 via email

Copy link
Copy Markdown
Member Author

@BKPepe

BKPepe commented Oct 26, 2022

Copy link
Copy Markdown
Member Author

Backporting this to both 1907 and 1806 seems far out of scope, and not something I endorse at all, those have wildly different lws versions and are fully EOL. (Not least of which, I don't actually believe PROVIDES and CONFLICTS work properly in those older branches)

The issue, which is fixed by this issue, happens in all OpenWrt versions, which I used and reported, it there. It started since OpenWrt 18.06 version and those PROVIDES, CONFLICTS are working there.

I should wait a little bit with backporting it, though. :(

Recursive dependency addresses this PR #19714

@karlp

karlp commented Oct 26, 2022

Copy link
Copy Markdown
Contributor

I am still strongly opposed to backporting fixes that far. It's not even remotely a security issue, which you could make a case for applying to EOL software. You're giving very mixed signals, and it's largely an abuse of your privilege level to make personally satisfying fixes like this.

@ynezz

ynezz commented Oct 27, 2022

Copy link
Copy Markdown
Member

Strange that this apparently already got backported also to the branches already at end-of-life status.

Sorry for hijacking this, but FYI I find this backports very strange as well so I'm wondering if there is something we can do to prevent this.

@BKPepe

BKPepe commented Oct 27, 2022

Copy link
Copy Markdown
Member Author

Guys, excuse me, but why you didn't take care of it two years ago when it was reported to you - #11632 ? Nobody takes the initiative to fix it and provide users friendly way to install those packages side by side and you let users to handle it by themselves by using --force-overwrite? This is not a breaking change for users, it is just using CONFLICTS and PROVIDES, which is in OpenWrt for many years.

If there is something we can do to prevent this.

If OpenWrt developers would be united first, so it meets some software standards and maintenance quality, right? You should not pinpoint fingers to others if OpenWrt developers are not doing that in the main repository. Just by doing a quick look: openwrt/openwrt@2050bc4 and I can find more, if you prefer.
I can said the same for patches, which are present in OpenWrt and they does not follow what is said here https://openwrt.org/docs/guide-developer/toolchain/use-patches-with-buildsystem#naming_patches

We can discuss, if users can wait until you release a new version when they would have those packages are not.
FYI: It is not just me, who does it. Reference: 0247d72 and 8c028f4

I think many OpenWrt developers just simply don't take care of this repository and now they want to increase its quality, yes. It makes sense to help us, of course, every single hand who will help us is appreciated, but if we want to get a response from OpenWrt team members, it is very hard and almost impossible to get any reaction from them.

@ynezz

ynezz commented Oct 27, 2022

Copy link
Copy Markdown
Member

BTW IIUC then none of the your referenced commit examples are having potential to break existing users of stable release branches, but I might be of course wrong, so any link to havoc caused by those changes would be welcome.

@BKPepe

BKPepe commented Oct 27, 2022

Copy link
Copy Markdown
Member Author

Dude, since you hijacked this thread, where you quote something about don't add new packages or don't do major upgrades, I show you examples that it happens more often, and you did not even respond to it. I can ask the same question: "What should we do to prevent this"? The same applies to adding new devices to the stable branches, right? That's why you need to start and look at things that are happening and you can not see them when you are part of OpenWrt dev team.

Yes, mistakes/bugs happen. That's why there is a race condition in Python, and build testing in GitHub Actions can not reveal this, or it will be retriggered for the failed job. It is a pity that nobody has looked at it so far, but someone will need to take a look at it for an upcoming stable release, right? Then it can be backported to OpenWrt 22.03 to fix it. Also, I can bring the opposite point of view. Are you going to look for the rest failing packages in OpenWrt 22.03?

Because, like now, it seems to me like you found someone who is clearly doing wrong things in the packages repository, and you did not bother to look at the main repo or for the rest feeds, which OpenWrt is using and wants to prevent things when I need to say that you did not seem to be much interested in this repository. What I need to say and what would satisfy you in the first place is to fix the race condition, I got your point, but I can not look at it right now. I have other priorities for now.

@petrkr

petrkr commented Jan 31, 2023

Copy link
Copy Markdown

Is there any way how to change openssl for full package without uninstall everything dependend on it?

root@turris:~# opkg install libwebsockets-full
Installing libwebsockets-full (3.1.0-2) to root...
Downloading https://repo.turris.cz/hbt/omnia/packages/packages/libwebsockets-full_3.1.0-2_arm_cortex-a9_vfpv3-d16.ipk
Collected errors:
 * check_data_file_clashes: Package libwebsockets-full wants to install file /usr/lib/libwebsockets.so
	But that file is already provided by package  * libwebsockets-openssl
 * check_data_file_clashes: Package libwebsockets-full wants to install file /usr/lib/libwebsockets.so.14
	But that file is already provided by package  * libwebsockets-openssl
 * opkg_install_cmd: Cannot install package libwebsockets-full.

Well. so try uninstall it...

root@turris:~# opkg remove libwebsockets-openssl
No packages removed.
Collected errors:
 * print_dependents_warning: Package libwebsockets-openssl is depended upon by packages:
 * print_dependents_warning: 	mosquitto-ssl
 * print_dependents_warning: These might cease to work if package libwebsockets-openssl is removed.

 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.


root@turris:~# opkg remove libwebsockets-openssl mosquitto-ssl
No packages removed.
Collected errors:
 * print_dependents_warning: Package libwebsockets-openssl is depended upon by packages:
 * print_dependents_warning: 	mosquitto-ssl
 * print_dependents_warning: These might cease to work if package libwebsockets-openssl is removed.

 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.
No packages removed.
Collected errors:
 * print_dependents_warning: Package mosquitto-ssl is depended upon by packages:
 * print_dependents_warning: 	fosquitto
 * print_dependents_warning: These might cease to work if package mosquitto-ssl is removed.

 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.


root@turris:~# opkg remove libwebsockets-openssl mosquitto-ssl fosquitto
No packages removed.
Collected errors:
 * print_dependents_warning: Package libwebsockets-openssl is depended upon by packages:
 * print_dependents_warning: 	mosquitto-ssl
 * print_dependents_warning: These might cease to work if package libwebsockets-openssl is removed.

 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.
No packages removed.
Collected errors:
 * print_dependents_warning: Package mosquitto-ssl is depended upon by packages:
 * print_dependents_warning: 	fosquitto
 * print_dependents_warning: These might cease to work if package mosquitto-ssl is removed.

 * print_dependents_warning: Force removal of this package with --force-depends.
 * print_dependents_warning: Force removal of this package and its dependents
 * print_dependents_warning: with --force-removal-of-dependent-packages.
No packages removed.
Collected errors:
 * print_dependents_warning: Package fosquitto is depended upon by packages:
 * print_dependents_warning: 	foris-controller-app
 * print_dependents_warning: 	foris-ws
 * print_dependents_warning: 	reforis
 * print_dependents_warning: These might cease to work if package fosquitto is removed.

really do not want uninstall half system just to replace one package in order to install luci-app-dockerman

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

Successfully merging this pull request may close these issues.

[master,22.03,21.02,19.07,18.06] ttyd: can not be installed it due conflict libwebsockets-full/openssl

5 participants