* New Page - Writing Plugins Compatible with Mac/Linux

Post here to suggest corrections, additions, changes etc to the FHUG KnowledgeBase . Include as much information as possible to help editors act on your post.

Moderator: kb admin

User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

New page now available at Writing Plugins Compatible With Apple Mac and Linux.

Comments invited from both plugin authors and Mac/Linux users. By its very nature, this type of page will never be complete. There are bound to be other incompatibilities that haven't tripped us up yet, but it will be kept up to date as new issues are discovered or old ones resolved.
Mark Draper
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

The most reliable method appears to be looking for the presence of a Z:\etc folder, where Z:\ is the WINE mapping of the root directory of the host OS, and the /etc directory is the standard location of configuration settings in Unix-derived systems. Clearly, this would flag a false positive if a Windows user had mapped a network or local data drive to the same location, but this is probably unlikely.
Not that unlikely.... In every system I've had for decades, Z: is mapped to a network drive (where I keep my backups).


Question: What methods work in Wine for zipping/unzipping files?
User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

Would a rephrasing to something like “if a Windows user had created an \etc folder in a Z:\ local or mapped drive” be clearer? If there is a particular signature file that is always present in Mac OS, that would be better, but we need advice from our Mac users here.

There is a PowerShell command for zipping files that I tried with an early version of the backup plugin, but gave up on it as it was horrendously slow compared with calling 7 Zip from the command line. I haven’t tried the PowerShell method in WINE, but I suspect it would be unsupported.
Mark Draper
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

Mark1834 wrote: 10 Jul 2024 06:43 Would a rephrasing to something like “if a Windows user had created an \etc folder in a Z:\ local or mapped drive” be clearer? If there is a particular signature file that is always present in Mac OS, that would be better, but we need advice from our Mac users here.
Yes.

There is a PowerShell command for zipping files that I tried with an early version of the backup plugin, but gave up on it as it was horrendously slow compared with calling 7 Zip from the command line. I haven’t tried the PowerShell method in WINE, but I suspect it would be unsupported.
Thanks. Will have a think.
User avatar
Valkrider
Megastar
Posts: 1595
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Valkrider »

Does this help? This is a screenshot of the Z drive as reported by Crossover on an M3 Mac running the latest version of Sonoma.
Screenshot 2024-07-10 at 08.58.40.png
Screenshot 2024-07-10 at 08.58.40.png (5.25 KiB) Viewed 1139 times
User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

Thanks Colin. It appears that /etc and /bin are both ubiquitous in Mac and Linux, so it would be really perverse if a Windows user had created both on a Z:\ drive. Checking Z:\ for both folders to detect WINE should be fairly bomb-proof in the absence of a supported method.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

That is a great article. Pedantic that I am, I've spotted a few typos that need correcting:

Scope
1st paragraph has an unmatched opening parenthesis: "...VM (Virtual Machine, ..."

Can Plugins Detect Emulators?
2nd paragraph uses \ and / inconsistently: "... Z:\etc folder, where Z:\ is ... and the /etc directory ..."
Should it always be \ or perhaps \\ in plugin strings, or always / that UNIX prefers?
c.f. You used \\ in the Registry path in the paragraph below.

File Access Issues
Near end of 3rd paragraph is should be if in: "... use FSO directly is if backwards compatibility ..."
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

Typos squashed (plus a couple we hadn’t spotted!), but / vs \ is deliberate, as we need to use the correct form according to the context (using / in Windows or \ in Unix are both definitely wrong).

I think it’s clearer now, as I have added a couple of additional sentences giving the background for readers whose only experience is DOS/Windows and aren’t familiar with the basic Unix file structure.
Mark Draper
User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

One minor quirk of the KB I noticed. I created this page in the normal way, and haven't edited any of the default settings regarding the glossary. However, it still omits all definition links until the final section, when it suddenly decides that "plugin" and "WINE" need a highlighted link. :?
Mark Draper
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

Yes, that is odd. I've inspected several other 'Writing plugins' articles which also don't highlight the first occurrence of glossary words such as 'Plugins' or 'Plugin Store' or 'Lua'.

Actually, looking at other articles it happens in many of them for glossary words like 'fact', 'source record', 'citation', etc.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

The program that implements the glossary has some annoying undocumented quirks. It will not, for example, highlight a glossary word, if it's at the beginning of a line. It's been upgraded recently, so I suspect some more annoyances have crept in. I'll report them, but don't anticipate anything other than being told to rewrite things!

It's been a while since I looked for an alternative... but migration could be a big job.
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

In this new article none of the early occurences of 'plugin' or 'WINE' are at the beginning of a line.
They all seem to occur in the middle of normal text, so what are the other 'quirks'?
There are a large number of occurrences of those glossary words that have all been overlooked so the 'quirks' must be very strange indeed.

As far as I recall, much the same applies to the articles I inspected. I did not have to delve very much to find plenty of examples.

How do we rewrite things if we don't know the 'undocumented quirks'?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

tatewise wrote: 11 Jul 2024 14:06 In this new article none of the early occurences of 'plugin' or 'WINE' are at the beginning of a line.
They all seem to occur in the middle of normal text, so what are the other 'quirks'?
As I said!

