Solved Portmaster and perl 5.26

circus78

Active Member

Reaction score: 7
Messages: 204

Hi, I am using FreeBSD 11.1-RELEASE-p9.
It seems I need to upgrade perl ports:

Code:
root@mail:~# portsnap fetch
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from your-org.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Sun Apr  8 09:04:02 CEST 2018 to Sun Apr  8 09:50:47 CEST 2018.
Fetching 5 metadata patches... done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 2 patches.
(2/2) 100.00%  done.
done.
Applying patches...
done.
Fetching 0 new ports or files... done.
root@mail:~# portsnap update
Removing old files and directories... done.
Extracting new files:
/usr/ports/net/get_iplayer/
/usr/ports/security/py-keyring/
Building new INDEX files... done.
root@mail:~# pkg version -vL=
perl5-5.24.3                       <   needs updating (index has 5.26.1)
Anyway, when I run portmaster -a, I get:

Code:
root@mail:~# portmaster -a
===>>> Gathering distinfo list for installed ports

===>>> Starting check of installed ports for available updates

===>>> All ports are up to date
Can you explain me this?
Thank you!
 

fernandel

Aspiring Daemon

Reaction score: 160
Messages: 716

In /etc/make.conf put:
Code:
DEFAULT_VERSIONS+=  perl5=5.26
and read /usr/ports/UPDATING
 

ShelLuser

Son of Beastie

Reaction score: 1,671
Messages: 3,512

Well, in this case I can understand the confusion a little bit because UPDATING is actually a bit lacking since it doesn't provide much useful information other than stating that the default version changed (20180330). It does refer to a previous entry (20161103) which I think is a bit lazy on the port maintainers part. Especially if you consider that the Portmaster command is plain out wrong.

A few simple lines could save users a lot of work, but I guess that's too much effort for them all of a sudden.

Guess it's up to me then:

Upgrading the Perl default version

First check if you use DEFAULT_VERSIONS in /etc/make.conf. If so then change this to reflect on the latest Perl version (5.26). If not then add it :)

Next perform the actual update: # portmaster -o lang/perl5.26 perl5-5.24.

After that is done you need to rebuild any port which got build against the previous Perl library. That can be done using this command: # portmaster -R `pkg shlib -qR libperl.so.5.24`.

Some extra explanation:
The Portmaster -o option needs two parameters: the new port location within the Ports hierarchy and the installed port reference. Obviously you don't have lang/perl5.24 installed but perl5-5.24, see also pkg info -x perl5. As such the given Portmaster command in UPDATING entry 20161103 is wrong (it was somewhat right at the time of writing, but things change).

It's much more beneficial to use -R than -f. In fact: force compiling is plain out useless because you already told Portmaster that it should re-install those ports. And by default the only way it can do so is by rebuilding them.

But -R is useful because this will make Portmaster keep track of the ports it has build. So should something go wrong somewhere in between then you don't have to bother with copy/pasting a long command string from /tmp/portmasterfail.txt but you can simply re-issue the whole build command again. Portmaster will then make sure that it doesn't re-build the ports it had finished building during the last run.
 
OP
OP
C

circus78

Active Member

Reaction score: 7
Messages: 204

..Especially if you consider that the Portmaster command is plain out wrong.
Hi, what do you mean exactly?
Isn't portmaster -a the "general" command to use when someone needs to upgrade ports?
Thank you!
 

ShelLuser

Son of Beastie

Reaction score: 1,671
Messages: 3,512

Isn't portmaster -a the "general" command to use when someone needs to upgrade ports?
Absolutely, that command is perfectly fine.

I was referring to entry 20161103 in /usr/ports/UPDATING. That section lists the following command: portmaster -o lang/perl5.24 lang/perl5.20 which isn't the preferred method of upgrading:

Code:
     portmaster [Common Flags]
                -o <new port dir in /usr/ports> <installed port>
It expects a reference to an installed port, and you don't have a ports directory location installed. It sometimes works, but it's not the right command.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,973
Messages: 28,967

In /etc/make.conf put:
Code:
DEFAULT_VERSIONS+=  perl5=5.26
and read /usr/ports/UPDATING
The default is already set to 5.26:
Code:
PERL5_DEFAULT?=         5.26
 

ShelLuser

Son of Beastie

Reaction score: 1,671
Messages: 3,512

I don't have any /etc/make.conf. Where to add that default?
Upgrade via pkg mode does correct one.
You don't need /etc/make.conf if you're using the package repository (so: if you install software only using pkg).
 

gnath

Active Member

Reaction score: 29
Messages: 116

You don't need /etc/make.conf
Ok. I have a laptop which uses pkg for my 11.1-RELEASE-p9 system and a box where I use port for 11.1-STABLE. I will solve the problem with -o option any way.
 

ShelLuser

Son of Beastie

Reaction score: 1,671
Messages: 3,512

Ok. I have a laptop which uses pkg for my 11.1-RELEASE-p9 system and a box where I use port for 11.1-STABLE.
When you do use ports you'd be looking at the DEFAULT_VERSIONS setting. /usr/ports/Mk/bsd.default-versions.mk shows all the details.

Though instead of using DEFAULT_VERSIONS= I'd recommend using DEFAULT_VERSIONS+= instead. See also the previously mentioned instructions in /usr/ports/UPDATING.
 

Oclair

New Member

Reaction score: 1
Messages: 17

Hey there,

Instead of just using "portmaster -o lang/perl5.28 lang/perl5.24" or "portmaster -R `pkg shlib -qR libperl.so.5.24`"
Is there a way to prioritize rebuilding perl modules ports associated with perl5.28 first before then rebuilding 300 other ports such as llvm?

The suggested method leaves a production mail server out of commission for 2 days because perl's own libraries are waiting for llvm...

I am slightly skeptical llvm6.0.1_4 needs to be rebuilt to get those p5*s up to the current perl version.

Thanks Oclair
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,973
Messages: 28,967

The suggested method leaves a production mail server out of commission for 2 days because perl's own libraries are waiting for llvm...
This is why most of us have set up our own package repositories. That way you can do all the building "offline" without touching any running configurations. It also allows you to easily switch back and forth if you create two distinct repositories, one based on Perl 5.24 and one based on Perl 5.28. That will allow you to test Perl 5.28 and have a proper working fallback in case things go sour.
 

Oclair

New Member

Reaction score: 1
Messages: 17

trying out ports-mgmt/synth for if the only reason, it builds everything before placing it in...
This is the only logical way to upgrade perl...
I remember when perl was in base, because how neglectful perl is treated in ports I still think perl should be in base
 
Top