Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing perl-doc dependency makes "sympa help" command output the script content #1416

Closed
dverdin opened this issue Jun 13, 2022 · 9 comments

Comments

@dverdin
Copy link
Contributor

dverdin commented Jun 13, 2022

Version

Sympa 6.2 HEAD revision

Installation method

Install from the source (upgrrade from 6.2.38).
The following commands were run:

automake --add-missing
autoconf
autoreconf -i
./configure
make
make install
cpanm --installdeps --with-recommends .
/usr/local/sympa/bin/sympa --upgrade

No installation error.

Expected behavior

Display the sympa man page

Actual behavior

The sympa script source code is displayed instead.
After leaving the viewer, a message indicating that perl-doc is required has been left on the terminal.

Steps to reproduce

Run
sympa help or sympa or any sympa help <command>.

Additional information

Installing perl-doc fixes the problem (it did not work with cpanm install, but it worked with the distribution package).

This package should be added to the dependencies when installing Sympa now, as it is mandatory to get online help - contrary to the older sympa.pl script which output itself.

As I am working on a test server, I can completely erase the installation to reinstall it from scratch.

@racke
Copy link
Contributor

racke commented Jun 13, 2022

Yes, I ran into this problem as well.

@ikedas
Copy link
Member

ikedas commented Jun 13, 2022

If there are no problem on PR above, I'll merge it.

@dverdin
Copy link
Contributor Author

dverdin commented Jun 13, 2022

Thanks for the update Soji!

It does not fix it for me, but it may be due to my server. Maybe @racke can explain where I am wrong (My test server is an old Ubuntu 16):

1- if I simply run cpanm --installdeps --with-recommends .. it does not work, event though the modules are present.
2- If I run apt install perl-doc, it works.

Probably something wrong on my side only.

@ikedas
Copy link
Member

ikedas commented Jun 13, 2022

Show us information about actual environment.

  1. Name and version of OS & Perl.
  2. Names and versions of installed modules, location of perldoc if any etc.
  3. What were shown when you reproduced from the beginning to the end.
  4. What changed in 2 after you finished the process 3 above.

[EDIT] And please provide us the accurate information. For example, if you have performed the steps you wrote in "Installation method", the installation would not be successful.

@ikedas
Copy link
Member

ikedas commented Jun 14, 2022

Looks not a bug of Sympa

It looks to me that reported behavior is not a bug of Sympa: See Dual-Life/Pod-Usage#21 .

@racke, I think the mainteners of Debian package would be better to add perl-doc as a dependency.

@dverdin
Copy link
Contributor Author

dverdin commented Jun 14, 2022

Exact sequence of installation:

apt install autoconf -y
automake --add-missing
autoconf
autoreconf -i

apt install gettext -y
./configure --prefix /usr/local/sympa/ --with-lockdir=/var/lock --without-initdir --with-unitsdir=/lib/systemd/system --with-spooldir=/var/spool/sympa --with-expldir /var/lib/sympa/list_data/
make
make install
cpanm --installdeps --with-recommends .
/usr/local/sympa/bin/sympa --upgrade

systemctl daemon-reload
systemctl restart sympa
systemctl restart wwsympa
systemctl restart sympasoap
  1. Ubuntu 16.04.7 LTS and Perl 5.22.1
  2. What was shown:
    Just after install:
Can't locate Pod/Usage.pm in @INC (you may need to install the Pod::Usage module) (@INC contains: /usr/local/sympa/bin /usr/share/mhonarc /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/local/sympa/bin/sympa line 46.
BEGIN failed--compilation aborted at /usr/local/sympa/bin/sympa line 46.

So I ran:
cpanm Pod::Usage

It failed:

! Finding Pod::Usage on cpanmetadb failed.
--> Working on Pod::Usage
Fetching http://www.cpan.org/authors/id/M/MA/MAREKR/Pod-Usage-2.03.tar.gz ... OK
Configuring Pod-Usage-2.03 ... OK
==> Found dependencies: Pod::Text, Pod::Perldoc, Pod::Simple
! Finding Pod::Text on cpanmetadb failed.
--> Working on Pod::Text
Fetching http://www.cpan.org/authors/id/R/RR/RRA/podlators-4.14.tar.gz ... OK
Configuring podlators-4.14 ... OK
==> Found dependencies: Pod::Simple
! Finding Pod::Simple on cpanmetadb failed.
--> Working on Pod::Simple
Fetching http://www.cpan.org/authors/id/K/KH/KHW/Pod-Simple-3.43.tar.gz ... OK
Configuring Pod-Simple-3.43 ... OK
==> Found dependencies: Pod::Escapes
! Finding Pod::Escapes on cpanmetadb failed.
--> Working on Pod::Escapes
Fetching http://www.cpan.org/authors/id/N/NE/NEILB/Pod-Escapes-1.07.tar.gz ... OK
Configuring Pod-Escapes-1.07 ... OK
Building and testing Pod-Escapes-1.07 ... OK
Successfully installed Pod-Escapes-1.07
Building and testing Pod-Simple-3.43 ... OK
Successfully installed Pod-Simple-3.43
Building and testing podlators-4.14 ... OK
Successfully installed podlators-4.14
! Finding Pod::Perldoc on cpanmetadb failed.
--> Working on Pod::Perldoc
Fetching http://www.cpan.org/authors/id/M/MA/MALLEN/Pod-Perldoc-3.28.tar.gz ... OK
Configuring Pod-Perldoc-3.28 ... OK
Building and testing Pod-Perldoc-3.28 ... FAIL
! Installing Pod::Perldoc failed. See /root/.cpanm/work/1655196000.27718/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Pod::Perldoc' is not installed
! Bailing out the installation for Pod-Usage-2.03.
3 distributions installed

