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

Ubuntu 24.04: kerl generates a warning for non-existing libncurses5-dev package #518

Closed
jj1bdx opened this issue Apr 12, 2024 · 7 comments · Fixed by #521
Closed

Ubuntu 24.04: kerl generates a warning for non-existing libncurses5-dev package #518

jj1bdx opened this issue Apr 12, 2024 · 7 comments · Fixed by #521

Comments

@jj1bdx
Copy link
Contributor

jj1bdx commented Apr 12, 2024

The bug

kerl generates a warning for not having libncurses5-dev for Ubuntu, which is not in the apt library of Ubuntu 24.04

Software versions

  • Operating System: Ubuntu 24.04 (not LTS yet, development version as of 12-APR-2024)
  • Erlang/OTP: 26.2.3
  • kerl: 4.1.0

How to replicate

Running a script of otp-install-from-git-ubuntu.sh 26.2.3

otp-install-from-git-ubuntu.sh source:

#!/bin/sh
# For Ubuntu with a local OpenSSL
OTP_VERSION=$1
OPENSSL_LOCAL="/opt/openssl/3.2.1"
INSTALL_DIR_PREFIX="/home/kenji/otp/"
INSTALL_NAME=${OTP_VERSION}
#
env \
    CC=/usr/bin/cc \
    CXX=/usr/bin/c++ \
    CFLAGS="-O3 -fstack-protector-strong" LDFLAGS="-fstack-protector-strong" \
    MAKEFLAGS="-j8" \
    KERL_BUILD_DOCS="yes" \
    KERL_DOC_TARGETS="chunks" \
    KERL_BUILD_PLT="yes" \
    KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --enable-kernel-poll --enable-dirty-schedulers --disable-sctp --disable-sharing-preserving --without-javac --without-odbc --with-ssl=${OPENSSL_LOCAL} --with-wx-config=/opt/wx-3.2/bin/wx-config" \
    sh -c "(kerl build git https://github.com/jj1bdx/otp/ OTP-${OTP_VERSION} ${INSTALL_NAME} && kerl install ${INSTALL_NAME} ${INSTALL_DIR_PREFIX}${INSTALL_NAME})"

Expected behaviour

kerl generates the following WARNING message:

Checking out Erlang/OTP git repository from https://github.com/jj1bdx/otp/...
Building (git) Erlang/OTP OTP-26.2.3; please wait...
Initializing (build) log file at /home/kenji/.kerl/builds/26.2.3/otp_build_git.log.
WARNING: [packages] Probe failed for libncurses5-dev (distro: ubuntu): probe "dpkg-query -Wf'${db:Status-abbrev}' "libncurses5-dev" 2>/dev/null | \grep -q '^i'" returned 1

Additional context

Installed libncurses-related packages searched by sudo apt list | grep libncurses:

libncurses-dev/noble,now 6.4+20240113-1ubuntu1 amd64 [installed]
libncurses5/now 6.3-2ubuntu0.1 amd64 [installed,local]
libncurses6/noble,now 6.4+20240113-1ubuntu1 amd64 [installed]
libncursesada-dev/noble 6.3.20211021-11build1 amd64
libncursesada6.2.4/noble 6.3.20211021-11build1 amd64
libncursesw5/now 6.3-2ubuntu0.1 amd64 [installed,local]
libncursesw6/noble,now 6.4+20240113-1ubuntu1 amd64 [installed]

I think for Ubuntu 24.04 kerl should accept libncurses-dev instead of libncurses5-dev (not in the apt list anymore).

@jj1bdx
Copy link
Contributor Author

jj1bdx commented Apr 12, 2024

My understanding:

  • Ubuntu 22.04 LTS has libncurses5-dev.
  • Ubuntu 24.04 (to be LTS) has libncurses-dev.

@paulo-ferraz-oliveira
Copy link
Contributor

I see. Yeah, I thought I'd tested this. We'll maybe think about having a fallback mechanism for the warning, since it's still valid for 22.04 (right?).

@jj1bdx
Copy link
Contributor Author

jj1bdx commented Apr 13, 2024

Ubuntu libncurses5-dev package search result shows it's available from 20.04 until 23.04 (as a transitional package).

OTOH Ubuntu libncurses-dev search result shows it's available from 20.04 to 24.04 (noble).

Maybe changing libncurses5-dev to libncurses-dev will do, but that should be tested on an old Ubuntu.

Also, the current Ubuntu setting is inherited from that of Debian, so we also need to check out how this works on Debian.

kerl/kerl

Line 885 in 2ace937

common_debian_pkgs="${common_ALL_pkgs} libssl-dev libncurses5-dev g++"

kerl/kerl

Lines 911 to 912 in 2ace937

_KPP_ubuntu_pkgs=${common_debian_pkgs}
_KPP_ubuntu_probe="_dpkg"

@03juan
Copy link
Contributor

03juan commented May 3, 2024

For what it's worth, the ncurses announcement page for v6.5 says:

These notes are for ncurses 6.5, released April 27, 2024.

This release is designed to be source-compatible with ncurses 5.0 through 6.4; providing extensions to the application binary interface (ABI).

Debian and Ubuntu's libncurses5-dev packages all install versions that range between v6.1 and v6.4.

And then both Debian and Ubuntu's versions both support the same minimum OS release versions.

image
image

image
image

Alternatively the probe could just test with a more relaxed string.

❯ dpkg-query -l 'libncurses[^w]*dev' 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                 Version               Architecture Description
+++-====================-=====================-============-=================================
ii  libncurses-dev:amd64 6.4+20240113-1ubuntu2 amd64        developer's libraries for ncurses
un  libncurses5-dev      <none>                <none>       (no description available)

@paulo-ferraz-oliveira
Copy link
Contributor

@jj1bdx, if the probe's relaxed check seems like a good test we'd be Ok to be pull requested for the change.

@jj1bdx
Copy link
Contributor Author

jj1bdx commented May 5, 2024

@paulo-ferraz-oliveira
libncurses[^w]*dev looks good to me.

@paulo-ferraz-oliveira
Copy link
Contributor

@jj1bdx, libncurses[^w]*dev was adopted as the solution in the linked pr.

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 a pull request may close this issue.

3 participants