# PERL_VERSION ignored by Poudriere?



## DutchDaemon (Sep 19, 2013)

I'm not quite sure how wide-spread this problem is, or may become, but after a load of package builds that needed redoing today because Perl 5.14.4 was built instead of Perl 5.16.3 (which I use on all of my systems) I found that Poudriere started ignoring the PERL_VERSION setting in make.conf starting today. 

I think I have tracked it down to a recent change in /usr/ports/Mk/bsd.default-versions.mk, which now seems to prescribe setting 
	
	



```
PERL5_DEFAULT?=5.16
```
 (in this specific instance), totally ignoring the already present 
	
	



```
# added by use.perl 2013-08-29 17:34:57
PERL_VERSION=5.16.3
```

The latter has always forced the proper Perl version into each and every port or package build I did. Not too happy about this 'feature', because Perl is still `echo`'ing PERL_VERSION= to make.conf, and I foresee a lot of problems when people start running into installation problems due to Perl conflicts.

This may be specific to Poudriere, a `portmaster` run did seems to pick up the proper Perl version with the regular PERL_VERSION setting.

Did anyone else see this, or can anyone replicate it? My Poudriere installation is pretty no-nonsense.


----------



## Crest (Sep 19, 2013)

Looks like I'm running into the same problem just now. My current bulk run started building perl5.14.

Looks like this solves the problem:

```
PERL_VERSION=5.16.3
PERL5_DEFAULT=5.16
```


----------



## mix_room (Sep 20, 2013)

I seem to be getting the same problem. I am using ports-mgmt/poudriere-devel. Nothing special about the installation otherwise. Plain vanilla. 


```
#cat /usr/local/etc/poudriere.d/release91amd64-make.conf 
PERL_VERSION=5.16.3
CC=clang
CXX=clang++
CPP=clang-cpp
```


----------



## SirDice (Sep 20, 2013)

Just add PERL5_DEFAULT=5.16 to your release91amd64-make.conf.

To be honest PERL_VERSION wasn't good for ports anyway since it always included the minor version.


----------



## DutchDaemon (Sep 20, 2013)

But at least a Perl installation updated it every time the minor version changed. But this looks like an undocumented change that only affects Poudriere builds (also using -devel). Unless someone can confirm that it affects portmaster builds as well.


----------



## SirDice (Sep 20, 2013)

The default version is still 5.14, right? So unless somebody specified an alternate version I don't think anybody will notice the changes.


----------



## SirDice (Sep 20, 2013)

Ah, I couldn't find /usr/ports/Mk/bsd.default-versions.mk on my systems. Looks like it's been added yesterday. 

If I read everything correctly the new way to set the default version is:

```
DEFAULT_VERSIONS= perl5=5.16
```

I think the idea is to get a consistent way of specifying a default version. Different ports, like Apache and MySQL, have used various different ways of setting a default version, there really never was a standard way for it.


----------



## DutchDaemon (Sep 20, 2013)

That one did *not* work for me when I ran into the initial problem. I had to go with the PERL5_DEFAULT= setting. And I don't mind changing the required setting in make.conf, but I had expected something in UPDATING at the very least.


----------



## SirDice (Sep 20, 2013)

I guess they're not completely done with the transition yet. I can't find much about the change on the freebsd-perl@ mailing list either


----------



## SirDice (Sep 20, 2013)

Bingo.


```
# It expects users to define DEFAULT_VERSIONS in there make.conf
# Syntax is the following:
#
# DEFAULT_VERSION=  perl5=5.18 ruby=2.0

.if !defined(_INCLUDE_BSD_DEFAULT_VERSIONS_MK)
_INCLUDE_BSD_DEFAULT_VERSIONS_MK= yes

.for lang in ${DEFAULT_VERSIONS}
_l=   ${lang:C/=.*//g}
${_l:U}_DEFAULT=  ${lang:C/.*=//g}
.endfor
```

