Don't cause circular linking on Windows
ClosedPublic

Authored by leinir on Nov 27 2017, 2:38 PM.

Details

Summary

When building plugins, don't arbitrarily rename the output files (as this will occasionally result in circular dependencies).

In this review from three and a half years ago, the Sonnet plugins were moved into a subdirectory, which was great. They were, however, also renamed at the same time, which resulted in some (and specifically the aspell plugin) being named the same as the library they should be linked against. End result: Spell checking has not worked on Windows for three and a half years.

Test Plan

With these properties set, the plugins fail to load on Windows due to circular dependencies

Without them (that is, with this patch), the plugins load

Diff Detail

Repository
R246 Sonnet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
leinir created this revision.Nov 27 2017, 2:38 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 27 2017, 2:38 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
leinir requested review of this revision.Nov 27 2017, 2:38 PM
leinir added a reviewer: Frameworks.
alexeymin added a subscriber: alexeymin.EditedNov 28 2017, 7:26 AM

So it resulted in something like aspell.dll requiring aspell.dll?
What is the simplest/fastest way to test this?

So it resulted in something like aspell.dll requiring aspell.dll?

Exactly that, yes... took me running it through Dependency Walker to work out what was going on :P

What is the simplest/fastest way to test this?

For building a unit test, i'm not really sure (though, i think, running a unit test on windows which loads the plugins and check that they load would likely do the trick, not sure there is one).

For testing the patch before accepting it, simply attempting to run anything on Windows which uses Sonnet should cause the failure. i found out because of Calligra Gemini, but anything which does spell checking should cause the issue to happen - for example the spell checker in ktexteditor. The symptom is having no functioning spell check at all (and debug output will complain that Sonnet could not load the plugin because it "could not find the specified procedure").

krop added a subscriber: krop.Nov 28 2017, 10:23 AM
krop added inline comments.
src/plugins/enchant/CMakeLists.txt
13

'kspell' sounds like an old KDE3 thing. Shouldn't that plugin be renamed sonnet_enchant ?

13

Ah, won't be needed, the plugin isn't built.

Would it be possible to get an accept here, or is there something people fundamentally disagree with about it?

apol accepted this revision.Dec 19 2017, 10:44 PM
This revision is now accepted and ready to land.Dec 19 2017, 10:44 PM
This revision was automatically updated to reflect the committed changes.