Bug 250053 - lang/perl5.32: perl5.32-5.32.0 doesn't meet perl5>=5.32.r0<5.33
Summary: lang/perl5.32: perl5.32-5.32.0 doesn't meet perl5>=5.32.r0<5.33
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-02 18:57 UTC by gergely.czuczy
Modified: 2020-10-09 23:07 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gergely.czuczy 2020-10-02 18:57:47 UTC
When trying to build shells/bash, I'm getting the following error at help2man:

===>   Registering installation for perl5.32-5.32.0 as automatic
[x] Installing perl5.32-5.32.0...
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/lib/perl5/5.32/mach/CORE/libperl.so.5.32.0

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
https://www.perl.org/
===>   help2man-1.47.16 depends on package: perl5>=5.32.r0<5.33 - not found
*** Error code 1

Stop.
make[9]: stopped in /usr/ports/misc/help2man

It's a FreeBSD 12.1-STABLE r363367, and the ports tree just has been updated with portsnap.
Comment 1 devel 2020-10-03 15:28:28 UTC
Have the same problem on FreeBSD 1300094 and fresh portstree.
Comment 2 Tatsuki Makino 2020-10-04 22:57:44 UTC
Right now, PERL5_DEFAULT is 5.32.
But you have perl5.32-5.32.0 installed.
If you aren't using anything other than DEFAULT_VERSIONS+=perl5=5.32, then this means that the perl upgrade has failed.

If you are using a portmaster, you need to run the following line in 20161103 of /usr/ports/UPDATING:

>  First, add to /etc/make.conf:
>
>  DEFAULT_VERSIONS+=  perl5=5.24
>
>  Portmaster users:
>        portmaster -o lang/perl5.24 lang/perl5.20
>
>          You can now remove the DEFAULT_VERSIONS line added earlier
>          from /etc/make.conf

I upgraded with the following command:

> portmaster -B -D -w -m DEFAULT_VERSIONS=perl5=5.32 -o lang/perl5.32 perl5

The perl upgrade has failed, so perl5>=5.32.r0<5.33 included from /usr/ports/lang/perl5.32/version.mk doesn't work.
Comment 3 gergely.czuczy 2020-10-05 06:16:16 UTC
/etc/make.conf:
DEFAULT_VERSIONS+=python=3.7

And before building I'm cleaning the ports tree, and removing all packages. I don't really understand where's the upgrade part here. I'm trying to build it in a cleared jailed, no packages, vanilla ports tree.
Comment 4 Tatsuki Makino 2020-10-05 22:53:10 UTC
If ${LOCALBASE}/bin/perl is existing, a DEFAULT_VERSION for perl will be generated by ${LOCALBASE}/bin/perl. It is written in /usr/ports/Mk/bsd.default-versions.mk.
If it is version 5.30 of /usr/local/bin/perl, PERL5_DEFAULT will be set to 5.30.
If you install 5.32. at that time, package name will become perl5.32-5.32.0 instead of perl5-5.32.0.
This funny default perl could be fixed by making sure /usr/local/bin/perl doesn't exist and then reinstalling it. maybe :) I can't remember as I was able to migrate it with no problem. :)

You can read the upgrade instructions to avoid such problems with the following command.

> less +/^20161103: /usr/ports/UPDATING
Comment 5 gergely.czuczy 2020-10-06 06:29:18 UTC
That entry says:
  assuming you are
  migrating from 5.20 to 5.24, do:

I have some difficulty applying this, because there's no perl installed:
root@build:/usr/ports# which perl
root@build:/usr/ports# pkg info
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: ^C
root@build:/usr/ports# ls -lhd /usr/{,local/}bin/perl*
ls: /usr/bin/perl*: No such file or directory
ls: /usr/local/bin/perl*: No such file or directory
root@build:/usr/ports#


Anyway, because you said so, I've added the following to /etc/make.conf, as the entry suggests:
DEFAULT_VERSIONS+=  perl5=5.32

root@build:/usr/ports# make -C */help2man build
(...)
===>   Registering installation for perl5.32-5.32.0 as automatic
[build] Installing perl5.32-5.32.0...
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/lib/perl5/5.32/mach/CORE/libperl.so.5.32.0

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
https://www.perl.org/
===>   help2man-1.47.16 depends on package: perl5>=5.32.r0<5.33 - not found
*** Error code 1

Probably I'm missing out on something, and the UPDATING entry doesn't seem to help.
Comment 6 Mathieu Arnold freebsd_committer freebsd_triage 2020-10-06 10:52:27 UTC
The UPDATING entry contains the correct information.

You MUST set DEFAULT_VERSIONS=perl5=5.32 before you install lang/perl5.32 if you wish it to be the default.
Comment 7 gergely.czuczy 2020-10-06 10:54:14 UTC
No, I don't want it to be a default. Actually I totally don't care which perl is being installed, it's just a dep. I have no settings for it.

The problem is not that I want a specific perl version and it doesn't work.

