No printers available conundrum

Questions about Wine on macOS.
Post Reply
adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

No printers available conundrum

Post by adamAC » Mon Aug 10, 2020 9:55 am

Hi All,

I have built Wine myself for macOS (on High Sierra) but running the build afterwards does not detect any printers on my Mac. Any ideas?

From what I have read, it should apparently "just work". There doesn't appear to be anything special that needs configuring during the build, and there doesn't appear to be anything special needed. So any help anyone could share on this would be very helpful.

If I use a pre-built version of Wine from WineHQ then printers ARE available. So there is something obviously different in what I am building, even if I build the same source.

Thanks.

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Wed Aug 12, 2020 4:11 am

I am running Wine v4.0.4, which I have built myself, by the way. Built on High Sierra and ran on High Sierra.

I have tried rebuilding Wine with the same configuration as stated on https://github.com/Gcenx/macOS_Wine_builds, but still no printers appear. Running "WINEDEBUG=+spool" states it finds zero printers, even though they are there on the Mac.

Running Gcenx build of v5.0.1 shows the printers.

What other potential reasons might the printers not appear?

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Wed Aug 12, 2020 8:21 am

So.....a little further. It seems Wine is failing to load libcups.2.dylib, even though it is present in /usr/lib/.

In my Wine launch script I have:
export DYLD_FALLBACK_LIBRARY_PATH=“/usr/lib:/usr/local/lib:/opt/X11/lib:${dir}/../Resources/wine-home/usr/lib64”
The file is definitely there. The error is:
dlopen(libcups.2.dylib, 258): image not found
Anyone any ideas?

Gcenx
Level 5
Level 5
Posts: 499
Joined: Mon Dec 25, 2017 12:11 pm

Re: No printers available conundrum

Post by Gcenx » Wed Aug 12, 2020 10:34 am

Not sure why your build isn’t working correctly when it should.

Here’s roughly what I set with WineskinLauncher

Code: Select all

/opt/local/lib:%@/wine/lib:%@/wine/lib64:/usr/local/lib:/usr/lib:/usr/libexec:/usr/lib/system:/opt/X11/lib
Resolve %@ with your PATH to wine.

The possible reason cups won’t load is due to it needing an additional dylib that’s not listed within your configured DYLD_FALLBACK_LIBRARY_PATH export

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Wed Aug 12, 2020 11:40 am

Gcenx wrote:
Wed Aug 12, 2020 10:34 am
Not sure why your build isn’t working correctly when it should.
It is puzzling for me too :? I have used the same build configuration options that you have, which builds fine, eventually.
Gcenx wrote:
Wed Aug 12, 2020 10:34 am
Here’s roughly what I set with WineskinLauncher

Code: Select all

/opt/local/lib:%@/wine/lib:%@/wine/lib64:/usr/local/lib:/usr/lib:/usr/libexec:/usr/lib/system:/opt/X11/lib
That is different to what I have in my launcher script but both contain the path for libcups.2.dylib.
Gcenx wrote:
Wed Aug 12, 2020 10:34 am
The possible reason cups won’t load is due to it needing an additional dylib that’s not listed within your configured DYLD_FALLBACK_LIBRARY_PATH export
I did think of that but apparently you receive a different error message if the additional lib is missing or wrong.

I copied libcups.2.dylib to the lib64 folder in Wine and that now loads successfully. However, the printers still don't appear in Wine.

Here is the output:
002a:trace:winspool:WINSPOOL_LoadSystemPrinters Calling load_cups()...
002a:trace:winspool:load_cups Opening libcups.2.dylib...
002a:trace:winspool:load_cups 0x846e9611: libcups.2.dylib loaded
002a:trace:winspool:WINSPOOL_EnumPrintersW Found 0 printers
002a:trace:winspool:CUPS_LoadPrinters Found 2 CUPS printers:
002a:trace:winspool:CUPS_LoadPrinters Printer 0: L"HP_Color_LaserJet_MFP_M277dw__CB4865_". printer_type 42090dc
002a:trace:winspool:get_ppd_dir ppd temporary dir: (null)
002a:trace:winspool:WINSPOOL_EnumPrintersW Found 0 printers
002a:trace:winspool:WINSPOOL_EnumPrintersW Found 0 printers
002a:trace:winspool:WINSPOOL_EnumPrintersW ignoring PRINTER_ENUM_CONNECTIONS
002a:fixme:winspool:WINSPOOL_EnumPrintersW We don't handle PRINTER_ENUM_CONNECTIONS
Even though it finds 2 printers via CUPS_LoadPrinters it is only showing one of them here. The other is a PDF printer.

