reassign 593898 src:gnustep-base 1.20.1-3
retitle 593898 Should be built without libkvm on GNU/kFreeBSD; +[NSProcessInfo 
load] aborts programs with many arguments if HAVE_KVM_ENV
thanks

В 12:39 +0200 на 27.08.2010 (пт), Axel Beckert написа:
> > I'd be surprised if it builds,
> 
> It does build.
> 
> > and even more surprised if it works.
> 
> At least mknfonts works, too.

Thanks, that's good news.  I wonder why libkvm-dev was added as
build-dependency during the initial GNU/kFreeBSD support (#267889).
Probably the kernel+system was less capable 5 years ago, and it was
actually needed.

> Anything else I should check (some GUI stuff perhaps) if it still
> works?

Yes.  Because such a change is a bit risky at this point of the release
preparation, please do the following:

     1. Check if there are any compilation warnings for
        Source/NSProcessInfo.m
     2. Run some non-trivial apps (cenon.app, gworkspace.app,
        cynthiune.app) and see if you can spot some bugs (except the
        usual ones, I mean :-)).
     3. Compile and run the attached test program.  As far as I can see
        from the code, -[NSProcessInfo operatingSystemName] will issue a
        warning and return the incorrect GSGNULinuxOperatingSystem.
        That's completely harmless (and not a regression); I'll fix it
        directly upstream when I get a chance to resurrect my
        GNU/kFreeBSD machine.  All tests should pass, otherwise we need
        to investigate more.

Thanks!
#import <Foundation/Foundation.h>

static void
test (NSUInteger pass, NSString *desc)
{
  GSPrintf (stderr, pass ? @"PASS: " : @"FAIL: ");
  GSPrintf (stderr, @"%...@\n", desc);
}

int
main (int argc, char **argv, char **env)
{
  CREATE_AUTORELEASE_POOL (pool);
  id o;
  int pid;
  BOOL log;
  NSUInteger v;
  NSString *f;
  NSProcessInfo *pinfo;

  pinfo = [NSProcessInfo processInfo];
  test (pinfo != nil, @"+processInfo");
  
  o = [pinfo arguments];
  test (pinfo != nil && o != nil && [o isKindOfClass: [NSArray class]]
	&& [o count] > 0, @"-arguments");
  
  o = [pinfo environment];
  test (o != nil && [o isKindOfClass: [NSDictionary class]],
	@"-environment");
  
  o = [pinfo globallyUniqueString];
  test (o != nil && [o isKindOfClass: [NSString class]] && [o length] > 0,
	@"-globallyUniqueString");
  GSPrintf (stderr, @"\tUnique string: %...@\n", o);
  
  o = [pinfo hostName];
  test (o != nil && [o isKindOfClass: [NSString class]] && [o length] > 0,
	@"-hostName");
  GSPrintf (stderr, @"\tHostname: %...@\n", o);
  
  v = [pinfo operatingSystem];
  test (v > 0, @"-operatingSystem");
  
  o = [pinfo operatingSystemName];
  test (o != nil && [o isKindOfClass: [NSString class]] && [o length] > 0,
	@"-operatingSystemName");
  GSPrintf (stderr, @"\tOperating system: %...@\n", o);
  
  o = [pinfo operatingSystemVersionString];
  test (o != nil && [o isKindOfClass: [NSString class]] && [o length] > 0,
	@"-operatingSystemVersionString");
  GSPrintf (stderr, @"\tVersion: %...@\n", o);
  
  pid = [pinfo processIdentifier];
  test (pid > 0, @"-processIdentifier");
  GSPrintf (stderr, @"\tPID: %d\n", pid);

  o = [pinfo processName];
  test (o != nil && [o isKindOfClass: [NSString class]] && [o length] > 0,
	@"-processName");
  GSPrintf (stderr, @"\tProcess name: %...@\n", o);
  
  [pinfo setProcessName: @"foo"];
  test ([pinfo processName] == @"foo", @"-setProcessName:");
  GSPrintf (stderr, @"\tNew process name: %...@\n", [pinfo processName]);

  f = NSTemporaryDirectory ();
  f = [f stringByAppendingPathComponent: @"NSProcessInfo_test"];
  log = [pinfo setLogFile: f];
  test (log, @"-setLogFile:");
  GSPrintf (stderr, @"\tLog file: %...@\n", f);

  RELEASE (pool);
  exit (EXIT_SUCCESS);
}

Reply via email to