The problem is that, help2man depends on 5.32 for some reason, without having it set manually, and it doesn't work.
Comment 8 Tatsuki Makino 2020-10-06 22:25:50 UTC
Something which changes PERL5_DEFAULT to not equal 5.32 is mixed in there.
I need the result of the following command to check for it.

> make -C /usr/ports/lang/perl5.32/ -V DEFAULT_VERSIONS -V LOCALBASE -V PERL5_DEFAULT

The ${LOCALBASE} is usually /usr/local.
If not, I'd also like to see the results of the following commands.

> pkg which -qo ${your_LOCALBASE}/bin/perl

If the result is not lang/perl5.32, use the following command to find the problem.

> pkg info -r `pkg which -qo ${your_LOCALBASE}/bin/perl`
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2020-10-08 01:50:54 UTC
^Triage: clean up Summary and Cc: list.
Comment 10 gergely.czuczy 2020-10-08 07:00:36 UTC
Here's the output:
# make -C /usr/ports/lang/perl5.32/ -V DEFAULT_VERSIONS -V LOCALBASE -V PERL5_DEFAULT
python=3.7
/usr/local
5.30
root@build:/usr/ports# pkg which -qo /usr/local/bin/perl
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: ^C
root@build:/usr/ports# pkg info -r `pkg which -qo /usr/local/bin/perl`
^C


The last 2 commands didn't work as expected of course, because the environment is cleaned up. The ports tree is clean, and there're no packages in the jail, not even pkg.
# cat /etc/make.conf
DEFAULT_VERSIONS+=python=3.7
#DEFAULT_VERSIONS+=  perl5=5.30

When I've forced the default version to be 5.30, then things started to work again. But by default, when building help2man, it goes for 5.32, which doesn't work due that error said previously.
Comment 11 gergely.czuczy 2020-10-08 07:03:01 UTC
And just for clarity, the same thing from help2man:
root@build:/usr/ports# make -C /usr/ports/*/help2man -V DEFAULT_VERSIONS -V LOCALBASE -V PERL5_DEFAULT
python=3.7
/usr/local
5.32

And from perl5.32:
# make -C /usr/ports/*/perl5.32 -V DEFAULT_VERSIONS -V LOCALBASE -V PERL5_DEFAULT
python=3.7
/usr/local
5.30
Comment 12 Tatsuki Makino 2020-10-09 03:37:32 UTC
The results mean
DEFAULT_VERSIONS does not include perl5=5.30.
But, there is something that directly changes PERL5_DEFAULT to 5.30 when working directory is /usr/ports/*/perl5.32.

I forgot one variable where I find one possibility of that something.
It is the following command.

> make -C /usr/ports/lang/perl5.32/ -V DEFAULT_VERSIONS -V LOCALBASE -V PERL5_DEFAULT -V _PERL5_FROM_BIN

If there is an extra line of numbers like 5.30, there is a perl somewhere that doesn't manage pkg and it returns that number.
If there is one more blank line, run "grep -r -n -e PERL5_DEFAULT --exclude /dev/\* --exclude /other/devfs/\* / " :) to find the file defining the make variable or environment variable named PERL5_DEFAULT.

In addition, to read /etc/make.conf in a jail, use the following command.

> jexec -l <jid or jailname checked using jls -v is here> cat /etc/make.conf
Comment 13 gergely.czuczy 2020-10-09 04:48:44 UTC
# make -C /usr/ports/lang/perl5.32/ -V DEFAULT_VERSIONS -V LOCALBASE -V PERL5_DEFAULT -V _PERL5_FROM_BIN
python=3.7
/usr/local
5.30

#

Thank you, I do know how to read a file from a jail, instead of a host system.
Comment 14 gergely.czuczy 2020-10-09 05:49:44 UTC
The only thing found by that grep was:
/tmp/PERL5_DEFAULT:1:PERL5_DEFAULT=5.30
Apart matches from the ports tree.

Removing that file solved the issue. I don't really have an idea what produced that, and why haven't it cleared it up after itself, but sure have caused quite an issue.

Thanks for the help.
Comment 15 Tatsuki Makino 2020-10-09 09:35:15 UTC
It is made with /usr/ports/lang/perl5.32/Makefile post-extract target and erased with post-clean target.
If you run the commands in the following order, you can keep only that file.

> make -C /usr/ports/lang/perl5.32/ extract
> make -C /usr/ports/lang/perl5.32/ -D PACKAGE_BUILDING clean

There may be something wrong with the use of PACKAGE_BUILDING in the environment where this problem occurs.
Comment 16 Tatsuki Makino 2020-10-09 23:07:52 UTC
I understand that it is not a good idea to keep writing where Status is Closed, but this is the last one :)

The post-clean target should be rewritten to always remove, I think.

.if exists(${_PERL5_DEFAULT_FILE})
post-clean:
    @${RM} ${_PERL5_DEFAULT_FILE}
.endif

post-clean:
    @[ -e ${_PERL5_DEFAULT_FILE} ] && ${RM} ${_PERL5_DEFAULT_FILE}

post-clean:
    @${RM} ${_PERL5_DEFAULT_FILE} || ${TRUE}

post-clean:
    @-${RM} ${_PERL5_DEFAULT_FILE}