Why is WINSPOOL_EnumPrintersW not finding any printers?

I am going to delve deeper in to the Wine source tomorrow to see if I can figure out what the smeg is going on.

If I run your v5.0.1 build then all this is outputted:

Code: Select all

0009:trace:winspool:load_cups 0x7c460789: libcups.2.dylib loaded
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 2 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 2 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:PDFwriter"
0009:trace:winspool:CUPS_LoadPrinters Found 2 CUPS printers:
0009:trace:winspool:CUPS_LoadPrinters Printer 0: L"HP_Color_LaserJet_MFP_M277dw__CB4865_". printer_type 42090dc
0009:trace:winspool:get_ppd_dir ppd temporary dir: L"C:\\users\\adam\\Temp\\wine_ppds\\"
0009:trace:winspool:get_cups_ppd ("HP_Color_LaserJet_MFP_M277dw__CB4865_", L"C:\\users\\adam\\Temp\\wine_ppds\\HP_Color_LaserJet_MFP_M277dw__CB4865_.ppd")
0009:trace:winspool:AddPrinterDriverExW ((null), 3, 0x31df80, 0x18)
0009:trace:winspool:load_backend backend: 0x6b5b7cc0 (0x660000)
0009:trace:winspool:add_printer_driver got 1 and 127 for L"HP_Color_LaserJet_MFP_M277dw__CB4865_" (L"Windows NT x86")
0009:trace:winspool:AddPrinterDriverExW ((null), 3, 0x31df80, 0x18)
0009:trace:winspool:add_printer_driver got 1 and 127 for L"HP_Color_LaserJet_MFP_M277dw__CB4865_" (L"Windows x64")
0009:trace:winspool:AddPrinterDriverExW ((null), 3, 0x31df80, 0x18)
0009:trace:winspool:add_printer_driver got 1 and 6 for L"HP_Color_LaserJet_MFP_M277dw__CB4865_" (L"Windows 4.0")
0009:trace:winspool:AddPrinterW ((null),2,0x31e480)
0009:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:set_devices_and_printerports (0x31e480) L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:set_devices_and_printerports using L"wineps.drv,CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:DocumentPropertiesW (0x0,0x0,L"HP_Color_LaserJet_MFP_M277dw__CB4865_",0x0,0x0,0)
0009:trace:winspool:DocumentPropertiesA (0x0,0x0,HP_Color_LaserJet_MFP_M277dw__CB4865_,0x0,0x0,0)
0009:trace:winspool:OpenPrinterW (L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x31ce48, 0x0)
0009:trace:winspool:OpenPrinterW returning 1 with 126 and 0x1
0009:trace:winspool:GetPrinterW (0x1,9,0x0,0,0x31ce50)
0009:trace:winspool:WINSPOOL_GetDevModeFromReg corrupted registry for L"Default DevMode" ( size 0)
0009:trace:winspool:GetPrinterW returning 0 needed = 228
0009:trace:winspool:GetPrinterW (0x1,9,0x714ea0,228,0x31ce50)
0009:trace:winspool:WINSPOOL_GetDevModeFromReg corrupted registry for L"Default DevMode" ( size 0)
0009:trace:winspool:GetPrinterW returning 1 needed = 228
0009:trace:winspool:GetPrinterDriverW (0x1,(null),2,0x0,0,0x31ce50)
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg (0x98, L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x6b5b31a0, 2, 0x0, 0x0, 0)
0009:trace:winspool:GetPrinterDriverDirectoryW ((null), L"Windows NT x86", 1, 0x31c960, 512, 0x31cba4)
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg buffer space 0 required 492
0009:trace:winspool:GetPrinterDriverW buffer space 0 required 540
0009:trace:winspool:GetPrinterDriverW (0x1,(null),2,0x613fa0,540,0x31ce50)
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg (0x98, L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x6b5b31a0, 2, 0x613fa0, 0x613fd0, 492)
0009:trace:winspool:GetPrinterDriverDirectoryW ((null), L"Windows NT x86", 1, 0x31c960, 512, 0x31cba4)
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg buffer space 492 required 492
0009:trace:winspool:GetPrinterDriverW buffer space 540 required 540
0009:trace:winspool:GetPrinterDataExA (0x1, "PPD Overrides", "DefaultPageSize", 0x31cb28, 0x0, 0, 0x31cb2c)
0009:trace:winspool:GetPrinterDataExA printer->name: L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:warn:winspool:GetPrinterDataExA Can't open subkey "PPD Overrides": 2
0009:trace:winspool:GetPrinterDataExA (0x1, "PPD Overrides", "DefaultDuplex", 0x31cb28, 0x0, 0, 0x31cb2c)
0009:trace:winspool:GetPrinterDataExA printer->name: L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:warn:winspool:GetPrinterDataExA Can't open subkey "PPD Overrides": 2
0009:trace:winspool:SetPrinterW (0x1, 9, 0x31ce50, 0)
0009:trace:winspool:EnumPrinterDataExA 0x1 PrinterDriverData\FontSubTable
0009:trace:winspool:EnumPrinterDataExW 0x1 L"PrinterDriverData\\FontSubTable"
0009:trace:winspool:EnumPrinterDataExW RegOpenKeyExW (0x1, L"PrinterDriverData\\FontSubTable") returned 2
0009:trace:winspool:EnumPrinterDataExA EnumPrinterDataExW returned 2
0009:trace:winspool:ClosePrinter (0x1)
0009:trace:winspool:ClosePrinter closing L"HP_Color_LaserJet_MFP_M277dw__CB4865_" (doc: 0x0)
0009:trace:winspool:DocumentPropertiesW (0x0,0x0,L"HP_Color_LaserJet_MFP_M277dw__CB4865_",0x613b60,0x0,2)
0009:trace:winspool:DocumentPropertiesA (0x0,0x0,HP_Color_LaserJet_MFP_M277dw__CB4865_,0x0,0x0,0)
0009:trace:winspool:DocumentPropertiesA (0x0,0x0,HP_Color_LaserJet_MFP_M277dw__CB4865_,0x614580,0x0,2)
0009:trace:winspool:OpenPrinterW (L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x31df10, 0x0)
0009:trace:winspool:OpenPrinterW returning 1 with 0 and 0x1
0009:trace:winspool:ClosePrinter (0x1)
0009:trace:winspool:ClosePrinter closing L"HP_Color_LaserJet_MFP_M277dw__CB4865_" (doc: 0x0)
0009:trace:winspool:SetDefaultPrinterW (L"HP_Color_LaserJet_MFP_M277dw__CB4865_")
0009:trace:winspool:SetDefaultPrinterW set device to L"HP_Color_LaserJet_MFP_M277dw__CB4865_,wineps.drv,CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:CUPS_LoadPrinters Printer 1: L"PDFwriter". printer_type a01044
0009:trace:winspool:CUPS_LoadPrinters Printer already exists
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 3 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 2 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 3 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 2 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:PDFwriter"
0009:trace:winspool:old_printer_check Deleting old printer L"HP_Color_LaserJet_MFP_M277dw_CB4865_"
0009:trace:winspool:OpenPrinterW (L"HP_Color_LaserJet_MFP_M277dw_CB4865_", 0x31dfa0, 0x0)
0009:trace:winspool:OpenPrinterW returning 1 with 0 and 0x1
0009:trace:winspool:GetDefaultPrinterW L"HP_Color_LaserJet_MFP_M277dw__CB4865_,wineps.drv,CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:ClosePrinter (0x1)
0009:trace:winspool:ClosePrinter closing L"HP_Color_LaserJet_MFP_M277dw_CB4865_" (doc: 0x0)
0009:trace:winspool:DeletePrinterDriverExW (null) (null) L"HP_Color_LaserJet_MFP_M277dw_CB4865_" 0 0
0009:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 2 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 2 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_EnumPrintersW Found 2 printers
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Share Name": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Printer Driver": L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Description": L"HP Color LaserJet MFP M277dw (CB4865)"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Location": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Separator File": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Print Processor": L"WinPrint"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Datatype": L"RAW"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Parameters": L""
0009:trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Share Name": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Printer Driver": L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Description": L"PDFwriter"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Location": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Separator File": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Print Processor": L"WinPrint"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Datatype": L"RAW"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Parameters": L""
0009:trace:winspool:GetDefaultPrinterW L"HP_Color_LaserJet_MFP_M277dw__CB4865_,wineps.drv,CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:OpenPrinterW (L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x31dd88, 0x0)
0009:trace:winspool:OpenPrinterW returning 1 with 0 and 0x1
0009:trace:winspool:GetPrinterW (0x1,2,0x0,0,0x31dd84)
0009:trace:winspool:GetPrinterW returning 0 needed = 732
0009:trace:winspool:GetPrinterW (0x1,2,0xa71ec0,732,0x31dd84)
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Share Name": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Printer Driver": L"HP_Color_LaserJet_MFP_M277dw__CB4865_"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Description": L"HP Color LaserJet MFP M277dw (CB4865)"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Location": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Separator File": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Print Processor": L"WinPrint"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Datatype": L"RAW"
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Parameters": L""
0009:trace:winspool:GetPrinterW returning 1 needed = 732
0009:trace:winspool:GetPrinterDriverW (0x1,(null),3,0x0,0,0x31dd84)
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg (0xa4, L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x6b5b31a0, 3, 0x0, 0x0, 0)
0009:trace:winspool:GetPrinterDriverDirectoryW ((null), L"Windows NT x86", 1, 0x31d8c0, 512, 0x31db04)
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg buffer space 0 required 506
0009:trace:winspool:GetPrinterDriverW buffer space 0 required 586
0009:trace:winspool:GetPrinterDriverW (0x1,(null),3,0xa747e0,586,0x31dd84)
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_OpenDriverReg ((null))
0009:trace:winspool:validate_envW testing (null)
0009:trace:winspool:validate_envW using 0x6b5b31a0: L"Windows NT x86"
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg (0xa4, L"HP_Color_LaserJet_MFP_M277dw__CB4865_", 0x6b5b31a0, 3, 0xa747e0, 0xa74830, 506)
0009:trace:winspool:GetPrinterDriverDirectoryW ((null), L"Windows NT x86", 1, 0x31d8c0, 512, 0x31db04)
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Monitor": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Monitor": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Datatype": L""
0009:trace:winspool:WINSPOOL_GetStringFromReg L"Datatype": L"RAW"
0009:trace:winspool:WINSPOOL_GetDriverInfoFromReg buffer space 506 required 506
0009:trace:winspool:GetPrinterDriverW buffer space 586 required 586
0009:trace:winspool:ClosePrinter (0x1)
0009:trace:winspool:ClosePrinter closing L"HP_Color_LaserJet_MFP_M277dw__CB4865_" (doc: 0x0)
0009:trace:winspool:DocumentPropertiesW (0x0,0x0,L"HP_Color_LaserJet_MFP_M277dw__CB4865_",0x0,0x0,0)
0009:trace:winspool:DocumentPropertiesA (0x0,0x0,HP_Color_LaserJet_MFP_M277dw__CB4865_,0x0,0x0,0)
0009:trace:winspool:DocumentPropertiesW (0x0,0x0,L"HP_Color_LaserJet_MFP_M277dw__CB4865_",0xa74a40,0x0,2)
0009:trace:winspool:DocumentPropertiesA (0x0,0x0,HP_Color_LaserJet_MFP_M277dw__CB4865_,0x0,0x0,0)
0009:trace:winspool:DocumentPropertiesA (0x0,0x0,HP_Color_LaserJet_MFP_M277dw__CB4865_,0xa71de0,0x0,2)
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",16,0x0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",16,0x0,0xa71de0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",2,0x0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",2,0x0,0xa71de0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",16,0xa792c0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",16,0x0,0xa71de0
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",16,0xa79e50,0xa71de0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",2,0xa721b0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",2,0xa721b0,0xa71de0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",12,0x0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",12,0x0,0xa74ba0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",6,0x0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",6,0x0,0xa74ba0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",12,0xa74ba0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",12,0x0,0xa792c0
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",12,0xa79400,0xa792c0
0009:trace:winspool:DeviceCapabilitiesW L"HP_Color_LaserJet_MFP_M277dw__CB4865_",L"CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",6,0xa721b0,0xa74a40
0009:trace:winspool:DeviceCapabilitiesA "HP_Color_LaserJet_MFP_M277dw__CB4865_","CUPS:HP_Color_LaserJet_MFP_M277dw__CB4865_",6,0xa721b0,0xa792c0
So as your build works there must be something different with my build so I need to track down what it is.

