beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 138 forks source link

Build fails in Windows #442

Closed jgbishop closed 10 years ago

jgbishop commented 10 years ago

I recently downloaded the dev branch of ack2, and tried to build it on a Windows system (using cygwin and ActivePerl 5.14.3). Creating the Makefile works just fine, but attempting to then make or make ack-standalone results in the following error:

Makefile:901: *** multiple target patterns.  Stop.

Line 901 for me is:

$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)

This problem is due to the fact that the paths used in several Makefile variables contain colons (thanks to Windows paths). I believe this is a duplicate of issue #255, but that issue was (strangely) closed.

In my sandbox, I managed to fix this problem by adding a --cygwin flag to Makefile.PL. When I supply said flag, the script modifies the Makefile after it is created, massaging the paths from Windows-style into cygwin-style. For example, C:\path\to\perl becomes /cygdrive/c/path/to/perl. I can supply those modifications if anyone is interested.

hoelzro commented 10 years ago

@jgbishop Thanks for looking into this! I'm wondering if the best course of action here would be an FAQ item explaining the situation.

andalou commented 10 years ago

I built it with MinGW and perl 5.18.1 (ActiveState) on Windows 7 without any problem. The only problem was that not all tests passed.

I proceeded in the following way: perl Makefile.PL dmake dmake test dmake ack-standalone

petdance commented 10 years ago

The only problem was that not all tests passed.

That is a problem. Can you please paste the failing tests?

andalou commented 10 years ago

Andy Lester wrote:

The only problem was that not all tests passed.

That is a problem. Can you please paste the failing tests?

OK. Here it is:

C:\Perl\bin\perl.exe t/runtests.pl 0 0 "blib\lib" "blib\arch" t/.t t/lib/.t Running tests on blib/script/ack t/00-load.t .................. ok t/ack-1.t .................... ok t/ack-c.t .................... ok t/ack-color.t ................ ok t/ack-column.t ............... ok t/ack-create-ackrc.t ......... ok t/ack-dump.t ................. ok t/ack-f.t .................... ok t/ack-files-from.t ........... Dubious, test returned 13 (wstat 3328, 0xd00) Failed 3/3 subtests t/ack-filetypes.t ............ ok t/ack-g.t .................... ok t/ack-group.t ................ ok t/ack-h.t .................... ok t/ack-help-types.t ........... ok t/ack-help.t ................. ok t/ack-i.t .................... ok t/ack-ignore-dir.t ........... ok t/ack-interactive.t .......... skipped: You need to install IO::Pty to run this test t/ack-invalid-ackrc.t ........ skipped: Don't yet have a reliable way to ignore the Unicode complaints from Pod::Perldoc t/ack-k.t .................... ok t/ack-known-types.t .......... ok t/ack-line.t ................. skipped: You need to install IO::Pty to run this test t/ack-m.t .................... ok t/ack-match.t ................ Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/14 subtests t/ack-n.t .................... ok t/ack-named-pipes.t .......... skipped: POSIX::mkfifo not implemented on this architecture at t/ack-named-pipes.t line 21. t/ack-o.t .................... Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/12 subtests t/ack-pager.t ................ skipped: You need to install IO::Pty to run this test t/ack-passthru.t ............. ok t/ack-print0.t ............... ok t/ack-removed-options.t ...... ok t/ack-s.t .................... ok t/ack-show-types.t ........... ok t/ack-type-del.t ............. ok t/ack-type.t ................. Dubious, test returned 13 (wstat 3328, 0xd00) Failed 4/16 subtests t/ack-v.t .................... ok t/ack-w.t .................... ok t/ack-x.t .................... ok t/anchored.t ................. ok t/asp-net-ext.t .............. ok t/bad-ackrc-opt.t ............ ok t/basic.t .................... ok t/command-line-files.t ....... ok t/config-backwards-compat.t .. Dubious, test returned 13 (wstat 3328, 0xd00) Failed 3/3 subtests t/config-finder.t ............ Dubious, test returned 13 (wstat 3328, 0xd00) Failed 4/26 subtests t/config-loader.t ............ ok t/context.t .................. ok t/default-filter.t ........... ok t/exit-code.t ................ ok t/ext-filter.t ............... ok t/file-permission.t .......... skipped: Can't be checked under Win32 t/filetypes.t ................ ok t/filter.t ................... ok t/firstlinematch-filter.t .... ok t/highlighting.t ............. ok t/illegal-regex.t ............ ok t/incomplete-last-line.t ..... ok t/inverted-file-filter.t ..... ok t/is-filter.t ................ ok t/issue244.t ................. ok t/issue276.t ................. Dubious, test returned 13 (wstat 3328, 0xd00) Failed 2/2 subtests t/lib/00-coverage.t .......... ok t/lib/Ack.t .................. ok t/lib/Basic.t ................ ok t/lib/Collection.t ........... ok t/lib/ConfigDefault.t ........ ok t/lib/ConfigFinder.t ......... ok t/lib/ConfigLoader.t ......... ok t/lib/Default.t .............. ok t/lib/Extension.t ............ ok t/lib/ExtensionGroup.t ....... ok t/lib/Filter.t ............... ok t/lib/FirstLineMatch.t ....... ok t/lib/Inverse.t .............. ok t/lib/Is.t ................... ok t/lib/IsGroup.t .............. ok t/lib/Match.t ................ ok t/lib/Resource.t ............. ok t/lib/Resources.t ............ ok t/longopts.t ................. ok t/lua-shebang.t .............. ok t/match-filter.t ............. ok t/mutex-options.t ............ Dubious, test returned 13 (wstat 3328, 0xd00) Failed 1/250 subtests t/noackrc.t .................. ok t/noenv.t .................... ok t/process-substitution.t ..... skipped: Test unreliable on Windows. t/r-lang-ext.t ............... ok t/resource-iterator.t ........ ok t/zero.t ..................... ok

