Bug 283954 - dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate
Summary: dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate
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: Robert Clausecker
URL: https://github.com/mwarning/KadNode/r...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-09 10:34 UTC by Älven
Modified: 2025-01-17 12:40 UTC (History)
3 users (show)

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


Attachments
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate (9.17 KB, patch)
2025-01-09 10:34 UTC, Älven
no flags Details | Diff
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate (9.25 KB, patch)
2025-01-09 10:37 UTC, Älven
no flags Details | Diff
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate (9.16 KB, patch)
2025-01-11 10:22 UTC, Älven
no flags Details | Diff
Poudriere testport OK for 141amd64 (26.94 KB, text/plain)
2025-01-12 00:08 UTC, Älven
no flags Details
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate (9.05 KB, patch)
2025-01-12 00:15 UTC, Älven
no flags Details | Diff
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate (9.48 KB, patch)
2025-01-17 03:47 UTC, Älven
alster: maintainer-approval? (moritzwarning)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Älven 2025-01-09 10:34:45 UTC
Created attachment 256569 [details]
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate

Upstream is alive and active, has 1-st class FreeBSD support.                                                                          
They had switched to mbedtls3 since version 2.4.0.                                                                                     
Using their ready-to-use port with minor changes:                                                                                      
                                                                                                                                       
* Fix files/kadnode.in mode (0755 → 0644)                                                                                              
* Improve pkg-descr                                                                                                                    
* Some linting

Poudriere testport: OK for [amd64 i386] * [142 141 134]
Comment 1 Älven 2025-01-09 10:37:47 UTC
Created attachment 256570 [details]
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate

Use ${MANDIRS}
Comment 2 moritzwarning 2025-01-09 11:40:53 UTC
yeah, I still try to test&fix KadNode for freebsd. Then I will update the port.
Comment 3 moritzwarning 2025-01-09 18:53:00 UTC
Thanks Älven, I just noticed that you have added a patch to update KadNode. That's awesome. It should work. It is just that NSS might not work flawless. But we can address in a next release.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2025-01-10 16:30:22 UTC
(In reply to moritzwarning from comment #3)

Would you like me to commit Älven's patch?
Comment 5 moritzwarning 2025-01-10 21:00:16 UTC
Hi Robert. Yes, please add his patch.
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2025-01-11 09:32:43 UTC
Remove C/LDFLAGS and replace it with UPNP_USES= localbase:ld flags
Comment 7 Älven 2025-01-11 10:07:06 UTC
Thank you for the clean advice! In progress…
Comment 8 Älven 2025-01-11 10:22:36 UTC
Created attachment 256616 [details]
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate

Replace C/LDFLAGS with UPNP_USES= localbase:ldflags
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2025-01-11 20:57:28 UTC
Why did you remove the CPE_VENDOR entry?
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2025-01-11 22:04:17 UTC
The build fails on amd64 FreeBSD 14.1.  This could be due to my ports tree being slightly out of date, so I'll try again with a rebase on the most recent one:

src/ext-bob.c:9:10: fatal error: 'mbedtls/entropy.h' file not found
    9 | #include <mbedtls/entropy.h>
      |          ^~~~~~~~~~~~~~~~~~~
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2025-01-11 22:12:11 UTC
The build still fails with the same error.  Please check and resubmit.
Comment 12 moritzwarning 2025-01-11 23:10:52 UTC
Älven "#include <mbedtls/entropy.h>" can probably be simply removed.
Comment 13 Älven 2025-01-11 23:51:19 UTC
(In reply to moritzwarning from comment #12)
Thank you!:)

I feel rather confused by difference in build results, can't even guess why it's so. I may still try to patch it, if you like! :)

(In reply to Robert Clausecker from comment #9)
About CPE_VENDOR, it wasn't my decision: I just backported it from upstream [0] without any checks. But seems like the real CPE_STR for the port [1] was indeed:

> cpe:2.3:a:kadnode_project:kadnode:2.3.0:::::freebsd14:x64:4

At least until 2.3.0 version. May be it was upstream decision to change this?
I could easily restore it, if they decide…

[0] https://github.com/mwarning/KadNode/blob/master/freebsd/Makefile
[1] https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.3&keyword=kadnode
Comment 14 moritzwarning 2025-01-11 23:55:09 UTC
Älven, I do not even know what CPE_VENDOR is. Feel free to patch the release as needed. :)
Comment 15 Älven 2025-01-11 23:56:39 UTC
Very well! :) In progress…
Comment 16 Älven 2025-01-12 00:08:19 UTC
Created attachment 256632 [details]
Poudriere testport OK for 141amd64

