😀

FreeBSDの perl5のデフォルトバージョンが変わりました

に公開

FreeBSD14.3がリリース間近ということもあり、長らく デフォルトで pkg からインストールされるperl5 のバージョンが 5.36 から 5.40 に変更されています。

FreeBSD/pkg の perl5における default-version の 影響

  • FreeBSD/ports によると 2022-05-26 に登場した perl5.36 は、2025-05-28 までサポート対象でした。
  • pkg もこれに従って デフォルトの 5.40に変更されます。
  • この変更により、 5月末から pkg upgrade を実施すると perl5.40でコンパイルされた p5-* pkg に置き換わるようになっています。
  • perl5.x は 未だに コンポーネントでは必須のシステムとして存在しています。過去にはruby ,今では python,goがその地位にとってかわろうとはしていますが、馬車馬のように働かされているシステムでいくつも生き延びており強固なポリシーをもって排除しない限り存在し続けるでしょう。
  • p5-* ライブラリに支えられてコンパイルされるLEGACYコンポーネントも同様に perl5依存します。 まだ perl5は残るので、メンテナンスはやむなしです。

放置するとどうなる?

  • 例えば、curl 8.13 で 脆弱性が発見されたので、 8.14 にバージョンをすすめたいと思いますが・・・
===>>> Port directory: /usr/ports/ftp/curl

==>>> This port is marked IGNORE
===>>> Invalid perl5 version 5.36


===>>> If you are sure you can build it, remove the
       IGNORE line in the Makefile and try again.


ということで、作業が進められません。

なぜアップグレードされないか?

  • pkg でインストールすると perl5 という Versionラッパー的なパッケージが入ってしまいます。
  • python などでも Version指定しないパッケージがあり、時期的なデフォルトバージョンで固定です。
  • pkg では perl5.36で固定されてしまい、portsからは perl5.36 をインストールした記録がないためアップデートの道がそもそもできていません。

perl5.36から perl5.40に更新する

pkg なら upgrade すれば問題ないと思われます。pkg の既定オプションを用いていないコンポーネント構成であれば以下の手順で更新できます。

  1. ports-mgmt/portmaster は必須なので入れておきます。
  2. /etc/make.conf に以下変更
-- DEFAULT_VERSIONS+=perl5=5.36
++ DEFAULT_VERSIONS+=perl5=5.40

  1. portmaster で 5.40を入れるだけ。
$ cd /usr/ports/lang/perl5.40
$ sudo portmaster -Gdty --no-confirm .
....
===>>> Creating a backup package for old version perl5-5.36_2...
...
Installing perl5-5.40.2_2...
===> 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.40/mach/CORE/libperl.so.5.40.2

      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/

===>>> Upgrade of perl5-5.36.3_2 to perl5-5.40.2_2 complete

この工程の後は問題なく portmaster の コンパイルが通るようになります。

まとめ

  • FreeBSD公式 のpkg の perl5 サポートバージョンが変わりました。 perl5.36 -> 5.40 となり、portsで管理しているとperl5に関する作業が発生する見込み。
  • perl5 pkg と lang/perl5.xx は別物で、pkg/portsの併用時に注意が必要です。

Discussion