So, force:
cpanm Pod::Usage --force

It worked:

! Finding Pod::Usage on cpanmetadb failed.
--> Working on Pod::Usage
Fetching http://www.cpan.org/authors/id/M/MA/MAREKR/Pod-Usage-2.03.tar.gz ... OK
Configuring Pod-Usage-2.03 ... OK
==> Found dependencies: Pod::Perldoc
! Finding Pod::Perldoc on cpanmetadb failed.
--> Working on Pod::Perldoc
Fetching http://www.cpan.org/authors/id/M/MA/MALLEN/Pod-Perldoc-3.28.tar.gz ... OK
Configuring Pod-Perldoc-3.28 ... OK
Building and testing Pod-Perldoc-3.28 ... FAIL
! Testing Pod-Perldoc-3.28 failed but installing it anyway.
Successfully installed Pod-Perldoc-3.28
Building and testing Pod-Usage-2.03 ... OK
Successfully installed Pod-Usage-2.03
2 distributions installed

Trying to access the help:
/usr/local/sympa/bin/sympa help
The source code is displayed:

#!/usr/bin/perl
# -*- indent-tabs-mode: nil; -*-
# vim:ft=perl:et:sw=4
# $Id$

# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[and so on]

And found the following line in my shell after quitting the viewer:
You need to install the perl-doc package to use this program.

So I installed perl-doc:
cpanm Perldoc

It succeeds:

! Finding Perldoc on cpanmetadb failed.
--> Working on Perldoc
Fetching http://www.cpan.org/authors/id/I/IN/INGY/Perldoc-0.20.tar.gz ... OK
Configuring Perldoc-0.20 ... OK
Building and testing Perldoc-0.20 ... OK
Successfully installed Perldoc-0.20
1 distribution installed

I try accessing the help again:

/usr/local/sympa/bin/sympa help

The source code is displayed:

#!/usr/bin/perl
# -*- indent-tabs-mode: nil; -*-
# vim:ft=perl:et:sw=4
# $Id$

# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[and so on]

And I find the same line:
You need to install the perl-doc package to use this program.

But there is a perldoc in the system:
which perldoc
gives:
/usr/local/bin/perldoc

And locate perldoc gives me (skipping the .cpan directory):

/usr/bin/perldoc
/usr/local/bin/perldoc
/usr/local/share/man/man1/perldoc.1
/usr/local/share/man/man3/Pod::perldoc.3pm
/usr/local/share/perl/5.22.1/perldoc.pod
/usr/share/bash-completion/completions/perldoc

And locate Perldoc :

