Opened 8 years ago

Last modified 8 years ago

#49570 new defect

ackmate: hardcode full path to the perl interpreter

Reported by: mojca (Mojca Miklavec) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: dbevans (David B. Evans)
Port: ackmate

Description

The file

/Applications/MacPorts/AckMate.tmplugin/Contents/Resources/ackmate_ack

from ackmate should be fixed to use the same version of Perl as ack uses.

Attachments (1)

main.log (178.2 KB) - added by dbevans (David B. Evans) 8 years ago.
Build log showing build failure on Yosemite

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by mojca (Mojca Miklavec)

I submitted a patch in r142097, but it doesn't automatically use the correct version of Perl. Ideally we should be able to get rid of specifying any version of Perl in that port and simply check which version of perl is used by ack.

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

That would make ackmate not build reproducibly. If ackmate (and ack) want to offer the option of building against different versions of perl, they must do so using variants.

comment:3 Changed 8 years ago by danielluke (Daniel J. Luke)

This would also be fixed by just having one version of perl5 (the current upstream stable release).

comment:4 Changed 8 years ago by dbevans (David B. Evans)

As of r142181, ack builds using perl5.22 only, no variants. So just need to configure ackmate to use perl5.22.

It appears to me that ackmate invokes ackmate_ack programmatically in source/controllers/JPAckTypesProcess.m as follows:

- (void)invokeWithPath:(NSString*)path options:(NSArray*)options
{
  ackState = ackInitial;

  self.ackTask = [[[NSTask alloc] init] autorelease];

  NSString* ackmateAck = [[[NSBundle bundleForClass:self.class] resourcePath] stringByAppendingPathComponent:@"ackmate_ack"];

  [self.ackTask setCurrentDirectoryPath:path];

  [self.ackTask setLaunchPath:@"/usr/bin/env"];
  NSMutableArray* args = [NSMutableArray arrayWithObjects:@"perl", ackmateAck, nil];

so this needs to be patched something like

  [self.ackTask setLaunchPath:@"/opt/local/bin/perl5.22"];
  NSMutableArray* args = [NSMutableArray arrayWithObjects:ackmateAck, nil];

Because of this, the shebang in ackmate_ack is probably irrelevant.

I can't test this hypothesis because ackmate fails during build for me on Yosemite. See attached main.log.

Changed 8 years ago by dbevans (David B. Evans)

Attachment: main.log added

Build log showing build failure on Yosemite

comment:5 Changed 8 years ago by dbevans (David B. Evans)

Summary: ackmate: replace "!/usr/bin/env perl"ackmate: use perl5.22

comment:6 Changed 8 years ago by dbevans (David B. Evans)

Note also that the way this app is constructed (not a typical perl build), you don't need to use the perl5 PortGroup and associated variables. Just add a dependency on perl5.22.

comment:7 Changed 8 years ago by mojca (Mojca Miklavec)

Summary: ackmate: use perl5.22ackmate: hardcode full path to the perl interpreter
Note: See TracTickets for help on using tickets.