The comments state DEFAULT_VERSION whereas the code actually uses DEFAULT_VERSION*S*.


----------



## DutchDaemon (Sep 20, 2013)

Yikes. That didn't hit me when I tried to stop 16 cores from building 600 ports on a couple of jails .. The 'there' is a nice touch though .. I did notice *that*). I wonder what I'll need for Apache.


```
DEFAULT_VERSION=  apache=apache22?
DEFAULT_VERSION=  apache2=apache22?
DEFAULT_VERSION=  apache22=apache22-2.2?
```

This could be better documented ..


----------



## DutchDaemon (Sep 20, 2013)

I tried 
	
	



```
DEFAULT_VERSIONS= perl5=5.16
```
 but the Perl 5.14.4 builds started again. I'll stick with 
	
	



```
PERL5_DEFAULT=5.16
```
 for a bit longer.


----------



## mix_room (Sep 20, 2013)

I just have to ask: have you submitted a PR?

And from reading /usr/ports/Mk/bsd.default-versions.mk it seems to me that the syntax should be the following:


```
XXX_DEFAULT?=
```

which would then imply


```
APACHE22_DEFAULT?=
```


----------



## DutchDaemon (Sep 20, 2013)

But Apache 22 is an Apache 2 sub-version, just like Perl 5.16 is a Perl 5 sub-version. So you'd expect


```
APACHE2_DEFAULT= apache22
```

And no, no PR. Feel free.


----------



## ohauer (Sep 22, 2013)

DutchDaemon said:
			
		

> But Apache 22 is an Apache 2 sub-version, just like Perl 5.16 is a Perl 5 sub-version. So you'd expect
> 
> 
> ```
> ...



No, since years the Apache version is controlled via 
	
	



```
APACHE_PORT=www/apache??
```
But the new default version code will be adopted.

From Mk/bsd.apache.mk:

```
# =========================================================================
# Parameter APACHE_PORT (user controlled):
#
# The parameter APACHE_PORT can be used in /etc/make.conf to
# overwrite the default apache port.
#
# This parameter should never be used in the Makefile of a port!
#
# Example entry in /etc/make.conf:
#  APACHE_PORT= www/apache22
```


----------



## mix_room (Sep 23, 2013)

From /usr/ports/UPDATING


```
20130920:
  AFFECTS: Users of ports
  AUTHOR: bapt@FreeBSD.org

  New way to override the default version of a language in the ports
  tree.

  The make variable, DEFAULT_VERSIONS, allows users to override the
  default version defined by the ports tree.

  For example, to declare specific versions for Perl, Ruby and Tcl/Tk,
  it would be defined as:
  DEFAULT_VERSIONS=	perl5=5.18 ruby=2.0 tcltk=8.6

  Today, this only is supported by Perl, Ruby and Tcl/Tk.
```


----------



## DutchDaemon (Sep 23, 2013)

Well, it didn't work on the twentieth (nor was this in UPDATING on that date), see post 12. I'll try again later.


----------



## mix_room (Sep 23, 2013)

@DutchDaemon - I am in complete agreement with you. I only saw that UPDATING entry today. 

It seems to be working for me now. I am getting the same Perl version that I set in the variable.


----------



## SirDice (Sep 23, 2013)

It was added to UPDATING Friday afternoon.

http://svnweb.freebsd.org/ports/head/UPDATING?r1=327697&r2=327707


----------



## DutchDaemon (Sep 23, 2013)

Yeah, of course I ran into the problem a day before that (sometimes it sucks  to be an early adopter), and I use `pkg updating` from a script, which doesn't print general and generic things like this. So I checked on September 19, and not after that. Oh well, if this syntax does work now, it's all water under the bridge.


----------



## SirDice (Sep 23, 2013)

I do hope they're going to use that DEFAULT_VERSIONS for other things too. Although I'm not quite sure how that would work for APACHE_PORT though. I do like the idea.


----------

