beyondgrep / ack2

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

2.0+ fails to build under cron #259

Closed ghost closed 11 years ago

ghost commented 11 years ago

I normally update my cpan modules from a cron job cpan-outdated -p | cpanm. This works for all my installed modules including ack 1.94. But when ack 2.0 was released, it would never install due to test errors. When running make test manually from within the dist dir (as fetched from cpanm --look App::Ack) all tests pass. The build.log produced from the cron job gives no obvious indications of what may be the cause.

perl -v: This is perl 5, version 16, subversion 3 (v5.16.3) built for darwin-2level

Running perl -V from shell and cron produced no differences except for a few PERLBREW environment variables, which should not affect this.

Cron output: http://paste.scsys.co.uk/244765

petdance commented 11 years ago

Does it build OK when you run it outside of cron?

ghost commented 11 years ago

Yes, it builds and tests fine when run outside of cron. The cron job does run as the same user and has the same PATH set.

sth commented 11 years ago

Looks to me like it doesn't find the test suite data because it's running in a different working directory?

ghost commented 11 years ago

Not sure it's that simple. cpanm is pretty smart about that stuff and I've never encountered this error for any of the other hundreds of distributions that get updated this way for me.

petdance commented 11 years ago

I don't think this is an ack problem.

I don't know what I can do to help diagnose your problem. You're running an environment that I don't know and I don't know what you expect me/us to do to help figure that out.

produced no differences except for a few PERLBREW environment variables, which should not affect this.

I would start there, even if it "should not affect this."

ghost commented 11 years ago

I don't think this is an ack problem.

Since every other perl distribution on my system works fine using this method, this points to a problem specifically in the ack distribution.

I don't know what I can do to help diagnose your problem. You're running an environment that I don't know and I >don't know what you expect me/us to do to help figure that out.

None of the ack developers use cron or cpanm?!

produced no differences except for a few PERLBREW environment variables, which should not affect this.

I would start there, even if it "should not affect this."

I have confirmed that is not an issue.

tehmoth commented 11 years ago

system perl (no perlbrew / local-lib) and cpanm or cpan fail in the same way

hoelzro commented 11 years ago

@BugAndNewsReporter Have you tried just building ack from within a cron job, as opposed to using cpanm? I'd like to see if that affects things.

ghost commented 11 years ago

@BugAndNewsReporter Have you tried just building ack from within a cron job, as opposed to using cpanm? I'd like to see if that affects things.

Got the same results using this instead of cpanm: cd /tmp/ack-2.04 && perl Makefile.PL && make test TEST_VERBOSE=1

petdance commented 11 years ago

cd /tmp/ack-2.04 && perl Makefile.PL && make test TEST_VERBOSE=1

Now that's something I can work with.

hoelzro commented 11 years ago

@BugAndNewsReporter Which OS are you on? Which cron implementation are you using?

ghost commented 11 years ago

@BugAndNewsReporter Which OS are you on? Which cron implementation are you using?

Mac OS X. Vixie cron.

hoelzro commented 11 years ago

Ok, I got this to fail on my machine as well. I'll look into it.

petdance commented 11 years ago

Also: what file is failing? All of them? Just normally right now t/ack-type.t is failing for me. Is that what is failing in this case?

ghost commented 11 years ago

See the link to the output in the initial bug report.

mmcclimon commented 11 years ago

FWIW, I can't get this to fail using cpanm or building in /tmp, so I'm afraid I can't be much help.

hoelzro commented 11 years ago

I'm seeing that for file-finding tests, it's coming with '-' as a file, which makes me think that it's doing something with STDIN. Since it's running as a cronjob (which probably doesn't have a terminal), I'm guessing our terminal detection is breaking for cron jobs.

petdance commented 11 years ago

Our terminal detection is the bane of my existence. However we do it, someone doesn't like it. :-(

hoelzro commented 11 years ago

After running a simple test, I'm 99% sure this is the problem.

petdance commented 11 years ago

Please don't change any terminal detection until we've had time to discuss, perhaps on ack-dev.

hoelzro commented 11 years ago

Yeah, I don't plan on it. I know that we have a lot of weird corner cases to cover =/

hoelzro commented 11 years ago

Nevermind; I think it's the check for filter mode.

hoelzro commented 11 years ago

This is fixed on the dev branch.

@BugAndNewsReporter Please pull from git and test this out!

ghost commented 11 years ago

Confirmed, works fine now. Thanks!