public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Desarrollos WEB <web@inode64.com>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND,
Date: Fri, 1 Nov 2024 19:28:31 +0100	[thread overview]
Message-ID: <e04472ef-116d-48a8-8975-cd551103ecc1@inode64.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4417 bytes --]

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



[-- Attachment #2: Type: text/html, Size: 6043 bytes --]

             reply	other threads:[~2024-11-01 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01 18:28 Desarrollos WEB [this message]
2024-11-01 18:36 ` [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND, Nowa Ammerlaan
2024-11-01 18:57   ` Eli Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e04472ef-116d-48a8-8975-cd551103ecc1@inode64.com \
    --to=web@inode64.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox