amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
522 stars 39 forks source link

[Bug] - curl should require libcurl-full #772

Open daniejstriata opened 1 month ago

daniejstriata commented 1 month ago

Is your feature request related to a problem? Please describe. I swapped out curl-minimal for curl.

Installing:
curl                                 x86_64                         8.5.0-1.amzn2023.0.4                          amazonlinux                         373 k
Removing:
curl-minimal                         x86_64                         8.5.0-1.amzn2023.0.4                          @System                             284 k

As can be seen the libcurl package did not get changed as well. Can the requirements for curl and curl-minimal not require the appropriate library package?

→ curl --version
curl 8.5.0 (x86_64-amazon-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.8 zlib/1.2.11 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.2) nghttp2/1.59.0
Release-Date: 2023-12-06
Protocols: file ftp ftps http https
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz PSL SPNEGO SSL threadsafe UnixSockets

swapping back:

# dnf swap curl curl-minimal
Last metadata expiration check: 0:00:09 ago on Tue Aug  6 07:17:09 2024.
Dependencies resolved.
===============================================================================================================================================
 Package                          Architecture               Version                                    Repository                        Size
===============================================================================================================================================
Installing:
 curl-minimal                     x86_64                     8.5.0-1.amzn2023.0.4                       amazonlinux                      160 k
Removing:
 curl                             x86_64                     8.5.0-1.amzn2023.0.4                       @amazonlinux                     823 k

Transaction Summary
===============================================================================================================================================
Install  1 Package
Remove   1 Package
daniejstriata commented 1 month ago

I see the mistake I made. I swapped only curl and not libcurl. dnf swap libcurl-minimal libcurl -y

→ curl -V
curl 8.5.0 (x86_64-amazon-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.8 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.2) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 OpenLDAP/2.4.57
Release-Date: 2023-12-06
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets
daniejstriata commented 1 month ago

Is the curl package dependencies not broken? If I swap from curl-minimal why does the libcurl-minimal package not also change? I looked at the SPEC file and it appears that curl-minimal requires libcurl-minimal but I don't see the same logic for curl to requires libcurl.

%package -n curl-minimal
Conflicts: curl
%package -n libcurl-minimal
Conflicts: libcurl%{?_isa}
zcobol commented 1 month ago

@daniejstriata curl requires libcurl which is provided by libcurl-minimal so when you do the swap the package manager detects all requirements solved:

All the other libraries were removed from the output for clarity:

[root ~]$ rpm -q --requires curl
libcurl(x86-64) >= 8.5.0-1.amzn2023.0.4
libcurl.so.4()(64bit)

What provides libcurl:

[root ~]$  rpm -q --whatprovides libcurl
libcurl-minimal-8.5.0-1.amzn2023.0.4.x86_64

If you run ldd -v /usr/bin/curl there are no missing libraries:

