Bug 16027 - problems building on fedora-40
Summary: problems building on fedora-40
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
: 16051 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-09 18:45 UTC by stsp
Modified: 2024-06-15 15:22 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stsp 2024-04-09 18:45:31 UTC
I am trying to build the latest buildroot
from git on fedora-40. What I get for menuconfig, is:

 *** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 *** 
 *** Install ncurses (ncurses-devel or libncurses-dev 
 *** depending on your distribution) and try again.
 *** 

$ rpm -q ncurses-devel
ncurses-devel-6.4-12.20240127.fc40.x86_64

What I get for linux-menuconfig, is:

make: Entering directory '/home/stas/src/fdpp-buildroot/buildroot'
support/dependencies/check-host-cmake.sh: line 35: [: cmake: integer expression expected
support/dependencies/check-host-cmake.sh: line 38: [: cmake: integer expression expected
Comment 1 stsp 2024-04-09 19:21:12 UTC
Here is the fix for menuconfig:

diff --git a/support/kconfig/lxdialog/check-lxdialog.sh b/support/kconfig/lxdialog/check-lxdialog.sh
index 16cd9a3186..98bc150a0f 100755
--- a/support/kconfig/lxdialog/check-lxdialog.sh
+++ b/support/kconfig/lxdialog/check-lxdialog.sh
@@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
 check() {
         $cc -x c - -o $tmp 2>/dev/null <<'EOF'
 #include CURSES_LOC
-main() {}
+int main() { return 0; }
 EOF
        if [ $? != 0 ]; then
            echo " *** Unable to find the ncurses libraries or the"       1>&2
Comment 2 stsp 2024-04-09 19:23:44 UTC
Further problems:

>>> host-libzlib 1.2.12 Downloading
wget --passive-ftp -nd -t 3 -O '/home/stas/src/fdpp-buildroot/buildroot/output/build/.zlib-1.2.12.tar.xz.18scLK/output' 'http://www.zlib.net/zlib-1.2.12.tar.xz' 
Unknown option 'passive-ftp'
Comment 3 stsp 2024-04-09 19:42:21 UTC
Further problem:

make[3]: Entering directory '/home/stas/src/fdpp-buildroot/buildroot/output/build/host-util-linux-2.38'
  CCLD     libcommon.la
  CCLD     libtcolors.la
  CC       misc-utils/kill.o
  CC       sys-utils/ctrlaltdel.o
  CC       sys-utils/fsfreeze.o
  CC       sys-utils/blkdiscard-blkdiscard.o
misc-utils/kill.c: In function 'kill_with_timeout':
misc-utils/kill.c:397:20: error: implicit declaration of function 'pidfd_open'; did you mean 'fdopen'? [-Wimplicit-function-declaration]
  397 |         if ((pfd = pidfd_open(ctl->pid, 0)) < 0)
Comment 4 swerve_olive366 2024-04-30 14:13:48 UTC
Did you manage to fix it? If yes, can you please share the solution?
Comment 5 stsp 2024-04-30 14:59:31 UTC
There was something wrong on my side,
I suppose. Maybe the CFLAGS var was
mistakenly exported with -Werror parameter.
I rechecked all my fixes now, and they
are not needed, eg missing `int` before
`main` only produces the warning, so ncurses
are now working again.
Comment 6 swerve_olive366 2024-05-01 05:30:52 UTC
Indeed, ncurses is working again. What about the error in comment #2? Is it working for you?

I have fedora 40 too, but after running `make` I still get an error:

Unknown option 'passive-ftp'
make: *** [package/pkg-generic.mk:179: /buildroot/output/build/host-pkgconf-1.6.3/.stamp_downloaded] Error 1
Comment 7 stsp 2024-05-01 07:25:58 UTC
Ah, completely forgot about this one!

Since menuconfig now works, please navigate
to "Build options" -> "Commands" -> "Wget command"
and remove "passive-ftp" from there.
Comment 8 Yann E. MORIN 2024-05-01 09:53:51 UTC
stsp, All,

Thanks for the report.

The menuconfig issue has been fixed with commit a6210d28db (kconfig/lxdialog: fix check() with GCC14).

As for the wget issue, please refer to the release notes of your distribution:

    https://docs.fedoraproject.org/en-US/fedora/latest/release-notes/

Quoting:
    The wget command in Fedora 40 uses Wget2.

Amd a little trivial web-search turns up:
    https://fedoraproject.org/wiki/Changes/Wget2asWget

And of course, it all quickly leads to:
    https://gitlab.com/gnuwget/wget2/-/wikis/Home#different-behavior-of-wget2

The current workaround is indeed to remove --passive-ftp from the wget command
line, but thisis not a vial long-term solution, because it means it is no longer
possible to do ftp downloads (which although legacy, still exist). The proper
solution would be to contribute a patch that solves the issue.

I think a good solution would be two fold:
  - introduce a new download backend specifically for ftp
  - drop --passive-ftp from the default wget command line

Regards,
Yann E. MORIN.
Comment 9 stsp 2024-05-01 10:08:04 UTC
How about just switching to curl, instead
of playing around the legacy stuff as wget is?
Ok maybe wget2 is not legacy, but you never
know, as now debian-based distros will have
wget1, and fedora-based - wget2, all under
the same name.
Comment 10 Yann E. MORIN 2024-05-01 15:08:52 UTC
Hello.

> How about just switching to curl, instead
> of playing around the legacy stuff as wget is?

1. wget is not legacy. cURL and wget were initialy released at about the
same period, in 1996 [0] [1]; both saw their latest release in March 2024.
Hard to say that wget is legacy without saying so for cURL.

[0] https://en.wikipedia.org/wiki/Wget  => January 1996
[1] https://en.wikipedia.org/wiki/CURL  => November 1996

2. cURL can be configured without FTP support [2], so if switching from wget
to wget2 was done, knowing that FTP was dropped, and considering that was
acceptable on the basis that FTP is legacy (broken, insecure...), then it
is not inconceivalbe that distros may consider truning FTP off in their builds
of cURL, ion the same basis (broken, insecure...). Switching to cURL would
not solve the issue. Yes, it is a bit far-fetched, but given the reasoning
behind wget2 switch, it is legit to consider it for other tools that are not
FTP-only.

[2] https://github.com/curl/curl/blob/master/configure.ac#L631

3. Existing packages (in external trees) may use wget's authentication options
yo authenticate to an HTTP server; switching to cURL would break them. That
also applies to existing (def)config files that use non-standard options, like
--no-proxy to talk to internal servers, or --load-cookies with a pre-build
script that authenticates against an internal server or filled by a CI/CD
job, etc...

4. For all things HTTP-related, wget2 is expected to be option-compatible with
wget.

5. As a consequence, it feels more appropriate to keep using wget for HTTP/S
downloads, and use a tool dedicated to FTP for FTP downloads, and implemented
as a separate backend in Buildroot.

Regards,
Yann E. MORIN,
Comment 11 daveth 2024-06-08 13:00:35 UTC
*** Bug 16051 has been marked as a duplicate of this bug. ***
Comment 12 Yann E. MORIN 2024-06-15 15:22:27 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!