public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND,
@ 2024-11-01 18:28 Desarrollos WEB
  2024-11-01 18:36 ` Nowa Ammerlaan
  0 siblings, 1 reply; 3+ messages in thread
From: Desarrollos WEB @ 2024-11-01 18:28 UTC (permalink / raw
  To: gentoo-dev

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND,
  2024-11-01 18:28 [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND, Desarrollos WEB
@ 2024-11-01 18:36 ` Nowa Ammerlaan
  2024-11-01 18:57   ` Eli Schwartz
  0 siblings, 1 reply; 3+ messages in thread
From: Nowa Ammerlaan @ 2024-11-01 18:36 UTC (permalink / raw
  To: gentoo-dev

On 01/11/2024 19:28, Desarrollos WEB wrote:
> 
> 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.
> 

Please see chapter 10 of the PMS: 
https://dev.gentoo.org/~ulm/pms/head/pms.html#chapter-10

accumulate-vars The IUSE, REQUIRED_USE, DEPEND, BDEPEND, RDEPEND, 
PDEPEND and IDEPEND variables are handled specially when set by an 
eclass. They must be accumulated across eclasses, appending the value 
set by each eclass to the resulting value after the previous one is 
loaded. For EAPIs listed in table 10.1 as accumulating PROPERTIES and 
RESTRICT, the same is true for these variables. Then the eclass-defined 
value is appended to that defined by the ebuild. In the case of RDEPEND, 
this is done after the implicit RDEPEND rules in section 7.3.7 are applied.

Your issue is not what you think it is, looks to me like a missing 
BDEPEND on setuptools, please report it as a bug.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND,
  2024-11-01 18:36 ` Nowa Ammerlaan
@ 2024-11-01 18:57   ` Eli Schwartz
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Schwartz @ 2024-11-01 18:57 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 317 bytes --]

On 11/1/24 2:36 PM, Nowa Ammerlaan wrote:
> Your issue is not what you think it is, looks to me like a missing
> BDEPEND on setuptools, please report it as a bug.


It already properly depends on setuptools for zenmap, problem is that
ndiff is *also* a python module and is not handled.


-- 
Eli Schwartz

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-01 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-01 18:28 [gentoo-dev] Serious problem with inheritance of RDEPEND, BDEPEND, DEPEND, Desarrollos WEB
2024-11-01 18:36 ` Nowa Ammerlaan
2024-11-01 18:57   ` Eli Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox