bugGNUstep - Bugs: bug #21142, bug#19720 still not fixed in the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #21142: bug#19720 still not fixed in the current tree

Submitted by:  Friedrich <fridom>
Submitted on:  Sun 23 Sep 2007 01:30:49 PM UTC  
 
Category: ApplicationSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Gregory John Casamento <gcasa>
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Thu 19 Jun 2008 07:21:45 PM UTC, comment #6:

Moving to "In Test" state since the original submitter is testing with newly compiled binary. :) GC

Gregory John Casamento <gcasa>
Project AdministratorIn charge of this item.
Thu 19 Jun 2008 07:18:40 PM UTC, comment #5:

Let me know, after further testing, if you believe this bug can be closed.

I will also make a note in bug #19720 to refer people to this issue as it's continuation. The correct course would have been to re-open the previous bug.

GC

Gregory John Casamento <gcasa>
Project AdministratorIn charge of this item.
Thu 19 Jun 2008 07:29:20 AM UTC, comment #4:

Ok, after a new round of compilations it finally builds the project, and it finds the executable while launching.

Regards
Friedrich

Friedrich <fridom>
Thu 11 Oct 2007 04:28:56 PM UTC, comment #3:

Well I know that my suggestions sucks. But I would appreciate at least a small feedback within 14 days....

Regards
Friedrich

Friedrich <fridom>
Mon 24 Sep 2007 09:54:30 AM UTC, comment #2:

I'm a bit too short on time. Here's a suggested patch. It seems to make the right thing but ProjectCenter crashes later (for unkown reasons)

Problem it seems that the pathes where the generated files and are moving constantly. So one has to patch run and debug also. I'm sorry but I can not finish that currently.

/* is this a good idea? 2007-09-24 11:03:12 frido */
- (NSString*)findExecutable
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *savedSubDir;
NSString *tPath;
NSString *execFileName;
NSString *projectName = [project projectName];

execFileName = [project projectName];
if ( ! [fm isExecutableFileAtPath: execFileName])
/* not in the current directory */
{
/* check the projectName.debug subdirectory */
/* this is the path in debug builds has to be changed for release builds .... */
/* so in the end we have to check what kind of build we're running */
execFileName = nil;
execFileName = [projectName stringByAppendingPathExtension: @"debug"];
savedSubDir = [NSString stringWithString: execFileName];
execFileName = [execFileName stringByAppendingPathComponent: projectName];

if (! [fm isExecutableFileAtPath: execFileName])
{
/* no it's not there so go down another level */
execFileName = savedSubDir;
AUTORELEASE(savedSubDir);
tPath = [projectName stringByAppendingPathExtension: @"build"];
execFileName = [execFileName stringByAppendingPathComponent: tPath];
savedSubDir = [NSString stringWithString: execFileName];
execFileName = [execFileName stringByAppendingPathComponent: projectName];
/* test again */
if (! [fm isExecutableFileAtPath: execFileName])
{
/* well then try another subdirectory which currently seems to be named obj,
I do not feel running behind this is a good idea. IMHO one should save away the
location of the executable to not need this kind of hack */
execFileName = [savedSubDir stringByAppendingPathComponent:@"obj"];
execFileName = [execFileName stringByAppendingPathComponent:projectName];
/* now test again */
if (! [fm isExecutableFileAtPath: execFileName])
{
/* now we're giving up */
[NSException raise:@"No executable found" format:@""];
}

}

}
}
if (NULL != savedSubDir) AUTORELEASE(savedSubDir);
assert(NULL != execFileName);
NSLog(execFileName);
return [NSString stringWithString: execFileName];
}