Gcenx
Level 5
Level 5
Posts: 499
Joined: Mon Dec 25, 2017 12:11 pm

Re: No printers available conundrum

Post by Gcenx » Wed Aug 12, 2020 12:30 pm

adamAC wrote:
Wed Aug 12, 2020 11:40 am
It is puzzling for me too :? I have used the same build configuration options that you have, which builds fine, eventually.
Eventually? Or did you mean evidently?
If you mean builds with my options takes longer, yeah it will take a good while as I build with almost everything possible.
adamAC wrote:
Wed Aug 12, 2020 11:40 am
That is different to what I have in my launcher script but both contain the path for libcups.2.dylib.
Hum your using a bash script, that could be what’s causing you issues due to SIP stripping some environment variables.

Try running your application with wine compilation via terminal directly without using any scripts.
adamAC wrote:
Wed Aug 12, 2020 11:40 am
I did think of that but apparently you receive a different error message if the additional lib is missing or wrong.
Usually it explains why it couldn’t load the dylib but sometimes I’ve found didn’t explain anything...

I’d expect my configuration to be different as it’s evolved over time, the posted example isn’t the current export I’m using but I’m not near my system so that was the closest I could manage on mobile.
adamAC wrote:
Wed Aug 12, 2020 11:40 am
I copied libcups.2.dylib to the lib64 folder in Wine and that now loads successfully. However, the printers still don't appear in Wine.
Placing a system dylib into lib64 is bad, you can’t ship Apple libraries with an application.

