Solved Help with stage-qa error

ctuffli

New Member


Messages: 6

#1
I'm nearing the final stages of creating a new port, but building it with DEVELOPER=yes in /etc/make.conf generates the error:
Code:
...
====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
Error: 'bin/nvim-qt' is referring to /usr/ports/editors/neovim-qt/work/stage
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/neovim-qt
Without DEVELOPER=yes, the port builds and passes all the checks mentioned in the "Testing the Port" section of the Porter's Handbook. What is this error message trying to tell me?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,232
Messages: 27,212

#2
I think this is a separate stage, designed to do some automated checks, for quality assurance. But I can't find much about it, or how you can configure it properly.
 

tobik@

Daemon
Developer

Thanks: 1,341
Messages: 1,909

#3
Error: 'bin/nvim-qt' is referring to /usr/ports/editors/neovim-qt/work/stage
It seems that ${STAGEDIR} is being recorded into bin/nvim-qt for some reason. You need to fix this. It could be that wrong paths are being compiled into the binary (or script?) and this will likely lead to runtime errors (it'll refer to a non-existent path when users install the package or you've cleaned your work directory).

I cannot really give you any advice on how to fix it without seeing the port though.
 
OP
OP
ctuffli

ctuffli

New Member


Messages: 6

#4
The port is pretty simple. I can post the shar somewhere if it helps, but here are the contents of the Makefile and pkg-plist:

Code:
# pwd
/usr/ports/editors/neovim-qt
# ls
distinfo        Makefile        pkg-descr       pkg-plist
# cat Makefile
# $FreeBSD$

PORTNAME=       neovim-qt
PORTVERSION=    0.2.8
CATEGORIES=     editors

MAINTAINER=     chuck@tuffli.net
COMMENT=        Neovim client library and GUI, in Qt5

LICENSE=        ISCL

RUN_DEPENDS=    neovim>=0:editors/neovim

CMAKE_INSTALL_PREFIX=   ${STAGEDIR}${PREFIX}

USES=           cmake qmake desktop-file-utils

USE_QT5=        buildtools_build core qmake_build testlib network gui widgets

USE_GITHUB=     yes
GH_TUPLE=       equalsraf:neovim-qt:v0.2.8

.include <bsd.port.mk>
# cat pkg-plist
bin/nvim-qt
share/applications/nvim-qt.desktop
share/nvim-qt/runtime/README.md
share/nvim-qt/runtime/doc/nvim_gui_shim.txt
share/nvim-qt/runtime/doc/tags
share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
share/pixmaps/nvim-qt.png
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,232
Messages: 27,212

#5
I think the issue might be caused by this:
Code:
CMAKE_INSTALL_PREFIX=   ${STAGEDIR}${PREFIX}
 

tobik@

Daemon
Developer

Thanks: 1,341
Messages: 1,909

#6
CMAKE_INSTALL_PREFIX= ${STAGEDIR}${PREFIX}
That looks like the problem. Do not add ${STAGEDIR} here. The framework normally already sets CMAKE_INSTALL_PREFIX to the right value, so why do you need to set it here?

GH_TUPLE= equalsraf:neovim-qt:v0.2.8
Please replace this with just
Code:
GH_ACCOUNT=	equalsraf
and instead of PORTVERSION use
Code:
DISTVERSIONPREFIX=	v
DISTVERSION=	0.2.8
 
OP
OP
ctuffli

ctuffli

New Member


Messages: 6

#7
That looks like the problem. Do not add ${STAGEDIR} here. The framework normally already sets CMAKE_INSTALL_PREFIX to the right value, so why do you need to set it here?
Because I'm a ports n00b and was copying what others did without entirely understanding what I was doing :)

With the changes you suggested, make stage works correctly, but make check-orphans fails because the files aren't being installed under works/stage. Instead, it appears they are being installed directly to the file system:
Code:
[17/18] cd /usr/ports/editors/neovim-qt/work/neovim-qt-0.2.8 && /usr/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /usr/local/bin/nvim-qt
-- Set runtime path of "/usr/local/bin/nvim-qt" to "/usr/local/lib/qt5:/usr/local/lib"
-- Installing: /usr/local/share/nvim-qt//runtime
-- Installing: /usr/local/share/nvim-qt//runtime/README.md
-- Installing: /usr/local/share/nvim-qt//runtime/doc
-- Installing: /usr/local/share/nvim-qt//runtime/doc/tags
-- Installing: /usr/local/share/nvim-qt//runtime/doc/nvim_gui_shim.txt
-- Installing: /usr/local/share/nvim-qt//runtime/plugin
-- Installing: /usr/local/share/nvim-qt//runtime/plugin/nvim_gui_shim.vim
-- Installing: /usr/local/share/applications/nvim-qt.desktop
-- Installing: /usr/local/share/pixmaps/nvim-qt.png
====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
Maybe setting CMAKE_INSTALL_PREFIX to use ${STAGEDIR} forced the files to the correct location for the port?
 

tobik@

Daemon
Developer

Thanks: 1,341
Messages: 1,909

#8
The problem is the addition of USES=qmake, it appears to interfere with cmake. I don't think that qmake is needed to build nvim-qt. Removing it let's the port stage properly.

There are some other problems I encountered: Neovim is called during the build, so it needs to be a build dependency too. Then it tries to download msgpack during the build, so we need to tell it to use the system library instead:
Code:
BUILD_DEPENDS=	neovim>=0:editors/neovim
LIB_DEPENDS=	libmsgpackc.so:devel/msgpack
RUN_DEPENDS=	neovim>=0:editors/neovim

CMAKE_ARGS=	-DUSE_SYSTEM_MSGPACK:BOOL=ON
P.S. In the future just post the shar or patch you have for the port without asking if you should. Copying and pasting a port from the forums is really annoying. ;)
 
OP
OP
ctuffli

ctuffli

New Member


Messages: 6

#9
OK, I'll remove the qmake and add the other fixes.

P.S. In the future just post the shar or patch you have for the port without asking if you should. Copying and pasting a port from the forums is really annoying. ;)
Ooops, sorry about that. Thank you so much for debugging this! You went above and beyond.
 
Top