Bug 245614 - accessibility/qt5-speech: compilarion failure: Project ERROR: Could not find feature speechd.
Summary: accessibility/qt5-speech: compilarion failure: Project ERROR: Could not find ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-14 06:21 UTC by O. Hartmann
Modified: 2021-04-22 08:03 UTC (History)
4 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
[build log] v1: with qt5-speech-5.13.2 installed in LOCALBASE (98.35 KB, application/x-xz)
2020-04-23 13:58 UTC, John Hein
no flags Details
[build log] v2: after qt5-speech-5.13.2 removed from LOCALBASE (122.55 KB, application/x-xz)
2020-04-23 14:02 UTC, John Hein
no flags Details
poudriere log of accessibility/speech-dispatcher, option FLITE disabled (99.48 KB, text/plain)
2020-04-25 21:02 UTC, Rainer Hurling
no flags Details
poudriere log of accessibility/qt5-speech, option FLITE enabled (93.72 KB, text/plain)
2020-04-25 21:03 UTC, Rainer Hurling
no flags Details
v1 (1.42 KB, patch)
2020-04-27 19:14 UTC, Tobias C. Berner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2020-04-14 06:21:30 UTC
Updating port accessibility/qt5-speech fails to compile due to the error sketched below:

[...]
cd tts/ && ( test -e Makefile || /usr/local/lib/qt5/bin/qmake -o Makefile /usr/ports/accessibility/qt5-speech/work/qtspeech-everywhere-src-5.14.2/src/plugins/tts/tts.pro -spec /usr/local/lib/qt5/mkspecs/freebsd-clang QMAKE_CC=cc QMAKE_CXX=c++ QMAKE_LINK_C=cc QMAKE_LINK_C_SHLIB=cc QMAKE_LINK=c++ QMAKE_LINK_SHLIB=c++ 'QMAKE_CFLAGS=-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing ' 'QMAKE_CXXFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  ' 'QMAKE_LFLAGS= -Wl,--as-needed -fstack-protector-strong ' QMAKE_LIBS= QMAKE_CFLAGS_DEBUG= QMAKE_CFLAGS_RELEASE= QMAKE_CXXFLAGS_DEBUG= QMAKE_CXXFLAGS_RELEASE= PREFIX=/usr/local CONFIG+=release 'CONFIG-=debug separate_debug_info' QT_CONFIG+=release 'QT_CONFIG-=debug separate_debug_info' ) && /usr/bin/make -f Makefile all
Project ERROR: Could not find feature speechd.
*** [sub-tts-all] Error code 3
Comment 1 Rainer Hurling freebsd_committer freebsd_triage 2020-04-14 09:44:55 UTC
(In reply to O. Hartmann from comment #0)

It should be sufficient to deinstall old version before install the new one:

pkg delete -f accessibility/qt5-speech
portmaster accessibility/qt5-speech


HTH,
Rainer Hurling
Comment 2 O. Hartmann 2020-04-20 08:36:14 UTC
Deinstalling on traditional make installed ports and reinstalling works well, but poudriere still is gives an error:

[...]
>> Building accessibility/qt5-speech
build started at Mon Apr 20 06:21:36 UTC 2020
port directory: /usr/ports/accessibility/qt5-speech
package name: qt5-speech-5.14.2
building for: FreeBSD my.host 12.1-STABLE FreeBSD 12.1-STABLE 1201513 amd64
maintained by: kde@FreeBSD.org
Makefile ident:      $FreeBSD: head/accessibility/qt5-speech/Makefile 531601 2020-04-13 12:35:31Z tcberner $
Poudriere version: 3.3.4
Host OSVERSION: 1300092
Jail OSVERSION: 1201513
Job Id: 02

---Begin Environment---
SHELL=/bin/csh
OSVERSION=1201513
UNAME_v=FreeBSD 12.1-STABLE 1201513
UNAME_r=12.1-STABLE
BLOCKSIZE=K
MAIL=/var/mail/root
STATUS=1
HOME=/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
LOCALBASE=/usr/local
USER=root
LIBEXECPREFIX=/usr/local/libexec/poudriere
POUDRIERE_VERSION=3.3.4
MAKEOBJDIRPREFIX=/pool/sources/12-STABLE/obj/
MASTERMNT=/pool/poudriere/data/.m/12-amd64-head-default/ref
POUDRIERE_BUILD_TYPE=bulk
PACKAGE_BUILDING=yes
SAVED_TERM=screen
PWD=/pool/poudriere/data/.m/12-amd64-head-default/ref/.p/pool
P_PORTS_FEATURES=FLAVORS SELECTED_OPTIONS
MASTERNAME=12-amd64-head-default
SCRIPTPREFIX=/usr/local/share/poudriere
OLDPWD=/pool/poudriere/data/.m/12-amd64-head-default/ref/.p
SCRIPTPATH=/usr/local/share/poudriere/bulk.sh
POUDRIEREPATH=/usr/local/bin/poudriere
---End Environment---

---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=
DEPENDS_ARGS=
MAKE_ARGS=
---End Poudriere Port Flags/Env---
[...]

And the error is:

[...]
rm -f libqttexttospeech_flite.so
c++ -Wl,--as-needed -fstack-protector-strong -Wl,--no-undefined -pthread -Wl,-rpath,/usr/local/lib/qt5 -shared -o libqttexttospeech_flite.so .obj/qtexttospeechprocessor.o  .obj/qtexttospeech_flite.o  .obj/qtexttospeech_flite_plugin.o  .obj/qtexttospeech_flite_processor.o  .obj/moc_qtexttospeechprocessor_p.o  .obj/moc_qtexttospeech_flite.o  .obj/moc_qtexttospeech_flite_plugin.o  .obj/moc_qtexttospeech_flite_processor.o  -L/wrkdirs/usr/ports/accessibility/qt5-speech/work/.build/lib -L/usr/local/lib /wrkdirs/usr/ports/accessibility/qt5-speech/work/.build/lib/libQt5TextToSpeech.so /usr/local/lib/qt5/libQt5Multimedia.so /usr/local/lib/qt5/libQt5Network.so /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL -lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite -lasound 
ld: error: unable to find library -lasound
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [../../../../plugins/texttospeech/libqttexttospeech_flite.so] Error code 1

make[5]: stopped in /wrkdirs/usr/ports/accessibility/qt5-speech/work/.build/src/plugins/tts/flite
1 error
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-20 09:08:54 UTC
(In reply to O. Hartmann from comment #2)
Moin moin 

What are your options for the port?

mfg Tobias
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-22 19:28:49 UTC
(In reply to O. Hartmann from comment #2)

Moin moin 

Could you please provide a full poudriere log and/or the options of the accessibility/qt5-speech and accessibility/speech-dispatcher?


As I am unable to find a breaking configuration of the options :)

mfg Toibas
Comment 5 John Hein 2020-04-23 13:51:48 UTC
I get this, too.

What fixed it for me: deinstall previous package, qt5-speech-5.13.2

It looks like the build needs to look in the work area before looking in LOCALBASE.  Someone else with better familiarity of qmake builds might have a suggestion for how to implement that suggestion.

In the mean time, a marginally acceptable(?) workaround is to remove the previously installed version of the package.

I will attach build logs showing the build before and after the package removal.
Comment 6 John Hein 2020-04-23 13:58:51 UTC
Created attachment 213721 [details]
[build log] v1: with qt5-speech-5.13.2 installed in LOCALBASE

This log is the attempted build phase of qt5-speech-5.14.2 with QMAKE_ARGS+=-d and qt5-speech-5.13.2 installed in LOCALBASE.  'grep -v ^DEBUG.1' will produce a log one would see without -d.
Comment 7 John Hein 2020-04-23 14:02:51 UTC
Created attachment 213722 [details]
[build log] v2: after qt5-speech-5.13.2 removed from LOCALBASE

This log is the attempted build phase of qt5-speech-5.14.2 with QMAKE_ARGS+=-d after qt5-speech-5.13.2 was _removed_ from LOCALBASE (sudo pkg delete -f qt5-speech-5.13.2).  'grep -v ^DEBUG.1' will produce a log one would see without -d.
Comment 8 Rainer Hurling freebsd_committer freebsd_triage 2020-04-23 17:45:10 UTC
(In reply to John Hein from comment #5)

Hi John,

I think the error ("Could not find feature speechd"), you have a workaround for with deinstalling qt5-speech-5.13.2 before the installation of qt5-speech-5.14.2 is the one, Oliver described in his initial description and for which one I found the same workaround before, see comment #1.

After Oliver deinstalled the old version and installed the new version, he ran into a new problem "unable to find library -lasound", see comment #2. This also happens for him on Poudriere (at least on his box). Tobias asked about the option settings, Oliver has used for accessibility/qt5-speech and accessibility/speech-dispatcher.

It seems, this is another problem, which happens only under some options combinations.


Sorry, if I totally misunderstood yours and Tobias intensions.
Comment 9 John Hein 2020-04-24 15:08:03 UTC
(In reply to Rainer Hurling from comment #8)
The 'unable to find library -lasound' is a different problem than the original problem.  So that's a separate issue.  libasound is installed by alsa-libs which is required by qt5-multimedia which is required by qt5-speech if the FLITE option is on.  So, Oliver could investigate why libasound is missing (e.g., no alsa-libs installed for some reason).

But for the original problem, getting qt5-speech to look in WRKDIR before LOCALBASE is probably the best long term answer.  I don't have a patch suggestion for that, but someone with more qmake-based ports experience might.

By the way, other qt5 ports probably have a similar problem where currently installed versions of the port pollute the build of a new version of the port.  For example, after I got past the qt5-speech-5.13.2 pollution affecting the build of qt5-speech-5.14.2 (by removing qt5-speech-5.13.2 which was built with an older qmake, so that could be part of the problem), I got this failure with qt5-webengine:

/usr/local/bin/ld: .obj/qquickwebenginedownloaditem.o: in function `QQuickWebEngineDownloadItem::setDownloadDirectory(QString const&)':
qquickwebenginedownloaditem.cpp:(.text+0xa82): undefined reference to `QtWebEngineCore::ProfileAdapter::determineDownloadPath(QString const&, QString const&, long const&)'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineViewPrivate::navigationRequested(int, QUrl const&, int&, bool)':
qquickwebengineview.cpp:(.text+0xe92): undefined reference to `QtWebEngineCore::WebContentsAdapter::findTextHelper()'
/usr/local/bin/ld: qquickwebengineview.cpp:(.text+0xe9a): undefined reference to `QtWebEngineCore::FindTextHelper::isFindTextInProgress() const'
/usr/local/bin/ld: qquickwebengineview.cpp:(.text+0xea7): undefined reference to `QtWebEngineCore::WebContentsAdapter::findTextHelper()'
/usr/local/bin/ld: qquickwebengineview.cpp:(.text+0xeaf): undefined reference to `QtWebEngineCore::FindTextHelper::stopFinding()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineViewPrivate::initializationFinished()':
qquickwebengineview.cpp:(.text+0x2e39): undefined reference to `QtWebEngineCore::WebContentsAdapter::setVisible(bool)'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::goBack()':
qquickwebengineview.cpp:(.text+0x34ce): undefined reference to `QtWebEngineCore::WebContentsAdapter::navigateBack()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::goForward()':
qquickwebengineview.cpp:(.text+0x34ee): undefined reference to `QtWebEngineCore::WebContentsAdapter::navigateForward()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::recentlyAudible() const':
qquickwebengineview.cpp:(.text+0x45fe): undefined reference to `QtWebEngineCore::WebContentsAdapter::recentlyAudible() const'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::findText(QString const&, QFlags<QQuickWebEngineView::FindFlag>, QJSValue const&)':
qquickwebengineview.cpp:(.text+0x488a): undefined reference to `QtWebEngineCore::WebContentsAdapter::findTextHelper()'
/usr/local/bin/ld: qquickwebengineview.cpp:(.text+0x48af): undefined reference to `QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool, QJSValue const&)'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::itemChange(QQuickItem::ItemChange, QQuickItem::ItemChangeData const&)':
qquickwebengineview.cpp:(.text+0x4ef1): undefined reference to `QtWebEngineCore::WebContentsAdapter::setVisible(bool)'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::triggerWebAction(QQuickWebEngineView::WebAction)':
qquickwebengineview.cpp:(.text+0x5426): undefined reference to `QtWebEngineCore::WebContentsAdapter::navigateBack()'
/usr/local/bin/ld: qquickwebengineview.cpp:(.text+0x5491): undefined reference to `QtWebEngineCore::WebContentsAdapter::navigateForward()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::lifecycleState() const':
qquickwebengineview.cpp:(.text+0x759e): undefined reference to `QtWebEngineCore::WebContentsAdapter::lifecycleState() const'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::setLifecycleState(QQuickWebEngineView::LifecycleState)':
qquickwebengineview.cpp:(.text+0x75be): undefined reference to `QtWebEngineCore::WebContentsAdapter::setLifecycleState(QtWebEngineCore::WebContentsAdapterClient::LifecycleState)'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineView::recommendedState() const':
qquickwebengineview.cpp:(.text+0x75de): undefined reference to `QtWebEngineCore::WebContentsAdapter::recommendedState() const'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [../../lib/libQt5WebEngine.so.5.14.0] Error code 1

make[5]: stopped in /usr/ports/www/qt5-webengine/work/.build/src/webengine


I will probably open that as a separate bug.
Comment 10 John Hein 2020-04-24 15:36:21 UTC
By the way, I just built qt5-speech with FLITE on (and SPEECHD) and did not run into a missing libasound problem.
Comment 11 John Hein 2020-04-24 23:53:12 UTC
(In reply to John Hein from comment #9)
There's already another bug for the qt5-webengine version of this bug - see bug 245495 (and also the 20190613 UPDATING entry for the workaround).
Comment 12 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-25 18:45:57 UTC
(In reply to John Hein from comment #5)(In reply to John Hein from comment #5)
> In the mean time, a marginally acceptable(?) workaround is to remove the previously installed version of the package.
Or switch to a proper port builder like poudriere. 


We'll have a look on how to again improve the Qt-ports build process, and reduce the cases where it picks something from a previous installed version. But this is  orthogonal to what I would like to look at here. 



What I want to fix in this issue is qt5-speech failing in a clean-room poudriere, as reported by O. Hartmann.
Comment 13 Rainer Hurling freebsd_committer freebsd_triage 2020-04-25 21:00:59 UTC
(In reply to Tobias C. Berner from comment #4)

Hi all,
I think I was able to reproduce the problem, described by O. Hartmann.

On Poudriere with option FLITE disabled in accessibility/speech-dispatcher[1], but same option FLITE enabled in accessibility/qt5-speech[2], the build of accessibility/qt5-speech breaks with 'ld: error: unable to find library -lasound' in work/.build/src/plugins/tts/flite. 

This is on FreeBSD 13.0-CURRENT amd64 with recent ports. Both poudriere logs, for speech-dispatcher and for qt5-speech, are attached.

HTH,
Rainer


[1] Options in accessibility/speech-dispatcher:
    [ ] ALSA
    [ ] AO
    [X] DOCS
    [X] ESPEAK
    [ ] FESTIVAL
    [ ] FLITE
    [ ] NAS
    [ ] PULSEAUDIO

[2] Options in ccessibility/qt5-speech:
    [X] SPEECHD
    [X] FLITE
Comment 14 Rainer Hurling freebsd_committer freebsd_triage 2020-04-25 21:02:47 UTC
Created attachment 213788 [details]
poudriere log of accessibility/speech-dispatcher, option FLITE disabled
Comment 15 Rainer Hurling freebsd_committer freebsd_triage 2020-04-25 21:03:47 UTC
Created attachment 213789 [details]
poudriere log of accessibility/qt5-speech, option FLITE enabled
Comment 16 John Hein 2020-04-27 17:30:37 UTC
(In reply to Rainer Hurling from comment #13)
I suspect you must have ALSA off for qt5-multimedia, too.  qt5-speech depends on qt5-multimedia which depends on alsa-lib (which has libasound) if the ALSA option is on for qt5-multimedia (default is on).  That may be why it [accidentally] works for other people.

It looks like it is a configure-time detection problem with qt5-speech.  Supposedly the flite-alsa feature is auto-detected by default.  But even if alsa-lib is not installed and flite was built without alsa, the qt5-speech configure stage think's it should build with that feature on:

Checking for Flite with ALSA... yes

(that's with both qt5-multimedia and flite built with ALSA off, and qt5-speech with FLITE on).


Still this is a separate bug than the original one.


config.log shows that it tries to detect an installed flite_alsa first (and fails), but then accepts a "source inline" flavor of flite_alsa (but then later fails because it can't find a libasound):

looking for library flite_alsa                                                                              
Trying source 0 (type pkgConfig) of library flite_alsa ...
+ pkgconf --exists --silence-errors alsa
pkg-config did not find package.
  => source produced no result.
Trying source 1 (type inline) of library flite_alsa ...
 => source accepted.
Comment 17 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-27 17:55:25 UTC
(In reply to John Hein from comment #16)
Thanks you two for the investigation, you two, now I have a broken config \o/ 

Time to fix it :)
Comment 18 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-27 19:14:33 UTC
Created attachment 213867 [details]
v1

Attached is a patch which creates an ALSA option, implying FLITE. 


mfg Tobias
Comment 19 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-27 19:15:39 UTC
Note, this is certainly not the "best" solution, but as we cannot depend on other packages by option-set, this seems to be the best solution I could come up with at the moment :)
Comment 20 John Hein 2020-04-28 12:31:39 UTC
(In reply to Tobias C. Berner from comment #19)
On the contrary, I think this approach is the best (or at least a very good) solution - thanks.  If more ports explicitly enabled / disabled dependencies (features), "the world would be a better place".  This allows users to specify global preferences (e.g., OPTIONS_UNSET=ALSA in make.conf) and override for individual ports as the situation dictates.

Auto-detecting for enable/disable is probably the cause of many failures on bugs.freebsd.org (poudriere or not).  Auto-detecting _location_ (of headers, libs - e.g., via pkgconf) is another story (and is a good thing generally).

That said, it's still a qmake mystery to me why / how qmake detected that it was okay to use the "internal" (presumably that's another name for "bundled") version of alsa, but it failed at build time.  I don't see any bundled alsa or flite/alsa in the qt5-speech distribution.

Also, your patch has a problem with FLITE=on:

    .
    .
Qt TextToSpeech:
  Flite .................................. yes
  Flite with ALSA ........................ no
  Speech Dispatcher ...................... yes
    .
    .
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%QT_CMAKEDIR%%/Qt5TextToSpeech/Qt5TextToSpeech_QTextToSpeechEngineFlite.cmake
Error: Missing: %%QT_PLUGINDIR%%/texttospeech/libqttexttospeech_flite.so
===> Error: Plist issues found.
*** Error code 1


Maybe somewhere in the qmake stuff there's something that confuses the flite and flite_alsa feature implementations?
Comment 21 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 18:04:57 UTC
(In reply to John Hein from comment #20)
Hm, I cannot reproduce the plist failure.
Comment 22 commit-hook freebsd_committer freebsd_triage 2021-04-22 07:56:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1a3219fc0441a9e024c690cbd4c5b2a043c4add4

commit 1a3219fc0441a9e024c690cbd4c5b2a043c4add4
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2021-04-21 20:51:20 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2021-04-22 07:25:13 +0000

    accessibility/qt5-speech: fix FLITE/ALSA options and config mixups

    There is a complicated interplay between ALSA and FLITE in
    the qt5-speech port, and ALSA options in other parts of the
    Qt stack. This patch tries to offer enough knobs to manage
    the game.

    PR:             245614
    Submitted by:   tcberner
    Reported by:    John Hein

 accessibility/qt5-speech/Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Comment 23 Adriaan de Groot freebsd_committer freebsd_triage 2021-04-22 08:03:23 UTC
This ought to do the trick (landed as part of a patch series around the KDE Plasma 5.21 update, because that means rebuilding many things anyway).