https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8020

            Bug ID: 8020
           Summary: Too many dependencies in
                    Mail::SpamAssassin:Util::DependencyInfo.pm
           Product: Spamassassin
           Version: 4.0.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Building & Packaging
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: Undefined

Mail::SpamAssassin:Util::DependencyInfo::try_binary() calls
Mail::SpamAssassin::Util::find_executable_in_env_path()

The problem is that Mail::SpamAssassin::Util requires non-core modules, for
example NetAddr::IP. If that module is not installed when Makefile.PL calls
Mail::SpamAssassin::Util::DependencyInfo::long_diagnostics() then instead of
printing diagnostics and returning a value indicating the missing module, the
function fails the use NetAddr::IP and dies.

This breaks CPAN testing on test machines that do not have NetAddr::IP
pre-installed because instead of discovering that NetAddr::IP is a dependency,
installing it, and continuing, the test fails early. That is not a common
configuration for the test machines, but I am seeing some.

I'm conflicted about the best way to fix this, considering that the functions
in Util form a public API that could be in use by third parties, so maybe
should not be simply changed. Otherwise, we could move long_diagnostics() and
the various functions it depends on to a new module, resulting in an API
change.

Alternatively, we can move long_diagnostics() and the functions it calls into a
new module but leave functions of the same name in Util that call them, to
preserve the API.

A third alternative is to replace the use NetAddr::IP and any other use of a
non-core module with something that does eval of require and so doesn't die
when a function that doesn't need the missing module is called.

Comments or suggestions?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to