Dmitry Selyutin
2018-02-10 16:32:08 UTC
During implementing support for --conditional-dependencies option I've found a
strange behavior, which makes me thinking that I don't quite get how module's
conditional state is being calculated. Let's consider the following gnulib-
tool invocation:
gnulib-tool --with-tests --conditional-dependencies --no-changelog --aux-dir
build-aux --doc-base doc --lib libgnu --m4-base m4/ --source-base lib/ --
tests-base tests --local-dir gl --makefile-name=gnulib.mk --libtool --import
fnmatch vasnprintf
Upon executing the same command with pygnulib.py from "python" branch, I
clearly see the difference between way how modules are treat as conditional.
For example, module configmake is considered to be conditional by pygnulib.py
and unconditional by gnulib-tool. Here are all the possible paths which lead
to configmake module, collected via TransitiveClosure.paths("configmake")
invocation):
('configmake', 'localcharset', 'mbrtowc', 'mbsinit-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsrtowcs-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'mbrtowc-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'fnmatch')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'mbsrtowcs-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'wcrtomb', 'wctomb',
'wctob', 'mbrtowc-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'wcrtomb', 'wctomb',
'wctob', 'mbsrtowcs-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsrtowcs', 'fnmatch')
('configmake', 'localcharset', 'mbrtowc', 'mbtowc', 'btowc', 'wcrtomb-tests')
The relationship between configmake and localcharset is an unconditional
dependency; however, localcharset is listed as a conditional dependency in
mbrtowc "Depends-on" section, and thus it seems reasonable that not only
localcharset is a conditional dependency, but all modules required by it.
No other module seem to require localcharset except of mbrtowc.
1) mbrtowc is the only one module which requires localcharset;
2) mbrtowc requires localcharset conditionally;
3) all the dependencies of localcharset shall be considered conditional.
Is the following assumption correct and I've found a bug in gnulib-tool, or am
I misunderstanding the whole concept of conditional dependencies? I'd be very
grateful if someone could help me with this issue, currently it is the last
part of the support for --conditional-dependencies in Python.
Thank you!
strange behavior, which makes me thinking that I don't quite get how module's
conditional state is being calculated. Let's consider the following gnulib-
tool invocation:
gnulib-tool --with-tests --conditional-dependencies --no-changelog --aux-dir
build-aux --doc-base doc --lib libgnu --m4-base m4/ --source-base lib/ --
tests-base tests --local-dir gl --makefile-name=gnulib.mk --libtool --import
fnmatch vasnprintf
Upon executing the same command with pygnulib.py from "python" branch, I
clearly see the difference between way how modules are treat as conditional.
For example, module configmake is considered to be conditional by pygnulib.py
and unconditional by gnulib-tool. Here are all the possible paths which lead
to configmake module, collected via TransitiveClosure.paths("configmake")
invocation):
('configmake', 'localcharset', 'mbrtowc', 'mbsinit-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsrtowcs-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'mbrtowc-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'fnmatch')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'mbsrtowcs-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'wcrtomb', 'wctomb',
'wctob', 'mbrtowc-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsinit', 'wcrtomb', 'wctomb',
'wctob', 'mbsrtowcs-tests')
('configmake', 'localcharset', 'mbrtowc', 'mbsrtowcs', 'fnmatch')
('configmake', 'localcharset', 'mbrtowc', 'mbtowc', 'btowc', 'wcrtomb-tests')
The relationship between configmake and localcharset is an unconditional
dependency; however, localcharset is listed as a conditional dependency in
mbrtowc "Depends-on" section, and thus it seems reasonable that not only
localcharset is a conditional dependency, but all modules required by it.
No other module seem to require localcharset except of mbrtowc.
1) mbrtowc is the only one module which requires localcharset;
2) mbrtowc requires localcharset conditionally;
3) all the dependencies of localcharset shall be considered conditional.
Is the following assumption correct and I've found a bug in gnulib-tool, or am
I misunderstanding the whole concept of conditional dependencies? I'd be very
grateful if someone could help me with this issue, currently it is the last
part of the support for --conditional-dependencies in Python.
Thank you!
--
With best regards,
Dmitry Selyutin
With best regards,
Dmitry Selyutin