"annoying undocumented quirks"
There are a large number of occurrences of those glossary words that have all been overlooked so the 'quirks' must be very strange indeed.
I have spent some time trying to work them out, in the absence of any guidance from the WordPress plugin authors. And failed miserably.
How do we rewrite things if we don't know the 'undocumented quirks'?
You can't, and it's an unreasonable ask.

I have raised a support ticket, but I'm not hopeful. It could be an interaction with something else we use, which makes tracking it down harder.

I won't have time for several months to devote much effort to this.... And I'm reluctant to fork out money for yet another plugin. From a cursory search today, many of the alternatives cost money to deliver the same functionality, and charge an annual fee to stay current.
User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

IMO, it’s just a minor untidiness, and not worth spending additional cash or excessive time on. It’s always easy of course to ask someone else to fix it, but it’s not something that would be high up my to-do list.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

Perhaps How to Add Content to the Knowledge Base under Glossary Entries needs to explain that there are 'undocumented quirks' and that "If you use a term or phrase that is in the Glossary, it will be highlighted the first time it occurs on the page." does not always happen.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

Can people check whether the behaviour of the Glossary tooltips is better now? I've tweaked a few settings and think it's more reliable.

I'm not documenting the one known quirk, because there's no way for an author to know if a word will appear at the beginning of a line for any given reader.
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

I wasn't suggesting the quirks be published (how can they if undocumented) but that the claim that a Glossary item will be highlighted the first time it occurs on the page may not always happen.

The behaviour of Glossary items does seem to have changed but not necessarily for the better.
There is a very mixed behaviour with some Glossary items not being highlighted at all, but not the same items in different articles.

Writing Plugins Compatible With Apple Mac and Linux now highlights the first WINE, and Lua is highlighted even though its the 1st item on line, but plugins but plugin are not highlighted at all.

Writing and Maintaining Plugins Compatible with Versions 5, 6 & 7 highlights function so the Glossary must be enabled, but Lua and plugins & plugin are not highlighted at all.

Getting Started Writing Plugins does highlight Lua but not plugin or plugins at all.

I have not checked exhaustively!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

Mike, can you check some of the less niche articles please -- i.e not in Writing PLugins.
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

I will update this posting as and when I find more examples:

Working with Places and Addresses does not highlight Glossary items such as place(s) and address(es).
In What are Places and Addresses? the item GEDCOM is not highlighted but a later GEDCOM is highlighted.

Customising V7 Display for Generic Sources to Resemble V6 in the Source Property Box and Citation Window section does not highlight Source, Property Box, Text from Source, Notes, etc, but Source Records, Text From Source and Notes are highlighted later.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5646
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by ColeValleyGirl »

tatewise wrote: 18 Jul 2024 16:22
Working with Places and Addresses does not highlight Glossary items such as place(s) and address(es).
In What are Places and Addresses? the item GEDCOM is not highlighted but a later GEDCOM is highlighted.
Both the Place and Address glossary terms lead back to this article, so they aren't highlighted in it to avoid circular links. The author has also used the [glossary-ignore] shortcode to avoid this in the first paragraph, and in doing so has spiked the first reference to GEDCOM; I've fixed this now, but it might affect the search snippet...
Customising V7 Display for Generic Sources to Resemble V6 in the Source Property Box and Citation Window section does not highlight Source, Property Box, Text from Source, Notes, etc, but Source Records, Text From Source and Notes are highlighted later.
The author for this article has turned Glossary off via the [glossary-ignore] shortcode for most of the article. (It was too distracting in the instructions section).
User avatar
Mark1834
Megastar
Posts: 2655
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Mark1834 »

There is another issue that has just come to light. There appear to be very significant limitations in the fhSQL() library under WINE, and it cannot establish a database connection.

I raised a ticket with CP, but first line showed little enthusiasm for addressing it and followed the standard response that emulators are not supported. I will add this to the KB as a likely long-term limitation of FH under WINE/Crossover, and modify my plugins that use the library so that they give a message to the user and close elegantly if WINE is detected, rather than just crashing in flames.

I haven't picked up any hints from anywhere about who actually wrote and maintains fhSQL(), so I don't know whether the author will read this, but at least plugins can be modified where necessary to warn users.
Mark Draper
User avatar
Jane
Site Admin
Posts: 8543
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Jane »

A quick look at the fhSQL code suggests the problem is that the Com object being used does not exist on Wine or does not have a DB open function, so you can't fix something which does not exist, the best you could hope for is a more elegant error message.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
User avatar
Valkrider
Megastar
Posts: 1595
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Valkrider »

Mark

I just tried your plugin on Crossover. I ran it on the sample project and I get this warning message.
Screenshot 2024-08-01 at 12.28.14.png
Screenshot 2024-08-01 at 12.28.14.png (14.46 KiB) Viewed 648 times
I have tried several of the options in the 'Record Identifiers' tool and all of them generate this error message even though the RI tool says it was successful.

Is this the issue that you have just found or another?
User avatar
tatewise
Megastar
Posts: 28958
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by tatewise »

Colin, did you try the last option "Generate UID (Unique id) for Individual records where missing"?
Remember to save the Project before running the plugin.

I've just been through the same exercise on the FH Sample Project on native Windows 11.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Valkrider
Megastar
Posts: 1595
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: New Page - Writing Plugins Compatible with Mac/Linux

Post by Valkrider »

Mike

Yes I had tried that option but did not do the save step :oops:

I have now tried it and done that and the plugin does run but then crashes FH with a Wine error.
Post Reply