But as you said it still didn’t work anyway, I’d think that SIP stripping is causing you issues.
adamAC wrote:
Wed Aug 12, 2020 11:40 am
Even though it finds 2 printers via CUPS_LoadPrinters it is only showing one of them here. The other is a PDF printer.

Why is WINSPOOL_EnumPrintersW not finding any printers?

I am going to delve deeper in to the Wine source tomorrow to see if I can figure out what the smeg is going on.
See my above comment about SIP stripping.
adamAC wrote:
Wed Aug 12, 2020 11:40 am
So as your build works there must be something different with my build so I need to track down what it is.
There must be but I’m not seeing what could be so different to cause these issues your having.


Edit;
Does Wine-5.14 also find printers?

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Wed Aug 12, 2020 1:04 pm

Gcenx wrote:
Wed Aug 12, 2020 12:30 pm
adamAC wrote:
Wed Aug 12, 2020 11:40 am
It is puzzling for me too :? I have used the same build configuration options that you have, which builds fine, eventually.
Eventually? Or did you mean evidently?
I needed to install various additional libs to get it to successfully build using your exact build config options. I did spot there was one specifically for "cups" so I tried that sole addition to my existing build but it still didn't work so I went ahead and got the full build going but even that didn't work. :oops:
Gcenx wrote:
Wed Aug 12, 2020 12:30 pm
Hum your using a bash script, that could be what’s causing you issues due to SIP stripping some environment variables.

