[gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPE
From
Desarrollos WEB@21:1/5 to
All on Fri Nov 1 19:30:01 2024
This is a multi-part message in MIME format.
I have discovered an issue that affects multiple ebuilds
Analyzing the causes of why nmap gives an error when it is updated and
at the same time the python version is changed, it generates an error
that setuptool cannot find
x86_64-pc-linux-gnu-g++ -c -DNOLUA -I./libdnet-stripped/include
-I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_PLATFORM=\"x86_64-pc-linux-gnu\"
-DNMAPDATADIR=\"/usr/share/nmap\" -O2 -pipe -march=native
-fomit-frame-pointer -Wall -fno-strict-aliasing utils.cc -o utils.o x86_64-pc-linux-gnu-g++ -c -DNOLUA -I./libdnet-stripped/include
-I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_PLATFORM=\"x86_64-pc-linux-gnu\"
-DNMAPDATADIR=\"/usr/share/nmap\" -O2 -pipe -march=native
-fomit-frame-pointer -Wall -fno-strict-aliasing xml.cc -o xml.o x86_64-pc-linux-gnu-g++ -c -DNOLUA -I./libdnet-stripped/include
-I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_PLATFORM=\"x86_64-pc-linux-gnu\"
-DNMAPDATADIR=\"/usr/share/nmap\" -O2 -pipe -march=native
-fomit-frame-pointer -Wall -fno-strict-aliasing main.cc -o main.o
cd ndiff && /usr/bin/python3.12 setup.py build
Traceback (most recent call last):
File "/var/tmp/portage/net-analyzer/nmap-7.95/work/nmap-7.95/ndiff/setup.py",
line 11, in <module>
import setuptools.command.install
ModuleNotFoundError: No module named 'setuptools'
make: *** [Makefile:381: build-ndiff] Error 1
make: *** Waiting for unfinished jobs....
* ERROR: net-analyzer/nmap-7.95::gentoo failed (compile phase):
* emake failed
*
* If you need support, post the output of `emerge --info '=net-analyzer/nmap-7.95::gentoo'`,
* the complete build log and the output of `emerge -pqv '=net-analyzer/nmap-7.95::gentoo'`.
* The complete build log is located at '/var/tmp/portage/net-analyzer/nmap-7.95/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/net-analyzer/nmap-7.95/temp/environment'.
* Working directory: '/var/tmp/portage/net-analyzer/nmap-7.95/work/nmap-7.95'
* S: '/var/tmp/portage/net-analyzer/nmap-7.95/work/nmap-7.95'
Inspecting both the ebuild and the distutils-r1 eclass I see that within
this eclass you can modify RDEPEND , BDEPEND, DEPEND, REQUIRED_USE and
IUSE, then when viewing the nmap ebuild, I see that BDEPEND is directly modified without preserving all the previous values, attached nmap code
*BDEPEND="
${PYTHON_DEPS}
virtual/pkgconfig
nls? ( sys-devel/gettext )
zenmap? ( ${DISTUTILS_DEPS} )
"*
Seeing this problem, you should always use the variables RDEPEND,
BDEPEND, DEPEND, adding content, not replacing it (of course, there may
be a special case), but as a general rule you should add, not replace,
these variables, both in eclass and ebuilds.
It would have to be added instead of replacing using BDEPEND+= RDEPEND+= DEPEND+=
-- new nmap.ebuild --
IUSE+=" ipv6 libssh2 ncat ndiff nping nls +nse ssl symlink zenmap" REQUIRED_USE+="
nse? ( ${LUA_REQUIRED_USE} )
symlink? ( ncat )
"
RDEPEND+="
dev-libs/liblinear:=
dev-libs/libpcre2
net-libs/libpcap
ndiff? ( ${PYTHON_DEPS} )
libssh2? (
net-libs/libssh2[zlib]
sys-libs/zlib
)
nls? ( virtual/libintl )
nse? (
${LUA_DEPS}
sys-libs/zlib
)
ssl? ( dev-libs/openssl:= )
symlink? (
ncat? (
!net-analyzer/netcat
!net-analyzer/openbsd-netcat
)
)
zenmap? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/pygobject:3[${PYTHON_USEDEP}]
')
)
"
DEPEND+=" ${RDEPEND}"
# Python is always needed at build time for some scripts
BDEPEND+="
virtual/pkgconfig
nls? ( sys-devel/gettext )
zenmap? ( ${DISTUTILS_DEPS} )
"
I removed ${PYTHON_DEPS} because it is inherited from distutils-r1
<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<p>I have discovered an issue that affects multiple ebuilds<br>
Analyzing the causes of why nmap gives an error when it is updated
and at the same time the python version is changed, it generates
an error that setuptool cannot find<font face="monospace"><br>
</font></p>
<p><font face="monospace">x86_64-pc-linux-gnu-g++ -c -DNOLUA
-I./libdnet-stripped/include -I./nbase -I./nsock/include
-DHAVE_CONFIG_H -DNMAP_PLATFORM=\"x86_64-pc-linux-gnu\"
-DNMAPDATADIR=\"/usr/share/nmap\" -O2 -pipe -march=native
-fomit-frame-pointer -Wall -fno-strict-aliasing utils.cc -o
utils.o<br>
x86_64-pc-linux-gnu-g++ -c -DNOLUA -I./libdnet-stripped/include
-I./nbase -I./nsock/include -DHAVE_CONFIG_H
-DNMAP_PLATFORM=\"x86_64-pc-linux-gnu\"
-DNMAPDATADIR=\"/usr/share/nmap\" -O2 -pipe -march=native
-fomit-frame-pointer -Wall -fno-strict-aliasing xml.cc -o
xml.o<br>
x86_64-pc-linux-gnu-g++ -c -DNOLUA -I./libdnet-stripped/include
-I./nbase -I./nsock/include -DHAVE_CONFIG_H
-DNMAP_PLATFORM=\"x86_64-pc-linux-gnu\"
-DNMAPDATADIR=\"/usr/share/nmap\" -O2 -pipe -march=native
-fomit-frame-pointer -Wall -fno-strict-aliasing main.cc -o
main.o<br>
cd ndiff && /usr/bin/python3.12 setup.py build <br>
Traceback (most recent call last):<br>
File
"/var/tmp/portage/net-analyzer/nmap-7.95/work/nmap-7.95/ndiff/setup.py",
line 11, in <module><br>
import setuptools.command.install<br>
ModuleNotFoundError: No module named 'setuptools'<br>
make: *** [Makefile:381: build-ndiff] Error 1<br>
make: *** Waiting for unfinished jobs....<br>
* ERROR: net-analyzer/nmap-7.95::gentoo failed (compile phase):<br>
* emake failed<br>
* <br>
* If you need support, post the output of `emerge --info
'=net-analyzer/nmap-7.95::gentoo'`,<br>
* the complete build log and the output of `emerge -pqv
'=net-analyzer/nmap-7.95::gentoo'`.<br>
* The complete build log is located at
'/var/tmp/portage/net-analyzer/nmap-7.95/temp/build.log'.<br>
* The ebuild environment file is located at
'/var/tmp/portage/net-analyzer/nmap-7.95/temp/environment'.<br>
* Working directory:
'/var/tmp/portage/net-analyzer/nmap-7.95/work/nmap-7.95'<br>
* S: '/var/tmp/portage/net-analyzer/nmap-7.95/work/nmap-7.95'</font><br>
<br>
</p>
<p><br>
Inspecting both the ebuild and the distutils-r1 eclass I see that
within this eclass you can modify RDEPEND , BDEPEND, DEPEND,
REQUIRED_USE and IUSE, then when viewing the nmap ebuild, I see
that BDEPEND is directly modified without preserving all the
previous values, attached nmap code<br>
<br>
<b>BDEPEND="<br>
${PYTHON_DEPS}<br>
virtual/pkgconfig<br>
nls? ( sys-devel/gettext )<br>
zenmap? ( ${DISTUTILS_DEPS} )<br>
"</b><br>
<br>
<br>
Seeing this problem, you should always use the variables RDEPEND,
BDEPEND, DEPEND, adding content, not replacing it (of course,
there may be a special case), but as a general rule you should
add, not replace, these variables, both in eclass and ebuilds. <br>
<br>
It would have to be added instead of replacing using BDEPEND+=
RDEPEND+= DEPEND+=</p>
<p>-- new nmap.ebuild --<br>
</p>
<p><font face="monospace">IUSE+=" ipv6 libssh2 ncat ndiff nping nls
+nse ssl symlink zenmap"<br>
REQUIRED_USE+="<br>
nse? ( ${LUA_REQUIRED_USE} )<br>
symlink? ( ncat )<br>
"<br>
<br>
RDEPEND+="<br>
dev-libs/liblinear:=<br>
dev-libs/libpcre2<br>
net-libs/libpcap<br>
ndiff? ( ${PYTHON_DEPS} )<br>
libssh2? (<br>
net-libs/libssh2[zlib]<br>
sys-libs/zlib<br>
)<br>
nls? ( virtual/libintl )<br>
nse? (<br>
${LUA_DEPS}<br>
sys-libs/zlib<br>
)<br>
ssl? ( dev-libs/openssl:= )<br>
symlink? (<br>
ncat? (<br>
!net-analyzer/netcat<br>
!net-analyzer/openbsd-netcat<br>
)<br>
)<br>
zenmap? (<br>
${PYTHON_DEPS}<br>
$(python_gen_cond_dep '<br>
dev-python/pygobject:3[${PYTHON_USEDEP}]<br>
')<br>
)<br>
"<br>
DEPEND+=" ${RDEPEND}"<br>
# Python is always needed at build time for some scripts<br>
BDEPEND+="<br>
virtual/pkgconfig<br>
nls? ( sys-devel/gettext )<br>
zenmap? ( ${DISTUTILS_DEPS} )<br>
"</font></p>
<p><font face="monospace"><br>
</font></p>
<p><font face="monospace">I removed ${PYTHON_DEPS} because it is
inherited from distutils-r1</font></p>
<p><font face="monospace"><br>
</font></p>
<p><br>
</p>
<lt-container></lt-container>
</body>
</html>
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)