Bug 270974 - security/vaultwarden: failes to build with synth
Summary: security/vaultwarden: failes to build with synth
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Reifenberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-21 07:17 UTC by Matthias Pfaller
Modified: 2023-09-02 13:40 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mr)


Attachments
Patch for security/vaultwarden/Makefile (463 bytes, patch)
2023-04-22 10:51 UTC, Trond Endrestøl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Pfaller 2023-04-21 07:17:13 UTC
synth always wants to rebuild security/vaultwarden and immediately discards the resulting package. I always get a "failed dependency check". When I use "WHYFAIL" I get the following additional information. 

bash# WHYFAIL=1 synth status  security/vaultwarden
security/vaultwarden package has less dependencies than the port requires (6)
Query: devel/capnproto:capnproto-0.10.3
math/gmp:gmp-6.2.1
databases/mariadb104-client:mariadb104-client-10.4.28
security/nettle:nettle-3.8.1
databases/postgresql13-client:postgresql13-client-13.10

vaultwarden-1.28.0.pkg failed dependency check.

And when I query the dependencies of the installed package: 
vaultwarden-1.28.0:
        nettle-3.8.1
        gmp-6.2.1
        capnproto-0.10.3
        postgresql13-client-13.10
        mariadb104-client-10.4.28

I do not see the dependency on vaultwarden_web-vault-2023.3.0b. Shouldn't that be listed? I have the WEBVAULT option enabled.
Comment 1 Trond Endrestøl 2023-04-22 10:51:49 UTC
Created attachment 241650 [details]
Patch for security/vaultwarden/Makefile

Misplaced hyphen and underscore in dependency.
Comment 2 Trond Endrestøl 2023-04-24 13:30:16 UTC
Comment on attachment 241650 [details]
Patch for security/vaultwarden/Makefile

Patch is no longer needed.
Comment 3 Matthias Pfaller 2023-04-25 11:23:31 UTC
The vaultwarden_web-vault-2023.3.0b is still missing:

bash# pkg info -F vaultwarden-1.28.0_1.pkg 
vaultwarden-1.28.0_1
Name           : vaultwarden
Version        : 1.28.0_1
Origin         : security/vaultwarden
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : security
Licenses       : GPLv3
Maintainer     : mr@FreeBSD.org
WWW            : https://github.com/dani-garcia/vaultwarden
Comment        : Bitwarden compatible backend server
Options        :
        WEBVAULT       : on
Shared Libs required:
        libpq.so.5
        libmariadb.so.3
Annotations    :
        FreeBSD_version: 1302001
Flat size      : 25.0MiB
Description    :
This is a Bitwarden server API implementation written in Rust
compatible with upstream Bitwarden clients*,
perfect for self-hosted deployment
where running the official resource-heavy service might not be ideal.

WWW: https://github.com/dani-garcia/vaultwarden

bash# pkg info -dF vaultwarden-1.28.0_1.pkg 
vaultwarden-1.28.0_1:
        capnproto-0.10.3
        gmp-6.2.1
        mariadb104-client-10.4.28
        nettle-3.8.1
        postgresql13-client-13.10

Could it be that the reason for this is that the directory name is
www/vaultwarden-web_vault
but in the Makefile there is:
PKGNAMESUFFIX=  _web-vault
Comment 4 Matthias Pfaller 2023-04-25 15:07:18 UTC
Changing PKGNAMESUFFIX didn't help, but I still think it's nicer when it matches the directory name
Comment 5 Matthias Pfaller 2023-04-26 17:48:24 UTC
I tried a normal build and got:
[root@zork /usr/ports/security/vaultwarden]# make package
===>  Building package for vaultwarden-1.28.1
actual-package-depends: dependency on /usr/local/www/vaultwarden/web-vault not registered (normal if it belongs to base)
pkg-static: DEBUG: -/

With this I could find the problem. It doesn't seem to be allowed to reference a directory in a _RUN_DEPENDS variable. I changed
WEBVAULT_RUN_DEPENDS=   ${WWWDIR}/web-vault:www/vaultwarden-web_vault
to
WEBVAULT_RUN_DEPENDS=   ${WWWDIR}/web-vault/404.html:www/vaultwarden-web_vault
and now the dependency gets regitered.
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-04-27 15:56:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=20532b22c668f1187690f3cc30bd2817e2f4a315

commit 20532b22c668f1187690f3cc30bd2817e2f4a315
Author:     Michael Reifenberger <mr@FreeBSD.org>
AuthorDate: 2023-04-27 15:51:24 +0000
Commit:     Michael Reifenberger <mr@FreeBSD.org>
CommitDate: 2023-04-27 15:54:49 +0000

    security/vaultwarden: Try to fix "failes to build with synth"

    RUN_DEPENDS should depend on a file not a directory.

    PR:             270974
    Reported by:    Matthias Pfaller

 security/vaultwarden/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)