Try running your application with wine compilation via terminal directly without using any scripts.
I will try that first thing tomorrow morning. Thanks.
Gcenx wrote:
Wed Aug 12, 2020 12:30 pm
I’d expect my configuration to be different as it’s evolved over time, the posted example isn’t the current export I’m using but I’m not near my system so that was the closest I could manage on mobile.
If you could post me your current build config options then that would be great, and I will give that a try.
Gcenx wrote:
Wed Aug 12, 2020 12:30 pm
Placing a system dylib into lib64 is bad, you can’t ship Apple libraries with an application.
This was just a test to see if it would work, and it did. So for some reason it won't load it from /usr/lib/ but I have no idea why. Both of those locations are present in the path in my launcher script so it is puzzling why it works in one but not the other.
Gcenx wrote:
Wed Aug 12, 2020 12:30 pm
adamAC wrote:
Wed Aug 12, 2020 11:40 am
So as your build works there must be something different with my build so I need to track down what it is.
There must be but I’m not seeing what could be so different to cause these issues your having.

Does Wine-5.14 also find printers?
I will download that source tomorrow and try building it using your updated build config options. Then I will give that a try too.

Presumably you are SIP stripping too with your builds?

Gcenx
Level 5
Level 5
Posts: 499
Joined: Mon Dec 25, 2017 12:11 pm