/usr/local/lib/x86_64-linux-gnu/perl/5.22.1/auto/Perldoc
/usr/local/lib/x86_64-linux-gnu/perl/5.22.1/auto/Perldoc/.packlist
/usr/local/lib/x86_64-linux-gnu/perl/5.22.1/auto/Pod/Perldoc
/usr/local/lib/x86_64-linux-gnu/perl/5.22.1/auto/Pod/Perldoc/.packlist
/usr/local/share/man/man3/Perldoc.3pm
/usr/local/share/man/man3/Perldoc::Base.3pm
/usr/local/share/man/man3/Perldoc::Emitter::HTML.3pm
/usr/local/share/man/man3/Perldoc::Parser::Kwid.3pm
/usr/local/share/man/man3/Perldoc::Reader.3pm
/usr/local/share/man/man3/Perldoc::Writer.3pm
/usr/local/share/man/man3/Pod::Perldoc.3pm
/usr/local/share/man/man3/Pod::Perldoc::BaseTo.3pm
/usr/local/share/man/man3/Pod::Perldoc::GetOptsOO.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToANSI.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToChecker.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToMan.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToNroff.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToPod.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToRtf.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToTerm.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToText.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToTk.3pm
/usr/local/share/man/man3/Pod::Perldoc::ToXml.3pm
/usr/local/share/perl/5.22.1/Perldoc
/usr/local/share/perl/5.22.1/Perldoc.pm
/usr/local/share/perl/5.22.1/Perldoc/Base.pm
/usr/local/share/perl/5.22.1/Perldoc/Emitter
/usr/local/share/perl/5.22.1/Perldoc/Parser
/usr/local/share/perl/5.22.1/Perldoc/Reader.pm
/usr/local/share/perl/5.22.1/Perldoc/Writer.pm
/usr/local/share/perl/5.22.1/Perldoc/Emitter/HTML.pm
/usr/local/share/perl/5.22.1/Perldoc/Parser/Kwid.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc
/usr/local/share/perl/5.22.1/Pod/Perldoc.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/BaseTo.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/GetOptsOO.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToANSI.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToChecker.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToMan.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToNroff.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToPod.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToRtf.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToTerm.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToText.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToTk.pm
/usr/local/share/perl/5.22.1/Pod/Perldoc/ToXml.pm
/usr/local/share/perl/5.22.1/x86_64-linux-gnu-thread-multi/.meta/Perldoc-0.20
/usr/local/share/perl/5.22.1/x86_64-linux-gnu-thread-multi/.meta/Pod-Perldoc-3.28
/usr/local/share/perl/5.22.1/x86_64-linux-gnu-thread-multi/.meta/Perldoc-0.20/MYMETA.json
/usr/local/share/perl/5.22.1/x86_64-linux-gnu-thread-multi/.meta/Perldoc-0.20/install.json
/usr/local/share/perl/5.22.1/x86_64-linux-gnu-thread-multi/.meta/Pod-Perldoc-3.28/MYMETA.json
/usr/local/share/perl/5.22.1/x86_64-linux-gnu-thread-multi/.meta/Pod-Perldoc-3.28/install.json
/usr/share/man/man3/Pod::Perldoc::ToMarkdown.3pm.gz

So I install using apt:

apt install perl-doc

and try again accessing the help:

/usr/local/sympa/bin/sympa help

It is displayed (with a few errors in the display but it is readable - and it is not related to sympa, perldoc perldoc has the same problems):

ESC[1mNAMEESC[0m
    sympa, sympa.pl - Command line utility to manage Sympa

ESC[1mSYNOPSISESC[0m
    "sympa" ESC[4mcommandESC[0m [ ESC[4mgeneral optionsESC[0m... ] ...

ESC[1mDESCRIPTIONESC[0m
    ESC[1mNOTEESC[0m: On overview of Sympa documentation see sympa_toc(1).

    sympa is invoked from command line then performs various administration tasks.

ESC[1mGENERAL OPTIONSESC[0m
    sympa may run with following options in general.

    "-d", "--debug"
        Enable debug mode.

    "-f", "--config="ESC[4mfileESC[0m
        Force Sympa to use an alternative configuration file instead of /etc/sympa/sympa.conf.

    "-l", "--lang="ESC[4mlangESC[0m
        Set this option to use a language for Sympa. The corresponding gettext catalog file must be located in $LOCALEDIR directory.

    "--log_level="ESC[4mlevelESC[0m
        Sets Sympa log level.

    "-m", "--mail"
        Enable SMTP logging.

Installing using apt adds the /usr/bin/perldoc file which differs from /usr/local/bin/perldoc. But not much. Only this is added at the beginning:

    eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
        if 0;

Hope this helps.

@ikedas
Copy link
Member

ikedas commented Jun 14, 2022

! Installing Pod::Perldoc failed. See /root/.cpanm/work/1655196000.27718/build.log for details. Retry with --force to force install it.

What is the content of this file?

[EDIT] I tried with Ubuntu 16.04.7 LTS (AMD64), and Pod::Perldoc was successfully installed. Anyways the reported behavior was reproduced on my side, too.

@ikedas
Copy link
Member

ikedas commented Jun 15, 2022

I found that, even if perldoc was successfully installed (along with Pod::Perldoc) under /usr/local by cpanm, perldoc under /usr/bin is still used by Pod::Usage (See the code).

So this is a defect either of Pod::Usage or particular operating system i.e. Debian/Ubuntu.
Workaround on the operating system is installing perldoc into the standard location, i.e. installig the package named perl-doc on these OS.

In conclusion, this is not a bug of Sympa and this issue is closed with [wontfix] label.

@ikedas ikedas closed this as completed Jun 15, 2022
@ikedas ikedas added the wontfix label Jun 15, 2022
@dverdin
Copy link
Contributor Author

dverdin commented Jun 15, 2022

Thanks @ikedas ,
[EDIT : You did it already.]
I'll post an issue on the Pod::Usage Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants