Created attachment 255754 [details] [PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern Section 5.10.2 of the Porter's handbook states that setting RUN_DEPENDS=${BUILD_DEPENDS} directly is an antipattern and gives guidance on how to avoid it. This patch cleans up instances of this antipattern across all ports. This ideally should ideally result in a reduction of BUILD_DEPENDS across all these ports. Tested by building all affected ports in Poudriere.
This is a pretty big patch, CC'ed portmgr@ for review. Is it always the same BR_DEPENDS pattern or are there some exceptions?
It's always the same BR_DEPENDS pattern in the style of the guidance given by the Porter's Handbook, except for a few ports that required some reorganizing for the sake of style (nonfunctional).
I wonder if we should add BUILD_DEPENDS+= ${BR_DEPENDS} RUN_DEPENDS+= ${BR_DEPENDS} to <bsd.port.mk> as a framework variable if this is such a common pattern.
Why PORTREVISION bump? Nothing changes after this patch for build and for run ports.
Didn't know whether the bump was required. I can easily revert that. Is everything else good in the patch?
Created attachment 256602 [details] [PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern Updated patch by removing all bumps to PORTREVISION. Is there anything else needed in this review or is it good to go?
Due to the size of this change, I would like to have portmgr review this patch. Looks fine though.
Created attachment 259616 [details] [PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern Adding fixes to recent ports who have used this antipattern and refreshed patch. Any updates on reviewing this?
BUILD_DEPENDS must be before LIB_DEPENDS.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=32685f33bfec2fa55a60956a0ab39e8949921c9c commit 32685f33bfec2fa55a60956a0ab39e8949921c9c Author: Siva Mahadevan <me@svmhdvn.name> AuthorDate: 2025-04-16 17:56:40 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-04-16 18:02:30 +0000 graphics/xsane: Cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern Section 5.10.2 of the Porter's handbook states that setting RUN_DEPENDS=${BUILD_DEPENDS} directly is an antipattern and gives guidance on how to avoid it. PR: 283227 graphics/xsane/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
I'm the maintainer of the graphics/xsane and commit patch self.
Created attachment 259619 [details] [PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern Moved LIB_DEPENDS after BUILD_DEPENDS in this patch revision. (In reply to Vladimir Druzenko from comment #9) Could you point me to where this style guideline is, either in Porter's Handbook or portlint? I couldn't find it when I looked.
(In reply to Siva Mahadevan from comment #12) portclippy from ports-mgmt/portfmt
Created attachment 259620 [details] [PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern Oops, accidentally attached the old patch. Fixed now in this latest revision.
I'd love to commit this, but I think portmgr needs to decide if this refactor is ok.
The refactor is ok, but it probably needs a test build to make sure nothing breaks.
As a side note, the BUILD_RUN_DEPENDS should be after the BUILD/LIB/RUN_DEPENDS. I know the example in the porter's handbook says otherwise, but it kinda predates modern ports.
A bit like it's done in devel/p5-IO-KQueue/Makefile for example.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5a9b95813279c2206544cddcd6d2b940e75646e5 commit 5a9b95813279c2206544cddcd6d2b940e75646e5 Author: Sergei Vyshenski <svysh.fbsd@gmail.com> AuthorDate: 2025-05-10 13:13:00 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-05-10 13:18:08 +0000 devel/p5-Connector: Update 1.54 => 1.55 Commit log: https://github.com/whiterabbitsecurity/connector/compare/1.54...1.55 While here cleanup BUILD_DEPENDS=RUN_DEPENDS antipattern PR: 286709 283227 devel/p5-Connector/Makefile | 7 ++++--- devel/p5-Connector/distinfo | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-)
(In reply to Mathieu Arnold from comment #17) Instead of doing it like the style in 'devel/p5-IO-KQueue/Makefile' where it's at the end of the file, could I instead keep _BUILD_RUN_DEPENDS right after BUILD/LIB/RUN_DEPENDS? So that any reader will be able to see all of a port's main dependencies from a screenful's glance? I ask this now because it does take a little bit of manual text editing work to refactor this patch to change its style. I'm happy to do it, but just want to know exactly how it should be done :)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f85791e98c3be6bac9f5bdbbd76c9becaae39cb1 commit f85791e98c3be6bac9f5bdbbd76c9becaae39cb1 Author: Sergei Vyshenski <svysh.fbsd@gmail.com> AuthorDate: 2025-06-05 02:32:42 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-06-05 02:32:42 +0000 security/p5-IO-Socket-SSL: Update 2.089 => 2.090 Changelog: https://metacpan.org/dist/IO-Socket-SSL/changes While here cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern: Section 5.10.2 of the Porter's handbook states that setting RUN_DEPENDS=${BUILD_DEPENDS} directly is an antipattern and gives guidance on how to avoid it. PR: 287290 283227 security/p5-IO-Socket-SSL/Makefile | 20 +++++++++++--------- security/p5-IO-Socket-SSL/distinfo | 6 +++--- 2 files changed, 14 insertions(+), 12 deletions(-)
@linimon any progress on this one?
(In reply to Siva Mahadevan from comment #20) I'm mainly waiting for confirmation on this comment. I think that any style changes can be done at a later time more leisurely, but this functional change is nice to get merged now. It should ideally reduce some dependencies across the board for a lot of ports.
(In reply to Siva Mahadevan from comment #23) Any update on my comment? I'd like to get this patch in.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=65aa12dbd0713de53c3a752d58a3c7464ca8fe20 commit 65aa12dbd0713de53c3a752d58a3c7464ca8fe20 Author: Sergei Vyshenski <svysh.fbsd@gmail.com> AuthorDate: 2025-09-22 22:58:40 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-09-22 22:58:40 +0000 textproc/p5-PPIx-Regexp: Update 0.089 => 0.090 ChangeLog: https://metacpan.org/changes/distribution/PPIx-Regexp While here cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern. PR: 289756 283227 textproc/p5-PPIx-Regexp/Makefile | 7 ++++--- textproc/p5-PPIx-Regexp/distinfo | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5fadecb22faca290ed34ca672df0084cee5ce227 commit 5fadecb22faca290ed34ca672df0084cee5ce227 Author: O. Hartmann <ohartmann@walstatt.org> AuthorDate: 2025-10-15 14:17:41 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2025-10-15 14:26:14 +0000 lang/pocl: Update 7.0 -> 7.1, improve port Changelog: This is mostly a bug-fix/maintenance release. - Support for LLVM 21 for the CPU and LevelZero devices. - Support for cl_khr_icd v2.0.0, cl_khr_spirv_queries and SPV_KHR_expect_assume. https://newreleases.io/project/github/pocl/pocl/release/v7.1 Improve port: - Switch to USES=llvm from hardcoded dependencies from llvm's files. - Add options for build with all supported versions of the llvm. - Cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern. PR: 290112 283227 Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org> lang/pocl/Makefile | 40 ++++++++++++++++++++++++++-------------- lang/pocl/distinfo | 6 +++--- lang/pocl/pkg-plist | 3 ++- 3 files changed, 31 insertions(+), 18 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ddf75ac8b3e22d52c4ee6175187522ea92ad381d commit ddf75ac8b3e22d52c4ee6175187522ea92ad381d Author: Tomohiro Hosaka <bokutin@bokut.in> AuthorDate: 2026-02-04 16:43:12 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2026-02-04 16:43:12 +0000 www/p5-MojoX-Log-Dispatch-Simple: Update 1.12 => 1.15 Changelog: https://metacpan.org/release/GRYPHON/MojoX-Log-Dispatch-Simple-1.15/source/Changes Fix antipattern "BUILD_DEPENDS=RUN_DEPENDS". PR: 292909 283227 www/p5-MojoX-Log-Dispatch-Simple/Makefile | 7 ++++--- www/p5-MojoX-Log-Dispatch-Simple/distinfo | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-)