Re: No printers available conundrum

Post by Gcenx » Wed Aug 12, 2020 2:30 pm

adamAC wrote:
Wed Aug 12, 2020 1:04 pm
I needed to install various additional libs to get it to successfully build using your exact build config options. I did spot there was one specifically for "cups" so I tried that sole addition to my existing build but it still didn't work so I went ahead and got the full build going but even that didn't work. :oops:
Ah yes I do use all possible libraries when compiling wine so it’s feature rich, I don’t commonly build all the gstreamer1 plugins as that really get irritating.
adamAC wrote:
Wed Aug 12, 2020 1:04 pm
I will try that first thing tomorrow morning. Thanks.
Let me know the results.
adamAC wrote:
Wed Aug 12, 2020 1:04 pm
If you could post me your current build config options then that would be great, and I will give that a try.
I’ve basically posted all the needed steps not sure what else there could be.
adamAC wrote:
Wed Aug 12, 2020 1:04 pm
This was just a test to see if it would work, and it did. So for some reason it won't load it from /usr/lib/ but I have no idea why. Both of those locations are present in the path in my launcher script so it is puzzling why it works in one but not the other.
I’m not really sure, maybe you could attach one of your wine compiles and share a link.
adamAC wrote:
Wed Aug 12, 2020 1:04 pm
I will download that source tomorrow and try building it using your updated build config options. Then I will give that a try too.
I was more wondering if it hit worked on the recent releases as wine from 5.8 become a cluster to put it mildly.
adamAC wrote:
Wed Aug 12, 2020 1:04 pm
Presumably you are SIP stripping too with your builds?
SIP stripping doesn’t affect my intern version or the current beta releases, bash scripts not used for primary launches.

Some wrappers scripts are currently used for winetricks comparability but I’ll also be replacing those with binary wrappers.

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Thu Aug 13, 2020 1:48 am

Gcenx wrote:
Wed Aug 12, 2020 2:30 pm
adamAC wrote:
Wed Aug 12, 2020 1:04 pm
Gcenx wrote:
Wed Aug 12, 2020 12:30 pm
Hum your using a bash script, that could be what’s causing you issues due to SIP stripping some environment variables.

Try running your application with wine compilation via terminal directly without using any scripts.
I will try that first thing tomorrow morning. Thanks.
Let me know the results.
So, I have just ran this directly from the build folder by just running "./wine64 notepad.exe", and the printers DO appear! :D

So I think you are right about the SIP stripping. Any ideas on how to solve this? :?

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Thu Aug 13, 2020 4:17 am

