Upgrade Perl 5.40 to 5.42: /usr/local/include/crypt.h:73:8: error: redefinition of 'crypt_data'

Hello everyone!

I tried to upgrade Perl 5.40 to 5.42, and I got an error "redefinition of 'crypt_data'".

The full build log and my /etc/make.conf are attached.

I ran:
portmaster -o lang/perl5.42 lang/perl5.40

The error:
Code:
===>  Building for perl5-5.42.0_1
--- op.o ---
--- universal.o ---
--- op.o ---
cc -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -Wall -DPIC -fPIC op.c
cc -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -Wall -DPIC -fPIC universal.c
--- universal.o ---
In file included from universal.c:31:
In file included from ./perl.h:4517:
In file included from ./op.h:709:
In file included from ./reentr.h:126:
/usr/local/include/crypt.h:73:8: error: redefinition of 'crypt_data'
   73 | struct crypt_data
      |        ^
/usr/include/unistd.h:488:8: note: previous definition is here
  488 | struct crypt_data {
      |        ^
--- op.o ---
In file included from op.c:163:
In file included from ./perl.h:4517:
In file included from ./op.h:709:
In file included from ./reentr.h:126:
/usr/local/include/crypt.h:73:8: error: redefinition of 'crypt_data'
   73 | struct crypt_data
      |        ^
/usr/include/unistd.h:488:8: note: previous definition is here
  488 | struct crypt_data {
      |        ^
--- universal.o ---
1 error generated.
*** [universal.o] Error code 1

make: stopped in /usr/ports/lang/perl5.42/work/perl-5.42.0
--- op.o ---
1 error generated.
*** [op.o] Error code 1

make: stopped in /usr/ports/lang/perl5.42/work/perl-5.42.0
2 errors

make: stopped in /usr/ports/lang/perl5.42/work/perl-5.42.0
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/perl5.42
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/perl5.42

===>>> make build failed for lang/perl5.42
===>>> Aborting update
 

Attachments

Perhaps force delete libxcrypt, upgrade to perl5.42, install libxcrypt.
What do you mean? User pkg delete?
Well, I'd tried it:
Code:
pkg delete security/libxcrypt
Code:
Updating database digests format: 100%
Code:
Checking integrity... done (0 conflicting)
Code:
Deinstallation has been requested for the following 449 packages (of 0 packages in the universe):
 
What do you mean? User pkg delete?
Well, I'd tried it:
Code:
pkg delete security/libxcrypt
Code:
Updating database digests format: 100%
Code:
Checking integrity... done (0 conflicting)
Code:
Deinstallation has been requested for the following 449 packages (of 0 packages in the universe):
Deleting 449 packages is too much for me.
It isn't impossible, but ....
 
This will remove only libxcrypt, not the packages depending on it.
Mind you, you're going to have to rebuild everything that depends on libxcrypt too, or else your dependency chain will be wrecked.
 
SevenDayz a general recommendation is to *not* mess with your system perl. Leave that to the system to manage. The reason is, if you "break" your system perl somehow, your system might get affected when it attempts to run a broken perl.

You should instead install a different perl for your user. You can do that very easily with with "perl version manager", for example:

perlbrew: https://perlbrew.pl/ (https://metacpan.org/pod/App::perlbrew).

or, local::lib: https://metacpan.org/pod/local::lib

There are others too, like "plenv" but perlbrew or local::lib should do.

Plus you dont need root to install them and to install modules for them.

To install modules, use "cpanm" : https://metacpan.org/pod/App::cpanminus#Installing-to-local-perl-(perlbrew,-plenv-etc.)
 
SevenDayz a general recommendation is to *not* mess with your system perl. Leave that to the system to manage. The reason is, if you "break" your system perl somehow, your system might get affected when it attempts to run a broken perl.

You should instead install a different perl for your user. You can do that very easily with with "perl version manager", for example:

perlbrew: https://perlbrew.pl/ (https://metacpan.org/pod/App::perlbrew).

or, local::lib: https://metacpan.org/pod/local::lib

There are others too, like "plenv" but perlbrew or local::lib should do.

Plus you dont need root to install them and to install modules for them.

To install modules, use "cpanm" : https://metacpan.org/pod/App::cpanminus#Installing-to-local-perl-(perlbrew,-plenv-etc.)
Do you mean I should comment the line "DEFAULT_VERSIONS+= perl5=5.42"?
 
Do you mean I should comment the line "DEFAULT_VERSIONS+= perl5=5.42"?
Yes, you should remove "DEFAULT_VERSIONS+= perl5=5.42".

The default versions are set in the ports framework globally in /usr/ports/Mk/bsd.default-versions.mk
Rich (BB code):
# Possible values: 5.38, 5.40, 5.42, devel
.  if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \
    defined(PACKAGE_BUILDING))
# When changing the default here, make sure the DEPRECATED/EXPIRATION lines in
# the older Perl 5 ports are uncommented at the same time.
PERL5_DEFAULT?=         5.42
Unless you want to override default versions, don't specify default versions which are already default.

The upgrade procedure for perl5 using ports-mgmt/portmaster described in /usr/ports/UPDATING does also advice the removal.
Rich (BB code):
20231017:
  AFFECTS: users of lang/perl5*
  AUTHOR: delphij@FreeBSD.org
 
  ...
    First, add to /etc/make.conf:

  DEFAULT_VERSIONS+=  perl5=5.36
 
  ...
    Portmaster users:
        portmaster -o lang/perl5.36 lang/perl5.34

          You can now remove the DEFAULT_VERSIONS line added earlier
          from /etc/make.conf
 
Yes, you should remove "DEFAULT_VERSIONS+= perl5=5.42".

Unless you want to override default versions, don't specify default versions which are already default.

The upgrade procedure for perl5 using ports-mgmt/portmaster described in /usr/ports/UPDATING does also advice the removal.
Rich (BB code):
You can now remove the DEFAULT_VERSIONS line added earlier
          from /etc/make.conf
Thank you for your reminder.
 
Back
Top