Poudriere: a problem during the stage phase

Hello everyone!

I'm trying to do my very first contribution to FreeBSD Ports by making a port of monero-gui. I have already written some patches, successfully compiled and ran it locally. And it seems to be working as expected. But I'm stuck with testing my port with poudriere.

Here is the log I get from poudriere:

Code:
$ doas poudriere testport -j monero-gui net-p2p/monero-gui
...
=======================<phase: stage          >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes [B]USER=nobody[/B] UID=65534 GID=65534
===>  Staging for monero-gui-0.18.3.3_1
===>   monero-gui-0.18.3.3_1 depends on package: qt5-l10n>=5 - found
===>   monero-gui-0.18.3.3_1 depends on file: /usr/local/lib/qt5/bin/linguist - found
===>   monero-gui-0.18.3.3_1 depends on file: /usr/local/libdata/pkgconfig/sm.pc - found
===>   monero-gui-0.18.3.3_1 depends on file: /usr/local/libdata/pkgconfig/ice.pc - found
===>   monero-gui-0.18.3.3_1 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   monero-gui-0.18.3.3_1 depends on file: /usr/local/libdata/pkgconfig/xext.pc - found
===>   Generating temporary packing list
[  0% 1/1] cd /wrkdirs/usr/ports/net-p2p/monero-gui/work/.build && /usr/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /usr/local/bin/monero-wallet-rpc
CMake Error at monero/src/wallet/cmake_install.cmake:47 (file):
  file INSTALL cannot copy file
  "/wrkdirs/usr/ports/net-p2p/monero-gui/work/.build/bin/monero-wallet-rpc"
  to "/usr/local/bin/monero-wallet-rpc": Permission denied.
Call Stack (most recent call first):
  monero/src/cmake_install.cmake:56 (include)
  monero/cmake_install.cmake:45 (include)
  cmake_install.cmake:42 (include)

The question is what exactly is going wrong here? Is the stage phase the wrong place for installing the binaries into the filesystem? If so, should I patch `CMakeLists.txt` somehow to install them later? If the stage phase is the right place, how these files can be installed without having root privileges? I'm sure I'm not the first who's stuck with the same question, so is there any best practice to avoid such problems? Maybe there are some existing ports where I can see the way how the maintainers avoid this problem?
 
Don't forget that net-p2p/monero-cli already exists, why are you embedding it ?
You should depend on it, and just build the gui part.
Of course you will need to patch it since for an unknown reason, they bundle it regardless of if it is already installed.
Well normally the install target respect the install prefix set by the port framework so it is pretty weird.

You should try to start from the monero-cli port and add the gui part to it.

What does your port Makefile look like ?
 
The question is what exactly is going wrong here? Is the stage phase the wrong place for installing the binaries into the filesystem?

Stage phase should actually install, but not into the root filesystem - there's a separate staging directory from which the package contents are packed together. IIRC the corresponding prefix should be set automatically during CMake configuration, maybe the CMakeLists.txt does not respect that.
 
Stage phase should actually install, but not into the root filesystem - there's a separate staging directory from which the package contents are packed together. IIRC the corresponding prefix should be set automatically during CMake configuration, maybe the CMakeLists.txt does not respect that.
Thank you, that sounds like the reason. I've just taken a look at the destination paths and it looks like CMakeLists.txt doesn't respect the prefix.
 
Back
Top