I have managed to get the printers to appear! :o

I poked around in the Wine source code to see what was happening, and the reason it was failing was because the TEMP path set in the prefix registry was an invalid location. So, I corrected this and the printers started working.

I still have the problem that it isn't loading libcups from the correct location so I will look further in to that now.

Gcenx
Level 5
Level 5
Posts: 499
Joined: Mon Dec 25, 2017 12:11 pm

Re: No printers available conundrum

Post by Gcenx » Thu Aug 13, 2020 11:56 am

adamAC wrote:
Thu Aug 13, 2020 1:48 am
So, I have just ran this directly from the build folder by just running "./wine64 notepad.exe", and the printers DO appear! :D

So I think you are right about the SIP stripping. Any ideas on how to solve this? :?
SIP stripping is a complete PITA and caused me no end of frustration.

To avoid this you need to create a binary wrapper not a bash script that launches wine(64/32on64) that seta the needed env & DYLD_FALLBACK_LIBRARY_PATH set.

If the intention is to release a product to end users not just some internal application then the resulting app bundle will need to be code-signed & notarized with the entitlement to allow DYLD_FALLBACK_LIBRARY_PATH

adamAC
Level 2
Level 2
Posts: 29
Joined: Mon Jun 22, 2020 9:56 am

Re: No printers available conundrum

Post by adamAC » Thu Aug 13, 2020 12:04 pm

Gcenx wrote:
Thu Aug 13, 2020 11:56 am
To avoid this you need to create a binary wrapper not a bash script that launches wine(64/32on64) that seta the needed env & DYLD_FALLBACK_LIBRARY_PATH set.
I already have this. One of my colleagues used Automator to convert the launch script to a binary wrapper. That solved some of our permission issues on Catalina.

I have also maintained the existing launch script which I run from a Terminal so I can see the output and set WINEDEBUG accordingly.

For this printing issue I have always ran the launch script so I will try running the application normally via the binary wrapper to see if that solves this conundrum of not finding the libcups library.
Gcenx wrote:
Thu Aug 13, 2020 11:56 am
If the intention is to release a product to end users not just some internal application then the resulting app bundle will need to be code-signed & notarized with the entitlement to allow DYLD_FALLBACK_LIBRARY_PATH
The intention IS to release this as a product to end users.

I was under the impression that we could NOT sign or notarize a Wine app as the contents change on every launch of the application. Although, one of my colleagues has discovered today that you can sign parts of the Wine app, which is apparently acceptable by Apple. Personally, I have not looked in to this in any depth. Do you have any advice on how to achieve this?

Many thanks for all your help, by the way.

Gcenx
Level 5
Level 5
Posts: 499
Joined: Mon Dec 25, 2017 12:11 pm

Re: No printers available conundrum

Post by Gcenx » Thu Aug 13, 2020 1:18 pm

adamAC wrote:
Thu Aug 13, 2020 12:04 pm
I already have this. One of my colleagues used Automator to convert the launch script to a binary wrapper. That solved some of our permission issues on Catalina.

I have also maintained the existing launch script which I run from a Terminal so I can see the output and set WINEDEBUG accordingly.

For this printing issue I have always ran the launch script so I will try running the application normally via the binary wrapper to see if that solves this conundrum of not finding the libcups library.
I believe Automator wraps the shell script, that’s something I want to avoid when possible.
adamAC wrote:
Thu Aug 13, 2020 12:04 pm
The intention IS to release this as a product to end users.

I was under the impression that we could NOT sign or notarize a Wine app as the contents change on every launch of the application. Although, one of my colleagues has discovered today that you can sign parts of the Wine app, which is apparently acceptable by Apple. Personally, I have not looked in to this in any depth. Do you have any advice on how to achieve this?

Many thanks for all your help, by the way.
I’d also read this yet the so-called “guides” were all outdated, so it might be possible but I’m not sure on possible steps.

A much safer alternative is on first launch copy the embedded wineprefix into a user controlled location and always use that over the embedded wineprefix.

Having a signed & notarized self modifying application could become a security risk

Post Reply