[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib-tool: conditional dependencies calculation

From: Dmitry Selyutin
Subject: Re: gnulib-tool: conditional dependencies calculation
Date: Thu, 28 Jun 2018 00:20:03 +0300

Hi all,

sorry for a long absence of news. I'm completely occupied by my work and lack 
time to continue working on gnulib-tool on regular basis. However, I'm 
remembering about the project, and would like to continue the work. I'd like 
to revive the old topic, already asked here.

I don't understand the way gnulib-tool calculates conditional dependencies. 
Let's consider that we import module "socket" (via `--conditional-dependencies 
--import socket` command line arguments). Here's the full dependency graph for 
_conditional_ modules:

    [['stddef', 'unistd', 'fd-hook', 'sockets', 'socket']]
    [['sockets', 'socket']]
    [['msvc-nothrow', 'socket'], ['msvc-nothrow', 'sockets', 'socket']]
    [['msvc-inval', 'msvc-nothrow', 'socket'], ['msvc-inval', 'msvc-nothrow', 
'sockets', 'socket']]
    [['fd-hook', 'sockets', 'socket']]
    [['unistd', 'fd-hook', 'sockets', 'socket']]

As you see, the graph comes to conclusion that stddef, sockets, msvc-nothrow, 
msvc-inval, fd-hook and unistd are conditional modules. Let's consider as 
example the "stddef" module; it is conditional since the "sockets" module is 
required by "socket" module under '[test "$ac_cv_header_winsock2_h" = yes]' 
condition, and it is not required to check other modules, since there is only 
one path which leads to "stddef" module inclusion. As a counter-part, let's 
consider stdaling, which is not considered conditional; here are its paths:

    ['stdalign', 'sys_socket', 'sockets', 'socket']], [['stdalign', 
'sys_socket', 'socket']

The first path is not treat as unconditional, since the "socket" module 
depends on the "sockets" module conditionally ('$ac_cv_header_winsock2_h'). 
However, the second path has no conditional dependencies in any its part, so, 
as result, the "stdalign" is considered to be imported unconditionally.

However, if I insert the simple loop which iterates over all modules after 
func_transitive_closure and prints ones which are conditional, I see that the 
following modules are marked as conditional: fd-hook, msvc-inval, msvc-
nothrow, sockets, unistd. FWIW, I've used the following code to print the 
conditional modules:

  for module in $final_modules; do
    if func_cond_module_p $module; then
      echo ">>" "$module"
  exit 1

What am I missing? It looks like pygnulib and gnulib-tool have different 
understanding of conditional modules.

Thank you for your help!

With best regards,
Dmitry Selyutin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]