View Issue Details

IDProjectCategoryView StatusLast Update
0037330LazarusIDEpublic2020-07-12 10:41
ReporterTrevor Roydhouse Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAppleOSmacOS 
Product Version2.0.6 
Summary0037330: Printer4Lazarus package cannot be set as project dependency in Project Inspector
DescriptionIt is wrongly shown as "online" package.
Confirmed in Lazarus 2.0.6 + FPC 3.0.4; and Lazarus trunk r63272 + FPC trunk r45525.

Error message when compiling otherwise blank project after adding printer4lazarus to uses clause of project source:

"Compile Project, Target: project1: Exit code 1, Errors: 1
project1.lpr(10,10) Fatal: Cannot find printer4lazarus used by project1. Check if package Printer4Lazarus is in the dependencies of the Project Inspector."

Attachment 1 - shows Printer4Lazarus is installed
Attachment 2 - shows Printer4Lazarus as "online" and not installed
Attachment 3 - shows attempt to Install from Project Inspector

Directory listing of /Library/Lazarus/components/printers/lib/x86_64-darwin/cocoa showing printer4lazarus:

-rw-r--r-- 1 root wheel 546 6 Nov 2019 Printer4Lazarus.compiled
-rw-r--r-- 1 root wheel 265188 5 Nov 2019 cocoaprndelegate.o
-rw-r--r-- 1 root wheel 9920 5 Nov 2019 cocoaprndelegate.ppu
-rw-r--r-- 1 root wheel 201220 5 Nov 2019 osprinters.o
-rw-r--r-- 1 root wheel 30780 5 Nov 2019 osprinters.ppu
-rw-r--r-- 1 root wheel 1776 6 Nov 2019 printer4lazarus.o
-rw-r--r-- 1 root wheel 1456 6 Nov 2019 printer4lazarus.ppu
-rw-r--r-- 1 root wheel 11836 5 Nov 2019 printer4lazstrconst.o
-rw-r--r-- 1 root wheel 8182 5 Nov 2019 printer4lazstrconst.ppu
-rw-r--r-- 1 root wheel 4345 5 Nov 2019 printer4lazstrconst.rsj
-rw-r--r-- 1 root wheel 270012 5 Nov 2019 printersdlgs.o
-rw-r--r-- 1 root wheel 12179 5 Nov 2019 printersdlgs.ppu
-rw-r--r-- 1 root wheel 9505 5 Nov 2019 printersdlgs.res

The workaround was to manually add it to the project.lpi file changing:

   <RequiredPackages Count="1">
      <Item1>
        <PackageName Value="LCL"/>
      </Item1>
   </RequiredPackages>

to:

    <RequiredPackages Count="2">
      <Item1>
        <PackageName Value="Printer4Lazarus"/>
      </Item1>
      <Item2>
        <PackageName Value="LCL"/>
      </Item2>
    </RequiredPackages>


Steps To ReproduceAdd printer4lazarus to uses clause of otherwise default GUI application project source and compile.
Additional Information* Happens with Lazarus 2.0.10 (compiled as a 64 bit Cocoa application with FPC 3.2.0) in macOS 10.11 & 10.14.
* Happens with Lazarus 2.0.10 (compiled as a 64 bit Cocoa application with FPC 3.0.4) in macOS 10.11 & 10.14.

* Does not happen with Lazarus 2.0.8 (compiled as a 32 bit Carbon application with FPC 3.0.4) in macOS 10.11.
* Does not happen in FreeBSD or Ubuntu Lazarus trunk using GTK2 widget set.
Tagscocoa, IDE, MacOS
Fixed in Revisionr63545
LazTarget-
WidgetsetCocoa
Attached Files

Activities

Trevor Roydhouse

2020-07-11 10:30

reporter  

Juha Manninen

2020-07-11 14:32

developer   ~0123886

Last edited: 2020-07-11 14:34

View 2 revisions

Thanks for reporting. The issue was discussed here :
 https://forum.lazarus.freepascal.org/index.php?topic=50439
I edited the Summary line a little.

About the screenshots :
> Attachment 2 - shows Printer4Lazarus as "online" and not installed
Actually it is installed in the IDE but cannot be set as a dependent package for a project.

> Attachment 3 - shows attempt to Install from Project Inspector
I guess this tries to install an "online" package which does not work because Printer4Lazarus is a "global" package and comes with Lazarus sources.

One check :
Please open Package -> Package Links ...
In the Group column it shows "Global", "User" or "Online" for each package. For example Printer4Lazarus should be "Global" but I guess for you it is "Online".
Q: Do you see "Global" for any package, for example for pochecker?