I patched run: like this:
- (void)run:(id)sender
{
NSMutableArray *args = [[NSMutableArray alloc] init];
NSPipe *logPipe;
NSPipe *errorPipe;
NSString *openPath;
NSString *exeFileName;

// Check if project type is executable
if ([project isExecutable])
{
openPath = [project execToolName];
if ([openPath isEqualToString: @"openapp"])
{
exeFileName = [self findExecutable];
/* openapp ./MyApplication.app */
[args addObject: [NSString stringWithFormat: @"./%@", exeFileName]];
AUTORELEASE(exeFileName);
}
else
{
/* opentool MyTool */
exeFileName = [self findExecutable];
[args addObject: exeFileName];
AUTORELEASE(exeFileName);

}
}
else
{
NSRunAlertPanel(@"Run",
@"The project is not executable",
@"Close", nil, nil, nil);
[runButton setState:NSOffState];
return;
}

// [makeTask isRunning] doesn't work here.
// "waitpid 7045, result -1, error No child processes" is printed.
if (launchTask)
{
PCLogStatus(self, @"task will terminate");
[launchTask terminate];
return;
}

// Setting I/O
logPipe = [NSPipe pipe];
RELEASE(readHandle);
readHandle = [[logPipe fileHandleForReading] retain];
[stdOut setString:@""];
[readHandle waitForDataInBackgroundAndNotify];

[NOTIFICATION_CENTER addObserver:self
selector:@selector(logStdOut:)
name:NSFileHandleDataAvailableNotification
object:readHandle];

errorPipe = [NSPipe pipe];
RELEASE(errorReadHandle);
errorReadHandle = [[errorPipe fileHandleForReading] retain];
[stdOut setString:@""];
[errorReadHandle waitForDataInBackgroundAndNotify];

[NOTIFICATION_CENTER addObserver:self
selector:@selector(logErrOut:)
name:NSFileHandleDataAvailableNotification
object:errorReadHandle];

// Launch task
RELEASE(launchTask);
launchTask = [[NSTask alloc] init];

[NOTIFICATION_CENTER addObserver:self
selector:@selector(runDidTerminate:)
name:NSTaskDidTerminateNotification
object:launchTask];
[launchTask setArguments:args];
[launchTask setCurrentDirectoryPath:[project projectPath]];
[launchTask setLaunchPath:openPath];
[launchTask setStandardOutput:logPipe];
[launchTask setStandardError:errorPipe];
[launchTask launch];

[debugButton setEnabled:NO];

_isRunning = YES;
RELEASE(args);
}

But left out the stuff in debug (around line 266)
/* We try in the order:
* xxx.debug/xxx (gnustep-make v1, application),
* xxx.app/xxx (gnustep-make v1 and v2, application),
* obj/xxx (gnustep-make v1 and v2, tool).
*/
fp = [project projectPath];
fp = [fp stringByAppendingPathComponent: [projectName stringByAppendingPathExtension: @"debug"]];
fp = [fp stringByAppendingPathComponent: projectName];

if (! [fm isExecutableFileAtPath: fp])
{
fp = [project projectPath];
fp = [fp stringByAppendingPathComponent: [projectName stringByAppendingPathExtension: @"app"]];
fp = [fp stringByAppendingPathComponent: projectName];

if (! [fm isExecutableFileAtPath: fp])
{
fp = [project projectPath];
fp = [fp stringByAppendingPathComponent: @"obj"];
fp = [fp stringByAppendingPathComponent: projectName];
}
}

This has to be changed also. My suggestion would be either using an own function for that search or better IMHO. Storing the path to the outputted files somewhere.

As said I'M short on time therefor this is just a hackerish try.

Regards
Friedrich

Friedrich <fridom>
Sun 23 Sep 2007 01:32:57 PM UTC, comment #1:

Sorry should be 19720
Regards
Friedrich

Friedrich <fridom>
Sun 23 Sep 2007 01:30:49 PM UTC, original submission:

Although this bug was closed around 4 months ago it is still there in the newest sources. One can neither start a generated project nor debug it.

I do not know how to Reopen a bug. So if someone knows please do so

Regards
Friedrich

Friedrich <fridom>

 

No files currently attached

 

Depends on the following items

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rmottola (Updated the item)
  • -unavailable- added by gcasa (Posted a comment)
  • -unavailable- added by fridom (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Jun 2010 11:02:26 AM UTCrmottolaOpen/ClosedIn Test=>Closed
    Fri 18 Jun 2010 11:02:25 AM UTCrmottolaStatusIn Progress=>Fixed
    Thu 19 Jun 2008 07:21:45 PM UTCgcasaOpen/ClosedOpen=>In Test
    Thu 19 Jun 2008 07:18:40 PM UTCgcasaSummary#192720 still not fixed in the current tree=>bug #19720 still not fixed in the current tree
    Thu 19 Jun 2008 07:18:39 PM UTCgcasaStatusNone=>In Progress
      Assigned toNone=>gcasa
    Sat 14 Jun 2008 04:47:31 PM UTCFredKieferDependencies-=>Depends on bugs #19720

    Back to the top


    Powered by Savane 3.1-cleanup1