Test Summary Report

t/ack-files-from.t (Wstat: 3328 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 13 Parse errors: Bad plan. You planned 3 tests but ran 1. t/ack-match.t (Wstat: 1024 Tests: 14 Failed: 4) Failed tests: 11-14 Non-zero exit status: 4 t/ack-o.t (Wstat: 1024 Tests: 12 Failed: 4) Failed tests: 9-12 Non-zero exit status: 4 t/ack-type.t (Wstat: 3328 Tests: 12 Failed: 0) Non-zero exit status: 13 Parse errors: Bad plan. You planned 16 tests but ran 12. t/config-backwards-compat.t (Wstat: 3328 Tests: 0 Failed: 0) Non-zero exit status: 13 Parse errors: Bad plan. You planned 3 tests but ran 0. t/config-finder.t (Wstat: 3328 Tests: 23 Failed: 1) Failed test: 23 Non-zero exit status: 13 Parse errors: Bad plan. You planned 26 tests but ran 23. t/issue276.t (Wstat: 3328 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 13 Parse errors: Bad plan. You planned 2 tests but ran 1. t/mutex-options.t (Wstat: 3328 Tests: 250 Failed: 1) Failed test: 250 Non-zero exit status: 13 Files=89, Tests=887, 199 wallclock secs ( 0.83 usr + 0.17 sys = 1.00 CPU)

Result: FAIL

jgbishop commented 10 years ago

I should mention that I used GNU make in my sandbox. I'm not familiar with dmake.

pdl commented 10 years ago

@jgbishop you mention both ActivePerl and cygwin, which is confusing. Can you install other perl modules using the same process you're describing above?

I don't belive ActivePerl will work reliably under cygwin (it's supposed to be standalone) and if you've set cygwin up to use ActivePerl then you may want to try to pick this apart or reinstall cygwin.

Cygwin comes with perl in its packages, and with a clean install of cygwin including perl (and ack2 dependencies) make and make test runs the tests fine (though some tests do not pass).

For typical ActivePerl installs (i.e. running outside of cygwin), ActiveState suggests nmake - http://docs.activestate.com/activeperl/5.10/faq/Windows/ActivePerl-Winfaq9.html

You may also wish to consider strawberry perl which, like ActivePerl, does not require cygwin, and comes with a working dmake.

Does this help?

pdl commented 10 years ago

@jgbishop further to the above, using GNU Make on Windows will probably not work for a large proportion of CPAN as ExtUtils::MakeMaker (which ack uses to make the Makefile) has the following to say: "Note that this module does not support generating Makefiles for GNU Make on Windows." (I ran into that comment and recalled this thread, hence the post).

@petdance @hoelzro I think this issue does not describe a bug in ack and hope it can be closed.

hoelzro commented 10 years ago

@jgbishop @pdl Thanks for all the input, both of you. Should @petdance or I close the issue, then?

jgbishop commented 10 years ago

Yeah, this should probably be closed. Sorry for the confusion.