]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/2.45_Compilation_error.mdwn
ugly bug
[ikiwiki.git] / doc / bugs / 2.45_Compilation_error.mdwn
1 I have perl 5.10.0. Ikiwiki 2.44 compiles fine. Compiling 2.45 fails after 'make':
2
3     perl -Iblib/lib   ikiwiki.out -libdir . -setup docwiki.setup -refresh
4     refreshing wiki..
5     docwiki.setup: Failed to load plugin IkiWiki::Plugin::goodstuff: Failed to load plugin IkiWiki::Plugin::shortcut: Too many arguments for IkiWiki::srcfile at IkiWiki/Plugin/shortcut.pm line 16, near "1)"
6     Compilation failed in require at (eval 31) line 2.
7     BEGIN failed--compilation aborted at (eval 31) line 2.
8     BEGIN failed--compilation aborted at (eval 23) line 2.
9     BEGIN failed--compilation aborted at (eval 10) line 21.
10     make: *** [extra_build] Error 255
11
12 > I can't reproduce this. It looks like your IkiWiki.pm is out of sync with
13 > your IkiWiki/Plugin/shortcut.pm. The ones distributed in 2.45 are in
14 > sync. Or your perl is failing to use the right version of Ikiwiki.pm, 
15 > perhaps using a previously installed version. But the -Iblib/lib
16 > instructs perl to look in that directory first, and the Makefile
17 > puts Ikiwiki.pm there. --[[Joey]]
18
19 >> I removed all traces of the previous installation, and now 2.45 compiles.
20 >> I don't know why it was picking up the old version of Ikiwiki.pm, but now it
21 >> works. Please close this bug, and thanks for the help.
22
23 >>> Where were the files from the old installation? I still don't
24 >>> understand why they would be seen, since -Iblib/lib is passed to perl.
25 >>> --[[Joey]]
26
27 >>>> They were under /usr/local/{bin,lib,share}. I can try to provide more info,
28 >>>> or try to reproduce it, if you need me to.
29
30 >>>>> Well, here are some things to try.
31
32         perl -Iblib/lib -V
33
34 >>>>> This should have blib/lib first in the listed @INC
35
36         joey@kodama:~/src/ikiwiki>strace perl -Iblib/lib -e 'use IkiWiki' 2>&1 |grep IkiWiki.pm
37         stat64("blib/lib/IkiWiki.pmc", 0xbfa1594c) = -1 ENOENT (No such file or directory)
38         stat64("blib/lib/IkiWiki.pm", {st_mode=S_IFREG|0444, st_size=31982, ...}) = 0
39         open("blib/lib/IkiWiki.pm", O_RDONLY|O_LARGEFILE) = 5
40
41 >>>>> This is how perl finds IkiWiki.pm here. Note that I've run "make" first.
42
43 OK, this is what I'm getting:
44
45     $ perl -Iblib/lib -V
46     @INC:
47     blib/lib
48     /usr/lib/perl5/site_perl/5.10.0
49     /usr/share/perl5/site_perl/5.10.0
50     /usr/lib/perl5/vendor_perl
51     /usr/share/perl5/vendor_perl
52     /usr/share/perl5/vendor_perl
53     /usr/lib/perl5/core_perl
54     /usr/share/perl5/core_perl
55     /usr/lib/perl5/current
56     /usr/lib/perl5/site_perl/current
57
58 I ran the following in my current 2.45 source dir, where the `make` already succeded. If you need it, I can post the output
59 in the case where `make` fails.
60
61     $ strace perl -Iblib/lib -e 'use IkiWiki' 2>&1 |grep IkiWiki.pm
62     stat64("blib/lib/IkiWiki.pmc", 0xbfa6167c) = -1 ENOENT (No such file or directory)
63     stat64("blib/lib/IkiWiki.pm", {st_mode=S_IFREG|0444, st_size=31901, ...}) = 0
64     open("blib/lib/IkiWiki.pm", O_RDONLY|O_LARGEFILE) = 3
65
66 > I need to see it in the case where it's failing. --[[Joey]]
67
68 I finally had some time to look into this again.
69
70 I wiped ikiwiki off my system, and then installed version 2.41. I tried installing
71 2.46 and get the same error as above, so I'll be using 2.46 below. (BTW, the debian
72 page still lists 2.45 as current; I had to fiddle with the download link to get 2.46).
73
74 After running `./Makefile.PL` I get:
75
76     $ perl -Iblib/lib -V
77     [bunch of lines snipped]
78       @INC:
79     blib/lib
80     [bunch of paths snipped]
81
82 Running the strace:
83
84     $ strace perl -Iblib/lib -e 'use IkiWiki' 2>&1 |grep IkiWiki.pm
85
86 I get a bunch of ENOENTs and then at the end:
87
88     stat64("./IkiWiki.pmc", 0xbfa2fe5c)     = -1 ENOENT (No such file or directory)
89     stat64("./IkiWiki.pm", {st_mode=S_IFREG|0644, st_size=31987, ...}) = 0
90     open("./IkiWiki.pm", O_RDONLY|O_LARGEFILE) = 3
91
92 After running `make` (and having it fail as described above):
93
94     $ strace perl -Iblib/lib -e 'use IkiWiki' 2>&1 |grep IkiWiki.pm
95     stat64("blib/lib/IkiWiki.pmc", 0xbfd7999c) = -1 ENOENT (No such file or directory)
96     stat64("blib/lib/IkiWiki.pm", {st_mode=S_IFREG|0444, st_size=31901, ...}) = 0
97     open("blib/lib/IkiWiki.pm", O_RDONLY|O_LARGEFILE) = 3
98
99 I don't know what is going on, but I'll run any more tests you need me to.
100
101 > No help.  
102 > The only further thing I can think to try is `strace -f` the entire failing
103 > `make` run (or the ikiwiki command that's failing in it, if you can
104 > reproduce the failure at the command line). --[[Joey]]
105
106 I have 2.46 installed and I can reproduce the bug reported against 2.49. The command that fails is:
107
108     $ /usr/bin/perl -Iblib/lib   ikiwiki.out -libdir . -setup docwiki.setup -refresh
109     docwiki.setup: Failed to load plugin IkiWiki::Plugin::inline: Too many arguments for IkiWiki::htmlize at IkiWiki/Plugin/inline.pm line 359, near "))"
110     Compilation failed in require at (eval 14) line 2.
111     BEGIN failed--compilation aborted at (eval 14) line 2.
112     BEGIN failed--compilation aborted at (eval 10) line 21.
113
114 strace -f produces a 112K file. I don't know enough to be comfortable analyzing it.
115 However, lines like:
116
117     stat64("/usr/local/share/perl5/site_perl/5.10.0/IkiWiki.pm", {st_mode=S_IFREG|0444, st_size=31982, ...}) = 0
118
119 make me think the make process is not completely independent of a previous
120 installation. Joey, should I email you the strace log file?
121
122 > Email it (joey@ikiwiki.info), or post it to a website somewhere.
123 > --[[Joey]]
124
125 > The relevant part of the file is:
126
127         execve("/usr/bin/perl", ["/usr/bin/perl", "-Iblib/lib", "ikiwiki.out", "-libdir", ".", "-setup", "docwiki.setup", "-refresh"], [/* 55 vars */]) = 0
128         [...]
129         stat64("blib/lib/5.10.0/i686-linux-thread-multi", 0xbfa72240) = -1 ENOENT (No such file or directory)
130         stat64("blib/lib/5.10.0", 0xbfa72240)   = -1 ENOENT (No such file or directory)
131         stat64("blib/lib/i686-linux-thread-multi", 0xbfa72240) = -1 ENOENT (No such file or directory)
132         [...]
133         stat64("/usr/local/share/perl5/site_perl/5.10.0/IkiWiki.pmc", 0xbfa71e5c) = -1 ENOENT (No such file or directory)
134         stat64("/usr/local/share/perl5/site_perl/5.10.0/IkiWiki.pm", {st_mode=S_IFREG|0444, st_size=31982, ...}) = 0
135         open("/usr/local/share/perl5/site_perl/5.10.0/IkiWiki.pm", O_RDONLY|O_LARGEFILE) = 4
136
137 > So it doesn't look for IkiWiki.pm in blib at all. But it clearly has been asked to look in blib, since it
138 > looks for the 3 directories in it. When I run the same thing locally, I get:
139
140         execve("/usr/bin/perl", ["/usr/bin/perl", "-Iblib/lib", "ikiwiki.out", "-libdir", ".", "-setup", "docwiki.setup", "-refresh"], [/* 55 vars */]) = 0
141         [...]
142         stat64("blib/lib/5.10.0/i486-linux-gnu-thread-multi", 0xbf84f320) = -1 ENOENT (No such file or directory)
143         stat64("blib/lib/5.10.0", 0xbf84f320) = -1 ENOENT (No such file or directory)
144         stat64("blib/lib/i486-linux-gnu-thread-multi", 0xbf84f320) = -1 ENOENT (No such file or directory)
145         [...]
146         stat64("blib/lib/IkiWiki.pmc", 0xbf84ef4c) = -1 ENOENT (No such file or directory)
147         stat64("blib/lib/IkiWiki.pm", {st_mode=S_IFREG|0444, st_size=32204, ...}) = 0
148         open("blib/lib/IkiWiki.pm", O_RDONLY|O_LARGEFILE) = 6
149
150 > The thing I really don't understand is why, on the system where perl fails
151 > to look in blib when straced as above, we've already established it *does*
152 > look for it when `perl -Iblib/lib -e 'use IkiWiki'` is straced.
153
154 > The only differences between the two calls to perl seem to be:
155 > * One runs `perl`, and the other `/usr/bin/perl` -- are these really
156 >   the same program? Does `perl -lblib/lib ikiwiki.out -libdir . -setup docwiki.setup -refresh`
157 >   fail the same way as the `/usr/bin/perl` variant?
158 > * The `-libdir .`, which causes ikiwiki to modify `@INC`, adding "." to 
159 >   the front of it.
160
161 > I'm entirely at a loss as to why I cannot reproduce this with the same
162 > versions of perl and ikiwiki as the two people who reported it. There must
163 > be something unusual about your systems that we have not figured out yet. --[[Joey]]
164
165 Joey, thanks for your time and effort looking into this.
166
167 I checked with `which`: `perl` is indeed `/usr/bin/perl`. The commands fail similarly when
168 calling `perl` and `/usr/bin/perl`.
169
170 However, you might be into something with your `libdir` idea. If I remove it from the
171 command line, the command succeeds. In other words, if I run
172
173     perl -Iblib/lib   ikiwiki.out -setup docwiki.setup -refresh
174
175 then it works perfectly.
176
177 > Well, that's just weird, because `libdir` is handled by code in IkiWiki.pm.
178 > So I don't see how setting it could affect its searching for IkiWiki.pm at all,
179 > actually. It could only affect its searching for files loaded later. Anyway,
180 > can I get a strace of it succeeding this way?
181
182 > Also, can you show me the first 15 lines of your `ikiwiki.out`? It's occurred to me
183 > you might have an unusual `use lib` line in it.
184
185 By the way, I'm running Arch linux. The perl build script is a bit long, but I
186 see they install a patch to modify @INC: <http://repos.archlinux.org/viewvc.cgi/perl/repos/core-i686/perl-5.10.0-archlinux-inc-order.patch?revision=1&view=markup>
187
188 Would you suggest I try rebuilding perl without this patch? Debian has a huge perl patch (102K!);
189 it's not straightforward for me to see if they do something similar to Arch.
190
191 > I think Debian has a similar patch.
192
193 ---
194
195 [[done]] -- apparently this was a problem due to a distribution's
196 customisation to perl, or something. Seems to late now to track down what,
197 unfortunatly. And ikiwiki's Makefile no longer uses the "-libdir" switch
198 that seemed to trigger the bug. --[[Joey]]