My poudriere builds were all OK. Here is the log (just to prove I've really tested it, and many times).
Still I see the build issue without poudriere, just ordinary `make`. Why it could be and what am I to do?
Comment 17 Älven 2025-01-12 00:15:38 UTC
Created attachment 256633 [details]
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate

Restore CPE_VENDOR

(It's a field from some big database of programs, usually used to refer to them in a uniform manner, i.e. for pinning vulnerability reports (CVEs) to the exact version/fork of a program).
I like the idea and usually try to add, not remove the CPE ids :)
Comment 18 Robert Clausecker freebsd_committer freebsd_triage 2025-01-12 03:55:35 UTC
(In reply to Älven from comment #17)

Is the build tree you use for the Poudriere builds up to date?  Try rebasing it on top of the current main tree.

Yes, the default CPE_VENDOR seems to be wrong for this port, so an explicit assignment is needed.

Feel free to disregard upstreams port makefile if any; it can serve as an inspiration, but needs not be followed.
Comment 19 Älven 2025-01-12 13:02:32 UTC
(In reply to Robert Clausecker from comment #18)
> Is the build tree you use for the Poudriere builds up to date?

It's common to me to do `git pull --rebase` 3-5 times a day, both for the ports I use for myself and those I help to improve for others. I build them all from the same tree with separate branch for myself. You could see it here [0].

Still I also have some issues with plain `make` builds without poudriere from the same tree. My guess may be something related to build environment.
And what results do you receive from your poudriere builds, is it OK?
(I may think your results are from plain `make`, but I may be wrong as well).

[0] https://git.sr.ht/~alster/freebsd-ports
Comment 20 Robert Clausecker freebsd_committer freebsd_triage 2025-01-12 13:05:40 UTC
(In reply to Älven from comment #19)

I have only used Poudriere to build test this patch.
Even when you update your ports tree, the dependencies you have already installed don't change unless you rebuild them.  So perhaps try to rebuild mbedssl3 and see if that reproduces the issue.
Comment 21 Älven 2025-01-12 13:07:58 UTC
P.S. I build every port from it's own branch rebased on main and numerated after FreeBSD bugzilla issues. For this one it's [0].

[0] https://git.sr.ht/~alster/freebsd-ports/log/283954
Comment 22 Älven 2025-01-12 13:14:46 UTC
(In reply to Robert Clausecker from comment #20)
I thought poudriere already do care about all this. I often see it rebuilds many dependencies during bulk update builds, so I expect it to do things the right way.

Well, I'll try to rebuild some deps explicitly and see how it will do.
Comment 23 Robert Clausecker freebsd_committer freebsd_triage 2025-01-12 13:54:14 UTC
(In reply to Älven from comment #22)

Poudriere indeed rebuilds dependencies, I'm talking about test building outside of Poudriere.
Comment 24 Robert Clausecker freebsd_committer freebsd_triage 2025-01-12 13:54:51 UTC
Also check if you perhaps have a site patch that you forgot to check in, so it's in your tree but not in attachment #256633 [details].
Comment 25 Älven 2025-01-17 03:47:13 UTC
Created attachment 256745 [details]
[PATCH] dns/kadnode: update 2.3.0 → 2.4.1, un-deprecate

(In reply to Robert Clausecker from comment #24)
Thanks for the advice, I checked this too, but it was not the cause: I had only one commit with this patch on branch tip.
After one more poudriere update I also saw the same errors with poudriere builds and begun my investigation.
It was localbase:ldflags needed to properly include and link with mbedtls!
All is OK with it now (for me). Here is the updated patch, test it, please: hope it will work for you too…

(In reply to moritzwarning from comment #12)
> Älven "#include <mbedtls/entropy.h>" can probably be simply removed.
Already fixed the issue, so no need for removal, it may happily stay, as you like. :)
Comment 26 commit-hook freebsd_committer freebsd_triage 2025-01-17 12:38:02 UTC
A commit in branch main references this bug:

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

commit c19a49d41d8b1227e7d4663e9ddc9a01adebb646
Author:     Älven <alster@vinterdalen.se>
AuthorDate: 2025-01-09 10:15:35 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-01-17 12:34:54 +0000

    dns/kadnode: update 2.3.0 -> 2.4.1, un-deprecate

    Upstream is alive and active, has 1-st class FreeBSD support.
    They had switched to mbedtls3 since version 2.4.0.
    Using their ready-to-use port with minor changes:

    * Fix files/kadnode.in mode (0755 -> 0644)
    * Improve pkg-descr
    * Some linting

    PR:             283954
    Reviewed by:    diizzy
    Approved by:    moritzwarning@web.de (maintainer)

 dns/kadnode/Makefile                          | 23 ++++++-------------
 dns/kadnode/distinfo                          |  6 ++---
 dns/kadnode/files/kadnode.conf.in             |  8 +++----
 dns/kadnode/files/kadnode.in                  |  4 +++-
 dns/kadnode/files/patch-src_peerfile.c (gone) | 10 --------
 dns/kadnode/files/patch-src_upnp.c (gone)     | 16 -------------
 dns/kadnode/pkg-descr                         | 33 ++++++++++++++++++++++++---
 dns/kadnode/pkg-message                       |  8 +------
 dns/kadnode/pkg-plist                         |  1 -
 9 files changed, 48 insertions(+), 61 deletions(-)
Comment 27 Robert Clausecker freebsd_committer freebsd_triage 2025-01-17 12:40:54 UTC
Thank you for your contribution.