ldd output ``` [root ~]$ ldd -v /usr/bin/curl linux-vdso.so.1 (0x00007ffd930f5000) libcurl.so.4 => /lib64/libcurl.so.4 (0x00007ed6955f9000) libz.so.1 => /lib64/libz.so.1 (0x00007ed6955df000) libc.so.6 => /lib64/libc.so.6 (0x00007ed6953d7000) libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007ed6953ac000) libidn2.so.0 => /lib64/libidn2.so.0 (0x00007ed69538b000) libpsl.so.5 => /lib64/libpsl.so.5 (0x00007ed695378000) libssl.so.3 => /lib64/libssl.so.3 (0x00007ed6952d0000) libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007ed694e97000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007ed694e41000) /lib64/ld-linux-x86-64.so.2 (0x00007ed6956dc000) libunistring.so.2 => /lib64/libunistring.so.2 (0x00007ed694cbb000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007ed694be0000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007ed694bc5000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007ed694bbe000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007ed694bad000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007ed694ba6000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007ed694b92000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007ed694b65000) libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007ed694ac5000) Version information: /usr/bin/curl: libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.15) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libcurl.so.4: libgssapi_krb5.so.2 (gssapi_krb5_2_MIT) => /lib64/libgssapi_krb5.so.2 libidn2.so.0 (IDN2_0.0.0) => /lib64/libidn2.so.0 libcrypto.so.3 (OPENSSL_3.0.0) => /lib64/libcrypto.so.3 libssl.so.3 (OPENSSL_3.0.0) => /lib64/libssl.so.3 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.15) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libz.so.1: libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 /lib64/libc.so.6: ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2 /lib64/libnghttp2.so.14: libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libidn2.so.0: libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libpsl.so.5: libidn2.so.0 (IDN2_0.0.0) => /lib64/libidn2.so.0 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libssl.so.3: libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libcrypto.so.3 (OPENSSL_3.0.3) => /lib64/libcrypto.so.3 libcrypto.so.3 (OPENSSL_3.0.1) => /lib64/libcrypto.so.3 libcrypto.so.3 (OPENSSL_3.0.0) => /lib64/libcrypto.so.3 /lib64/libcrypto.so.3: libc.so.6 (GLIBC_2.15) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.25) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.16) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libgssapi_krb5.so.2: libk5crypto.so.3 (k5crypto_3_MIT) => /lib64/libk5crypto.so.3 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.27) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.25) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libkrb5support.so.0 (krb5support_0_MIT) => /lib64/libkrb5support.so.0 libkrb5.so.3 (krb5_3_MIT) => /lib64/libkrb5.so.3 /lib64/libunistring.so.2: libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 /lib64/libkrb5.so.3: libresolv.so.2 (GLIBC_2.9) => /lib64/libresolv.so.2 libkeyutils.so.1 (KEYUTILS_1.5) => /lib64/libkeyutils.so.1 libkeyutils.so.1 (KEYUTILS_1.0) => /lib64/libkeyutils.so.1 libkeyutils.so.1 (KEYUTILS_0.3) => /lib64/libkeyutils.so.1 libkrb5support.so.0 (krb5support_0_MIT) => /lib64/libkrb5support.so.0 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.16) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.25) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libk5crypto.so.3 (k5crypto_3_MIT) => /lib64/libk5crypto.so.3 /lib64/libk5crypto.so.3: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 libkrb5support.so.0 (krb5support_0_MIT) => /lib64/libkrb5support.so.0 libcrypto.so.3 (OPENSSL_3.0.0) => /lib64/libcrypto.so.3 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.25) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libcom_err.so.2: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 /lib64/libkrb5support.so.0: libselinux.so.1 (LIBSELINUX_1.0) => /lib64/libselinux.so.1 libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.25) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libkeyutils.so.1: libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libresolv.so.2: libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 /lib64/libselinux.so.1: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.33) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.30) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 /lib64/libpcre2-8.so.0: libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 ```

However, since libcurl that comes with libcurl-minimal has a limited set of features compared to the libcurl package there should be a way to tell which one goes with what package. All dnf sees is that libcurl dependency is satisfied for the swap w/out knowing or caring which libcurl!

daniejstriata commented 1 month ago

I thought that it would be simple to set curl to require libcurl and obsoletes libcurl-minimal and vice versa.

ozbenh commented 1 month ago

The difficulty I think is with dnf swap ... I haven't tried (off the laptop right now) but it seems to only allow for swapping one package at a time unless I'm mistaken... and it's the "preferred" way of replacing the -minimal variants with the full ones

daniejstriata commented 1 month ago

Fedora is doing the right thing here:

# rpm -qa | grep curl
libcurl-minimal-8.6.0-10.fc40.x86_64
curl-8.6.0-10.fc40.x86_64

image There is just the curl package but you swap out the curl library. That makes it easier to facilitate the swap correctly.

stewartsmith commented 1 month ago

The likely thing would be that our packaging forked from Fedora before this change. It's probably worth a revisit, but we'd have to ensure compatibility with any setups that currently worked (ie had dnf swap in them), which may make it more difficult to do that.

elsaco commented 1 month ago

@daniejstriata what version of Fedora did you use for testing?

I see the same behavior on FC39 as on AL2023:

[elsaco@RIPPER ~]$ rpm -qa | grep curl
curl-minimal-8.2.1-5.fc39.x86_64
libcurl-minimal-8.2.1-5.fc39.x86_64

Swap curl-minimal with curl:

