View Issue Details

IDProjectCategoryView StatusLast Update
0036418LazarusIDEpublic2019-12-12 12:37
ReporterHans Luijten Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformCocoaOSmacOS 
Product Version2.0.7 (SVN) 
Summary0036418: External Tools again fail to execute when the external tool is an .app application (+patch attached)
DescriptionWith the latest SVN of Lazarus (62054), external .app bundles no longer execute (related to bug 0036314, but it resurfaced in a slightly different shape).
This is caused by the following line in exttools.pas:

if not ( FilenameIsAbsolute(s) and FileExistsUTF8(s) ) then ...

Under macOS external tools can also be directories (.app bundles).
I've created a patch for this that changes this line to:

if not ( FilenameIsAbsolute(s) and ( FileExistsUTF8(s) {$IFDEF DARWIN}or DirectoryExistsUTF8(s){$ENDIF}) ) then
Steps To ReproduceExecute an external tool that is an .app bundle from the External tools menu.
Note; without the patch in bug 0036417, you cannot select an .app bundle.
Additional InformationLazarus 2.1.0 r62054M FPC 3.3.1 x86_64-darwin-cocoa (beta)
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCocoa
Attached Files

Relationships

related to 0036314 closedJuha Manninen External Tools fail to execute when the external tool is an .app application (low priority) 
related to 0036417 closedJuha Manninen Cannot select .app bundles in external tools (patch) 

Activities

Hans Luijten

2019-12-10 14:33

reporter  

exttools.patch (561 bytes)   
Index: exttools.pas
===================================================================
--- exttools.pas	(revision 62372)
+++ exttools.pas	(working copy)
@@ -1037,7 +1038,7 @@
         exit;
       end;
     end;
-    if not ( FilenameIsAbsolute(s) and FileExistsUTF8(s) ) then begin
+    if not ( FilenameIsAbsolute(s) and ( FileExistsUTF8(s) {$IFDEF DARWIN}or DirectoryExistsUTF8(s){$ENDIF}) ) then begin
       debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,'  failed: missing executable: "',s,'"']);
       exit;
     end;
exttools.patch (561 bytes)   

Juha Manninen

2019-12-11 14:07

developer   ~0119750

Last edited: 2019-12-11 14:14

View 2 revisions

0036314 was solved in r62254. Do you mean things worked then but not any more? In that case which revision broke it?

Hans Luijten

2019-12-11 15:15

reporter   ~0119752

Correct. It worked after the 0036314 fix. But with (one of the) last SVN version it was broken again.

Hans Luijten

2019-12-11 15:19

reporter   ~0119753

Woops, forgot to answer your second question:
I have no idea with which SVN version it broke.

I frequently update from SVN, maybe once every 2 or 3 weeks.
I just noticed it was broken again when I updated to r62054. (I assume r62254 was a typo?)

The patch is based on r62054.

Hans Luijten

2019-12-11 15:22

reporter   ~0119754

What I have observed:

1) TFilenameEdit seems to have the "ofFileMustExist" set (preventing the selection of .app bundles, which are directories
2) an if statement throws an error if NOT FileExistsUTF8(s), so the code exits before executing the .app bundle with the "open" statement.

Not sure when or where these changes were implemented, since both seemed to work correctly after the bugfix (0036314).

Juha Manninen

2019-12-11 18:46

developer   ~0119757

Last edited: 2019-12-11 21:42

View 2 revisions

> I just noticed it was broken again when I updated to r62054. (I assume r62254 was a typo?)
No, it was not a typo. You can see "r62254" in the relevant issue's "Fixed in Revision" field and you can verify it from the Subversion commit history.
Why did you checkout r62054? Why not just get the latest trunk always? That's what everybody else does. :)

For future referense, you can bisect a guilty revision when you need to:
 https://wiki.freepascal.org/How_do_I_create_a_bug_report#Regression_caused_by_a_certain_revision

Hans Luijten

2019-12-12 11:32

reporter   ~0119779

I did not get 62054 intentionally haha ... I simply did an "svn up" and 62054 is the version it downloaded ... 😞
I just did an svn-up again, and it downloaded 62379 ... strange.
I'll check out what is still relevant today and get back to you! 👍🏻

Hans Luijten

2019-12-12 11:36

reporter   ~0119780

Just tested this one in Lazarus 2.1.0 r62379M FPC 3.3.1 x86_64-darwin-cocoa (beta), and the problem seems fixed / non-existing in that version.

It seems my user profile will not allow me to close this bug.
As far as I'm concerned it can be closed.
Apologies for the inconvenience.

Juha Manninen

2019-12-12 12:33

developer   ~0119783

Resolved. Now you can close it.

Issue History

Date Modified Username Field Change
2019-12-10 14:33 Hans Luijten New Issue
2019-12-10 14:34 Hans Luijten File Added: exttools.patch
2019-12-11 14:00 Juha Manninen Relationship added related to 0036314
2019-12-11 14:03 Juha Manninen Relationship added related to 0036417
2019-12-11 14:07 Juha Manninen Note Added: 0119750
2019-12-11 14:14 Juha Manninen Note Edited: 0119750 View Revisions
2019-12-11 15:15 Hans Luijten Note Added: 0119752
2019-12-11 15:19 Hans Luijten Note Added: 0119753
2019-12-11 15:22 Hans Luijten Note Added: 0119754
2019-12-11 18:46 Juha Manninen Note Added: 0119757
2019-12-11 18:46 Juha Manninen Assigned To => Juha Manninen
2019-12-11 18:46 Juha Manninen Status new => feedback
2019-12-11 18:46 Juha Manninen LazTarget => -
2019-12-11 21:42 Juha Manninen Note Edited: 0119757 View Revisions
2019-12-12 11:32 Hans Luijten Note Added: 0119779
2019-12-12 11:32 Hans Luijten Status feedback => assigned
2019-12-12 11:36 Hans Luijten Note Added: 0119780
2019-12-12 12:33 Juha Manninen Status assigned => resolved
2019-12-12 12:33 Juha Manninen Resolution open => no change required
2019-12-12 12:33 Juha Manninen Widgetset Cocoa => Cocoa
2019-12-12 12:33 Juha Manninen Note Added: 0119783
2019-12-12 12:37 Hans Luijten Status resolved => closed