Trevor Roydhouse

2020-07-11 14:39

reporter   ~0123887

All packages are listed as Global and Valid - see attachment.

Juha Manninen

2020-07-11 20:07

developer   ~0123891

It looks like code in TAddPkgDependencyDialog is flawed. There are wrong typecasts. I don't know why it worked well with other OS / Widgetset combinations.
I try to improve it. Please prepare to test with Lazarus trunk later.

Juha Manninen

2020-07-11 22:37

developer   ~0123896

Please test with r63545. I found clear errors and it slightly altered the number of packages in my TAddPkgDependencyDialog ListBox, too.

Trevor Roydhouse

2020-07-12 06:23

reporter   ~0123903

Fixed! I can now add Printer4Lazarus without any problem. Also, all packages now show up as "local" and no "online" anymore (see attached image). Thanks!

Juha Manninen

2020-07-12 09:55

developer   ~0123910

Last edited: 2020-07-12 09:56

View 2 revisions

Great!
BTW, you get the real online packages included after opening the Online Package Manager once. It then reads the list of available packages.
If Online Package Manager is not installed, the "Local" and "Online" Checkboxes are hidden. It is a good logic actually.

Trevor Roydhouse

2020-07-12 10:41

reporter   ~0123914

Closed as fixed. Thanks!

Issue History

Date Modified Username Field Change
2020-07-11 10:30 Trevor Roydhouse New Issue
2020-07-11 10:30 Trevor Roydhouse File Added: Screen Shot 2020-07-06 at 12.46.46 pm.png
2020-07-11 10:30 Trevor Roydhouse File Added: Screen Shot 2020-07-06 at 12.47.30 pm.png
2020-07-11 10:30 Trevor Roydhouse File Added: Screen Shot 2020-07-06 at 12.56.46 pm.png
2020-07-11 10:31 Trevor Roydhouse Tag Attached: MacOS
2020-07-11 10:31 Trevor Roydhouse Tag Attached: cocoa
2020-07-11 10:31 Trevor Roydhouse Tag Attached: IDE
2020-07-11 14:20 Juha Manninen Summary Cocoa Lazarus cannot specify Printer4Lazarus in Project Inspector - macOS => [Cocoa] Printer4Lazarus package cannot be set as project dependency in Project Inspector
2020-07-11 14:20 Juha Manninen Description Updated View Revisions
2020-07-11 14:20 Juha Manninen LazTarget => -
2020-07-11 14:20 Juha Manninen Widgetset Cocoa => Cocoa
2020-07-11 14:22 Juha Manninen Description Updated View Revisions
2020-07-11 14:22 Juha Manninen Widgetset Cocoa => Cocoa
2020-07-11 14:32 Juha Manninen Note Added: 0123886
2020-07-11 14:34 Juha Manninen Note Edited: 0123886 View Revisions
2020-07-11 14:39 Trevor Roydhouse Note Added: 0123887
2020-07-11 14:39 Trevor Roydhouse File Added: Screen Shot 2020-07-11 at 10.37.34 pm.png
2020-07-11 20:07 Juha Manninen Note Added: 0123891
2020-07-11 20:07 Juha Manninen Assigned To => Juha Manninen
2020-07-11 20:07 Juha Manninen Status new => assigned
2020-07-11 22:37 Juha Manninen Status assigned => feedback
2020-07-11 22:37 Juha Manninen Note Added: 0123896
2020-07-12 06:23 Trevor Roydhouse Note Added: 0123903
2020-07-12 06:23 Trevor Roydhouse File Added: Screen Shot 2020-07-12 at 2.21.07 pm.png
2020-07-12 06:23 Trevor Roydhouse Status feedback => assigned
2020-07-12 09:55 Juha Manninen Summary [Cocoa] Printer4Lazarus package cannot be set as project dependency in Project Inspector => Printer4Lazarus package cannot be set as project dependency in Project Inspector
2020-07-12 09:55 Juha Manninen Fixed in Revision => r63545
2020-07-12 09:55 Juha Manninen Widgetset Cocoa => Cocoa
2020-07-12 09:55 Juha Manninen Note Added: 0123910
2020-07-12 09:56 Juha Manninen Note Edited: 0123910 View Revisions
2020-07-12 09:56 Juha Manninen Status assigned => resolved
2020-07-12 09:56 Juha Manninen Resolution open => fixed
2020-07-12 09:56 Juha Manninen Widgetset Cocoa => Cocoa
2020-07-12 10:41 Trevor Roydhouse Status resolved => closed
2020-07-12 10:41 Trevor Roydhouse Note Added: 0123914