On 20/02/21 23:52, Bas Mevissen wrote:
Hi all,
When starting a clean build (21.02 branch) on a clean Fedora 33 machine,
I ran into the small issue of tools/autoconf failing to build. This was
due to perl-File-Compare missing. I apparently missed that prerequisite.
After installing said package, everything built fine.
Looking at the instructions at
https://openwrt.org/docs/guide-developer/build-system/install-buildsystem#prerequisites,
listing all prerequisites, I at first did not find perl-File-Compare. It
was only at the distribution specific instructions for CentOS/Fedora
that it was mentioned.
The main list does specifically mention perl-ExtUtils-MakeMaker and
perl-Thread-Queue, so I wonder whether perl-File-Compare should be added
there as well?
It's better to add it, yes. Depending on distro you may or may not need
to install a specific package for it, but if you can't build the core
repo and its packages without it, then it should be added to the list.
Another question regarding prerequisites: is python2 still a requirement
for master and openwrt-21.02?
afaik no, the migration to python 3 was completed years ago, only
references for python2 are to make sure that the build system is NOT
using it even if it's installed or left in the build folders from
previous builds.
Anyway, it made me wonder whether the prerequisites list and test for at
least the core should be revised. I took a look at the current list and
compared them to include/prereq-build.mk from current (2021-02-20)
openwrt-21.02 branch:
PREREQ prereq-build.mk needed result
==
asciidoc no no? Q
bash yes yes OK
binutils no yes ADD
bzip2 yes yes OK
flex no hostbuild -> no REMOVE
git yes yes OK
g++ yes (no IB) yes OK
gcc yes (no IB) yes OK
time no no? Q
getopt yes yes OK
gawk yes yes OK
help2man no no? Q
intltool-update no no? Q
libelf-dev no yes ADD
libz-dev no yes ADD
make yes yes OK
ncurses yes yes OK
openssl no util? Q
patch yes yes OK
perl ExtUtils-
MakeMaker no ? Q
perl Thread-
Queue yes ? Q
python2-dev no no >19.07? Q
unzip yes yes OK
wget yes yes OK
xgettext no yes ADD
xsltproc no no REMOVE
zlib no yes ADD
The file prereq-build.mk does check for a number of other utilities that
are not in the list or only in the distribution specific requirements:
Perl Data::Dumper
tar
find
xargs
seq
grep
stat
perl (5.x)
python (>=3.5)
file
rsync
these should be probably added to the list, as the build won't start if
these are missing.
It wouldn't be a bad thing to update the prereq-build.mk file as well
with the other missing things but I'm not a core developer and I'd
rather not touch these things.
Looking at the distro specific instructions, I noticed a variation in
the advised mandatoty and optional packages to install per distro.
For example, some install asciidoc, other ccache and so on.
the variation is probably due to the fact that other packages that
aren't part of core repo might need that and the user had enabled them,
or that some options not enabled by default (like ccache) might need them.
Also there might be just legacy information from older versions (or just
wrong info) that nobody ever updated and got carried over by cargo
culting. The distro-specific information is added and updated by users
after all.
I would like to help cleaning this up, both the code and the
documentation. What I need is input on what are mandatory and what are
optional prerequisites
Mandatory prerequisites are things that are necessary for building core
repository without package feeds, and most of that stuff should be
listed in the prereq-build.mk.
Optional is what is needed to build core repo with non-default options
and to build other packages in the feeds.
This is not strictly defined, in most cases it's the package's own
source and build system that does the prerequisite check before building
and throws errors if it does not find things so you can't just check in
OpenWrt repositories.
It might not be practical to map all prerequisites of all packages
available, so you might just document how to deal with build failures
for optional packages/options (i.e. how to