Bug 283227 - */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern
Summary: */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-09 21:18 UTC by Siva Mahadevan
Modified: 2026-02-04 16:46 UTC (History)
6 users (show)

See Also:


Attachments
[PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern (145.86 KB, patch)
2024-12-09 21:18 UTC, Siva Mahadevan
no flags Details | Diff
[PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern (118.82 KB, patch)
2025-01-10 16:22 UTC, Siva Mahadevan
no flags Details | Diff
[PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern (109.38 KB, patch)
2025-04-16 17:31 UTC, Siva Mahadevan
no flags Details | Diff
[PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern (109.38 KB, patch)
2025-04-16 18:30 UTC, Siva Mahadevan
no flags Details | Diff
[PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern (110.03 KB, patch)
2025-04-16 18:34 UTC, Siva Mahadevan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Siva Mahadevan freebsd_committer freebsd_triage 2024-12-09 21:18:21 UTC
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.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2024-12-09 23:31:18 UTC
This is a pretty big patch, CC'ed portmgr@ for review.

Is it always the same BR_DEPENDS pattern or are there some exceptions?
Comment 2 Siva Mahadevan freebsd_committer freebsd_triage 2024-12-09 23:46:09 UTC
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).
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2024-12-10 13:24:28 UTC
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.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2024-12-10 18:35:21 UTC
Why PORTREVISION bump? Nothing changes after this patch for build and for run ports.
Comment 5 Siva Mahadevan freebsd_committer freebsd_triage 2024-12-10 18:57:32 UTC
Didn't know whether the bump was required. I can easily revert that.

Is everything else good in the patch?
Comment 6 Siva Mahadevan freebsd_committer freebsd_triage 2025-01-10 16:22:18 UTC
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?
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2025-01-10 16:36:31 UTC
Due to the size of this change, I would like to have portmgr review this patch.

Looks fine though.
Comment 8 Siva Mahadevan freebsd_committer freebsd_triage 2025-04-16 17:31:48 UTC
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?
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2025-04-16 17:54:36 UTC
BUILD_DEPENDS must be before LIB_DEPENDS.
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-04-16 18:02:52 UTC
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(-)
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2025-04-16 18:04:27 UTC
I'm the maintainer of the graphics/xsane and commit patch self.
Comment 12 Siva Mahadevan freebsd_committer freebsd_triage 2025-04-16 18:30:31 UTC
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.
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2025-04-16 18:33:55 UTC
(In reply to Siva Mahadevan from comment #12)
portclippy from ports-mgmt/portfmt
Comment 14 Siva Mahadevan freebsd_committer freebsd_triage 2025-04-16 18:34:59 UTC
Created attachment 259620 [details]
[PATCH] */*: cleanup RUN_DEPENDS=BUILD_DEPENDS antipattern

Oops, accidentally attached the old patch. Fixed now in this latest revision.
Comment 15 Robert Clausecker freebsd_committer freebsd_triage 2025-04-16 23:45:52 UTC
I'd love to commit this, but I think portmgr needs to decide if this refactor is ok.
Comment 16 Mathieu Arnold freebsd_committer freebsd_triage 2025-04-17 17:14:44 UTC
The refactor is ok, but it probably needs a test build to make sure nothing breaks.
Comment 17 Mathieu Arnold freebsd_committer freebsd_triage 2025-04-17 17:17:36 UTC
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.
Comment 18 Mathieu Arnold freebsd_committer freebsd_triage 2025-04-17 17:19:14 UTC
A bit like it's done in devel/p5-IO-KQueue/Makefile for example.
Comment 19 commit-hook freebsd_committer freebsd_triage 2025-05-10 13:19:43 UTC
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(-)
Comment 20 Siva Mahadevan freebsd_committer freebsd_triage 2025-05-11 12:48:24 UTC
(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 :)
Comment 21 commit-hook freebsd_committer freebsd_triage 2025-06-05 02:35:12 UTC
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(-)
Comment 22 Robert Clausecker freebsd_committer freebsd_triage 2025-06-25 11:49:45 UTC
@linimon any progress on this one?
Comment 23 Siva Mahadevan freebsd_committer freebsd_triage 2025-06-25 11:58:18 UTC
(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.
Comment 24 Siva Mahadevan freebsd_committer freebsd_triage 2025-07-21 16:28:41 UTC
(In reply to Siva Mahadevan from comment #23)
Any update on my comment? I'd like to get this patch in.
Comment 25 commit-hook freebsd_committer freebsd_triage 2025-09-22 23:05:26 UTC
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(-)
Comment 26 commit-hook freebsd_committer freebsd_triage 2025-10-15 14:27:34 UTC
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(-)
Comment 27 commit-hook freebsd_committer freebsd_triage 2026-02-04 16:46:10 UTC
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(-)