# Perl 5.26 and Synth



## dougs (Apr 11, 2018)

Hello-

I've been using Synth for three months now (after using portmaster forever) and I'm trying to rebuild ports that depend on Perl5 using synth. But am not getting anywhere. Clearly I do not understand the pkg system. After using synth to upgrade to perl5.26, I see that perl5.24 has been deinstalled. However, I am getting errors when running perl commands with foswiki:


```
Can't locate tools//../bin/setlib.cfg in Inc (Inc] contains: bin /usr/local/lib/perl5/site_perl/mach/5.26 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.26/mach /usr/local/lib/perl5/5.26) at tools/mailnotify line 36.
BEGIN failed--compilation aborted at tools/mailnotify line 37.
```

I also find that foswiki is unusable at the moment. I suspect that foswiki needs to be rebuilt with perl5.26 but am not sure how to accomplish this!

This is what I've tried to do:

updated /etc/make.conf and [/file]/usr/local/etc/synth/LiveSystem-make.conf[/file] with:

```
DEFAULT_VERSIONS+= perl5.26
```
Then:

```
# pkg set -o lang/perl5.24:lang/perl5.26
# synth upgrade-system
```
and it tells me there's nothing to build/rebuild.

When I used portmaster, I normally followed the portmaster version of updating found in /usr/ports/UPDATING and it worked 97% of the time.

I also tried:
`# synth rebuild-repository`

but that also didn't appear to rebuild the dependencies.

Hm? How do I rebuild with new dependencies using synth and/or pkg not only for foswiki but for all other ports that depend on perl5? Copy the output of pkg version to a file, deinstall all packages and reinstall using the same file?

~Doug


----------



## VladiBG (Apr 11, 2018)

i'm using `portupgrade`and i upgraded successful with it following entry 20161103 in /usr/ports/UPDATING

First, add to /etc/make.conf:

`DEFAULT_VERSIONS+=  perl5=5.26`

`portupgrade -o lang/perl5.26 -f lang/perl5.24
portupgrade -f `pkg shlib -qR libperl.so.5.24``


----------



## dougs (Apr 11, 2018)

I was under the impression that once you started using synth on a local system, you needed to use either the synth or the pkg commands. Am I incorrect?


----------



## VladiBG (Apr 11, 2018)

synth(1)is custom package repository builder

btw did you update your port tree first with `portsnap auto`?


----------



## ShelLuser (Apr 11, 2018)

This probably won't help much but....

The problem you're facing is that every port you installed which got somehow compiled against the Perl library (/usr/local/lib/perl5/5.24/mach/CORE/libperl.so.5.24p/) need to be rebuild again. And I'm not too sure that your `pkg set` command was a smart one (it depends on Synth and I'm not using that so I don't know). But solely basing myself on Portmaster: changing this yourself is generally speaking a bad idea.

See: what you did was merely change the ports origin. PKG would then proceed to report that there is no new version. And I could imagine (note: I am not sure) that Synth picks up on that and thus doesn't recognize the new version as well.

And this still leaves you with the main problem: all ports which use the Perl library need to be rebuild one way or the other in order for them to use the new version.

I tried to skim over the Synth manualpage (from the link above) but... Yah, not working for me.

(edit)



dougs said:


> I was under the impression that once you started using synth on a local system, you needed to use either the synth or the pkg commands. Am I incorrect?


No, you should only use Synth but it depends on what you wanted to use the pkg command for.

As a general rule: do not mix ports and binary packages. So: do not install software using both Synth and `pkg install` because that will lead to problems.

But, as mentioned above, I also have some doubts with changing a ports origin manually. However... that is based on my experience with the ports system in general and Portmaster. It is possible that Synth accounts for this but I honestly don't know (still a Portmaster user myself).


----------



## SirDice (Apr 13, 2018)

VladiBG said:


> First, add to /etc/make.conf:
> 
> 
> ```
> ...


There's no need to explicitly set this as it's already the default setting.

https://svnweb.freebsd.org/ports?view=revision&revision=465965
https://svnweb.freebsd.org/ports/head/Mk/bsd.default-versions.mk?r1=465965&r2=465964&pathrev=465965


----------



## spectrum48 (Apr 13, 2018)

ShelLuser said:


> And I'm not too sure that your `pkg set` command was a smart one (it depends on Synth and I'm not using that so I don't know).



Exactly... Synth shouldn't need that command. For me it "just worked". Isn't the main purpose of Synth and Poudriere to build packages in a clean environment to avoid hacks like these?


----------



## SirDice (Apr 13, 2018)

spectrum48 said:


> Isn't the main purpose of Synth and Poudriere to build packages in a clean environment to avoid hacks like these?


I'm not too familiar with Synth but with Poudriere the change was picked up automatically. After the build was finished a `pkg upgrade` on one of my hosts automatically updated Perl and everything that depends on it.

Maybe marino has some tips. He's still around and drops by every now and then.


----------



## VladiBG (Apr 13, 2018)

SirDice said:


> There's no need to explicitly set this as it's already the default setting.
> 
> https://svnweb.freebsd.org/ports?view=revision&revision=465965
> https://svnweb.freebsd.org/ports/head/Mk/bsd.default-versions.mk?r1=465965&r2=465964&pathrev=465965


I was unable to update perl5.24 to perl5.26 using portupgrade unless i change the /etc/make.conf even the /usr/ports/MK/bsd.default-versions.mk has it.


----------



## dougs (Apr 13, 2018)

I started using synth back in December to get around the issue of flavors with php. Has portmaster become flavorized yet to the point where it is safe/sane to use it?

I use portsnap to download weekly and rebuild ports in need of updating. I do not use binary packages at all.

I pulled out the portmaster tool and rebuilt perl5 and all programs that depend on it.

`# portmaster -o lang/perl5.26 lang/perl5.24
# portmaster  -f `pkg shlib -qR libperl.so.5.26``

I found that not all ports depending on perl5 were rebuilt. Especially foswiki. I issued this:

`# Portmaster -r perl5`

I saw that foswiki was rebuilt. However I had to take additional steps using foswiki's scripts to fix file permissions and to run rewriteshebang.pl to modify perl5 associations.

foswiki now works. Unfortunately I am still getting the same error message mentioned in my original post.  I think I will need to investigate the MailNotify feature some more. It appears the format used in /etc/crontab needs to be changed as running mailnotify without parameters at the command line works.


----------