[elsaco@RIPPER ~]$ sudo dnf swap curl-minimal curl
Last metadata expiration check: 0:16:43 ago on Wed Aug 14 13:27:44 2024.
Dependencies resolved.
========================================================================================================================
 Package                       Architecture            Version                          Repository                 Size
========================================================================================================================
Installing:
 curl                          x86_64                  8.2.1-5.fc39                     updates                   344 k
Removing:
 curl-minimal                  x86_64                  8.2.1-5.fc39                     @updates                  268 k

Transaction Summary
========================================================================================================================
Install  1 Package
Remove   1 Package

Total download size: 344 k
Is this ok [y/N]: y
Downloading Packages:
curl-8.2.1-5.fc39.x86_64.rpm                                                            534 kB/s | 344 kB     00:00
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   329 kB/s | 344 kB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                1/1
  Installing       : curl-8.2.1-5.fc39.x86_64                                                                       1/2
  Erasing          : curl-minimal-8.2.1-5.fc39.x86_64                                                               2/2
  Running scriptlet: curl-minimal-8.2.1-5.fc39.x86_64                                                               2/2

  Verifying        : curl-8.2.1-5.fc39.x86_64                                                                       1/2
  Verifying        : curl-minimal-8.2.1-5.fc39.x86_64                                                               2/2

Installed:
  curl-8.2.1-5.fc39.x86_64
Removed:
  curl-minimal-8.2.1-5.fc39.x86_64

Complete!

Verify:

[elsaco@RIPPER ~]$ rpm -qa | grep curl
libcurl-minimal-8.2.1-5.fc39.x86_64
curl-8.2.1-5.fc39.x86_64

Notice that libcurl-minimal was not replaced with libcurl, just like in AL2023

Swap libcurl-minimal with libcurl:

[elsaco@RIPPER ~]$ sudo dnf swap libcurl-minimal libcurl
Last metadata expiration check: 0:19:04 ago on Wed Aug 14 13:27:44 2024.
Dependencies resolved.
========================================================================================================================
 Package                         Architecture           Version                          Repository                Size
========================================================================================================================
Installing:
 libcurl                         x86_64                 8.2.1-5.fc39                     updates                  322 k
Installing dependencies:
 libssh                          x86_64                 0.10.6-2.fc39                    updates                  212 k
 libssh-config                   noarch                 0.10.6-2.fc39                    updates                  9.0 k
Removing:
 libcurl-minimal                 x86_64                 8.2.1-5.fc39                     @updates                 570 k

Transaction Summary
========================================================================================================================
Install  3 Packages
Remove   1 Package

Total download size: 544 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): libssh-config-0.10.6-2.fc39.noarch.rpm                                            30 kB/s | 9.0 kB     00:00
(2/3): libssh-0.10.6-2.fc39.x86_64.rpm                                                  363 kB/s | 212 kB     00:00
(3/3): libcurl-8.2.1-5.fc39.x86_64.rpm                                                  487 kB/s | 322 kB     00:00
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   494 kB/s | 544 kB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                1/1
  Installing       : libssh-config-0.10.6-2.fc39.noarch                                                             1/4
  Installing       : libssh-0.10.6-2.fc39.x86_64                                                                    2/4
  Installing       : libcurl-8.2.1-5.fc39.x86_64                                                                    3/4
  Erasing          : libcurl-minimal-8.2.1-5.fc39.x86_64                                                            4/4
  Running scriptlet: libcurl-minimal-8.2.1-5.fc39.x86_64                                                            4/4

  Verifying        : libcurl-8.2.1-5.fc39.x86_64                                                                    1/4
  Verifying        : libssh-0.10.6-2.fc39.x86_64                                                                    2/4
  Verifying        : libssh-config-0.10.6-2.fc39.noarch                                                             3/4
  Verifying        : libcurl-minimal-8.2.1-5.fc39.x86_64                                                            4/4

Installed:
  libcurl-8.2.1-5.fc39.x86_64          libssh-0.10.6-2.fc39.x86_64          libssh-config-0.10.6-2.fc39.noarch
Removed:
  libcurl-minimal-8.2.1-5.fc39.x86_64

Complete!

Now libcurl-minimal was replaced with libcurl.

daniejstriata commented 1 month ago

I tested on FC40.