前回はclang-16では新し過ぎて構文チェックがきつくコンパイル時にエラーとなった。
今回は、clangのバージョンを徐々に落とし、Perl5.34.3をコンパイルできないか試してみる。
て言っても、やることは単純。
1.port install clang-15
2.port select clang mp-clang-15
3../Configureでlibの検索pathを変更する(ここのとこ)
Directories to use for library searches?
[/opt/local/lib /opt/local/libexec/llvm-16/lib/clang/16/lib /usr/local/lib /usr/lib] /opt/local/lib /opt/local/libexec/llvm-15/lib/clang/15.0.7/lib/ /usr/local/lib /usr/lib
llvm-16をllvm-15の元に変更。
clang-15が使うのはllvm-15だからね。
基本はこれだけ。
あとは、これでコンパイルできる。
sudo ./Configure -de -Dprefix=/opt/local -Dcc=/opt/local/bin/clang -Dmake=/opt/local/bin/gmake
sudo gmake
gmake test
が通れば完成、だと思う。
ダメならば、更にclangのバージョンを下げる。
この繰り返しになる。
現在clang-15を使ってコンパイルを行うところ。
clangはこれだけある。一つくらい行けて欲しい。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
clang-3.3 @3.3_16 (lang) clang-3.4 @3.4.2_19 (lang) clang-3.7 @3.7.1_11 (lang) clang-5.0 @5.0.2_8 (lang) clang-6.0 @6.0.1_7 (lang) clang-7.0 @7.1.0_5 (lang) clang-8.0 @8.0.1_6 (lang) clang-9.0 @9.0.1_10 (lang) clang-10 @10.0.1_10 (lang) clang-11 @11.1.0_9 (lang) clang-11-bootstrap @11.1.0_6 (lang) clang-11 with minimal MacPorts patches pegged at version 11.1.0. clang-12 @12.0.1_6 (lang) clang-13 @13.0.1_6 (lang) clang-14 @14.0.6_5 (lang) clang-15 @15.0.7_6 (lang) clang-16 @16.0.6_9 (lang) clang-17 @17.0.6_7 (lang) clang-18 @18.1.8_8 (lang) clang-19 @19.1.7_4 (lang) clang-20 @20.1.8_5 (lang) clang-21 @21.1.8_3 (lang) clang-22 @22.1.8_1 (lang) clang-23 @23.1.2 (lang) |
前回、エラーが出たのはgmake test時にsudoを付けていなかったことが大きい。
ファイルを書き込みに行った時にownerがrootだったりmacportsだったりと安定していなかったせいらしい。
sudo gmake testの結果、延々とtestを繰り返し結果が出た。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
t/porting/ss_dup ................................................. ok t/porting/test_bootstrap ......................................... ok t/porting/utils .................................................. skipped Failed 1 test out of 2453, 99.96% okay. op/groups.t ### Since not all tests were successful, you may want to run some of ### them individually and examine any diagnostic messages they produce. ### See the INSTALL document's section on "make test". ### You have a good chance to get more information by running ### ./perl harness ### in the 't' directory since most (>=80%) of the tests succeeded. ### You may have to set your dynamic library search path, ### DYLD_LIBRARY_PATH, to point to the build directory: ### setenv DYLD_LIBRARY_PATH `pwd`; cd t; ./perl harness ### DYLD_LIBRARY_PATH=`pwd`; export DYLD_LIBRARY_PATH; cd t; ./perl harness ### export DYLD_LIBRARY_PATH=`pwd`; cd t; ./perl harness ### for csh-style shells, like tcsh; or for traditional/modern ### Bourne-style shells, like bash, ksh, and zsh, respectively. Elapsed: 908 sec u=7.87 s=4.92 cu=545.34 cs=73.46 scripts=2453 tests=1121184 gmake: *** [GNUmakefile:810: test] エラー 1 |
Failed 1 test out of 2453, 99.96% okay.
つまり、殆どのテストは通った。
今度は落ちたところを単体で動かしてみる。
% ./perl t/op/groups.t
|
1 2 3 4 5 6 7 |
# groups ………… # pwgid=20 pwgnam=staff $(=20 20 718 717 720 719 712 506 12 61 79 80 81 98 399 101 742 # gr_name =staff,staff,com.apple.sharepoint.group.18,com.apple.sharepoint.group.17,com.apple.sharepoint.group.20,com.apple.sharepoint.group.19,com.apple.sharepoint.group.12,editors,everyone,localaccounts,_appserverusr,admin,_appserveradm,_lpadmin,com.apple.access_ssh,access_bpf,com.apple.sharepoint.group.42 1..3 ok 1 # skip Your platform's `id -a 2>/dev/null || id 2>/dev/null' is broken ok 2 - groupstype should be type short, not long ok 3 # skip uid!=0 |
これ/t/op/で初めてのテストだったろうから、他のもやってみよう。
% ./perl t/op/*.t
|
1 2 3 4 5 6 7 8 9 10 |
# This perl's maths preserves all bits of a UV. ok 1 ok 2 ok 3 ……… ok 419 - (1<<62) * (1<<3) ok 420 - (1<<63) * (1<<0) ok 421 - (1<<63) * (1<<1) ok 422 - (1<<63) * (1<<2) 1..422 |
多分、全部通ったと思われ。
次は、インストールである。
% sudo gmake install
|
1 2 3 4 5 6 7 8 9 10 11 12 |
GNUmakefile:267: 警告: 拡張子ルール定義の必要条件を無視しています GNUmakefile:263: 警告: 拡張子ルール定義の必要条件を無視しています GNUmakefile:267: 警告: 拡張子ルール定義の必要条件を無視しています GNUmakefile:267: 警告: 拡張子ルール定義の必要条件を無視しています GNUmakefile:263: 警告: 拡張子ルール定義の必要条件を無視しています GNUmakefile:267: 警告: 拡張子ルール定義の必要条件を無視しています ./miniperl -Ilib make_patchnum.pl Reusing 'git_version.h' and 'lib/Config_git.pl' ./miniperl -Ilib make_ext.pl cpan/Archive-Tar/pm_to_blib MAKE="gmake" LIBPERL_A=libperl.a gmake[1]: Entering directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/cpan/Archive-Tar' gmake[1]: Leaving directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/cpan/Archive-Tar' ./miniperl -Ilib make_ext.pl dist/Attribute-Handlers/pm_to_blib MAKE="gmake" LIBPERL_A=libperl.a |
なんだかコンパイルが始まった気がする。
なんで?また何か作ってるの?もういいじゃん。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
gmake[1]: Entering directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/dist/threads' /opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/dist/threads/../../miniperl "-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- threads.bs ../../lib/auto/threads/threads.bs 644 gmake[1]: Leaving directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/dist/threads' ./miniperl -Ilib make_ext.pl lib/auto/threads/shared/shared.bundle MAKE="gmake" LIBPERL_A=libperl.a LINKTYPE=dynamic gmake[1]: Entering directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/dist/threads-shared' /opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/dist/threads-shared/../../miniperl "-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- shared.bs ../../lib/auto/threads/shared/shared.bs 644 gmake[1]: Leaving directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/dist/threads-shared' Making utilities gmake[1]: Entering directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/utils' gmake[1]: Nothing to be done for 'all'. gmake[1]: Leaving directory '/opt/local/var/macports/build/perl5.34-d3cf0f46/work/perl-5.34.3/utils' Everything is up to date. Type 'gmake test' to run test suite. ./perl -Ilib -I. installperl --destdir= WARNING: You've never run 'make test' or some tests failed! (Installing anyway.) |
ここから漸くファイルのコピーが始まったらしい。
|
1 2 3 4 5 6 7 8 9 10 11 12 |
/opt/local/bin/perl5.34.3 /opt/local/lib/perl5/5.34.3/_charnames.pm /opt/local/lib/perl5/5.34.3/AnyDBM_File.pm /opt/local/lib/perl5/5.34.3/autodie.pm /opt/local/lib/perl5/5.34.3/AutoLoader.pm …… /opt/local/share/man/man1/ptargrep.1 /opt/local/share/man/man1/shasum.1 /opt/local/share/man/man1/splain.1 /opt/local/share/man/man1/streamzip.1 /opt/local/share/man/man1/xsubpp.1 /opt/local/share/man/man1/zipdetails.1 |
終わったと思って良いのだろうか?
perlのバージョンを確認する。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
% perl --version This is perl 5, version 34, subversion 3 (v5.34.3) built for darwin-thread-multi-2level Copyright 1987-2023, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. |
これだけだと信じられない。他のperlかも知れないじゃないか。
どのperlを選んだのか確認する。
|
1 2 3 4 |
% where perl /opt/local/bin/perl /usr/bin/perl |
つまり、最初に出てきた/opt/local/bin/perlだわな。
それがさっき作ったものかを確認する。(疑心暗鬼になってる)
|
1 2 3 |
% ls -l /opt/local/bin/perl -rwxr-xr-x 2 root wheel 3389420 9 30 14:59 /opt/local/bin/perl* |
確かに今日作ったものだ。(しつこいのは理解している)
さて、漸くここでp5.34-dbiのインストールである。
大回りしたなぁ、まさかperlのrecompileまですることとなるとは。
sudo port install p5.34-dbi
……エラーで止まった。
うん、知ってた。お前ってそう云う奴だもんな。ちくしょうめぇ〜。
さてログを見よう。
多分、ここだ。
|
1 2 3 4 5 6 7 8 |
:notice:configure ---> Configuring p5.34-dbi :debug:configure Preferred compilers: clang macports-clang-17 macports-clang-16 macports-clang-15 macports-clang-14 macports-clang-13 macports-clang-12 macports-clang-11 macports-clang-10 macports-clang-9.0 macports-clang-8.0 macports-clang-7.0 macports-clang-6.0 macports-clang-5.0 :debug:configure Using compiler 'Xcode Clang' :debug:configure Executing org.macports.configure (p5.34-dbi) :debug:configure Environment: :debug:configure CC='/usr/bin/clang' :debug:configure CC_PRINT_OPTIONS='YES' :debug:configure CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/p5.34-dbi-442d65dc/work/.CC_PRINT_OPTIONS' |
何がなんでもXcodeのclangを使いたいらしい。
perlの関係って基本的にXcode大好きなの?
それとも、Macports全体的にそうだったりする?
ホントなんだよ、自分とこにコンパイラあるんだから、それ使えよ。
amavis-newとか、rustとか落とさせて自己コンパイルさせるんだぞ、見習え!(いやそこまでしなくて良い)
sudo port upgrade p5.34-dbi configure.compiler=macports-clang-15
コンパイラを強制変更して先へ進ませようとしてみる。
ログの内容は一緒だわ。
何がなんでもXcodeを使いたいらしい。
だって、こうだもの。
|
1 2 3 4 |
:debug:configure Using compiler 'Xcode Clang' :debug:configure Executing org.macports.configure (p5.34-dbi) :debug:configure Environment: :debug:configure CC='/usr/bin/clang' |
AIさんに、「これやってみて」と言われた通りやってみる。
sudo port install p5.34-dbi configure.compiler=macports-clang-15 configure.cc=”/opt/local/bin/clang” configure.env-append “CC=/opt/local/bin/clang” make.env-append “CC=/opt/local/bin/clang”
さて、結果は変わらずエラー。
内容確認していたら、また見つけたよ。
|
1 2 3 4 5 6 |
:debug:extract Environment: :debug:extract CC_PRINT_OPTIONS='YES' :debug:extract CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/p5.34-dbi-442d65dc/work/.CC_PRINT_OPTIONS' :debug:extract CPATH='/opt/local/include' :debug:extract DEVELOPER_DIR='/Library/Developer/CommandLineTools' :debug:extract LIBRARY_PATH='/opt/local/lib' |
DEVELOPER_DIR=’/Library/Developer/CommandLineTools’
Xcode大好き過ぎるだろ。
もう少し後ろに記述があったよ
|
1 2 3 4 |
:debug:configure Using compiler 'Xcode Clang' :debug:configure Executing org.macports.configure (p5.34-dbi) :debug:configure Environment: :debug:configure CC='/usr/bin/clang' |
もうこれ、信仰とか盲信とか一神教の崇拝者っぽいな。
自動化しようとしたら、条件に合わせてlibのpath書き換えるとか、pathsの先頭に/opt/local/binを噛ませるとか、php等のscriptで何とかなるものだろうか?
漏れそうだよねぇ。
結局、一度はConfigure動かして目で確かめないと、実行できんわな。
更に、clang-15固定になっちゃうねぇ。
下手打つと崩壊しそうだわ。
結果、MacPortsとHigh Sierraでは、ここ迄で限界らしい。
MAcPortsの管理下から外れるか、macOSを新しくするかの二択になりそうです。

