Bug 191273 - [patch] port.mk/options.mk: BUILD_RUN_DEPENDS convenience helper
Summary: [patch] port.mk/options.mk: BUILD_RUN_DEPENDS convenience helper
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-22 13:25 UTC by Adam Weinberger
Modified: 2015-12-12 16:15 UTC (History)
2 users (show)

See Also:
eadler: exp-run?


Attachments
patch (2.49 KB, patch)
2014-06-22 13:25 UTC, Adam Weinberger
eadler: maintainer-approval? (portmgr)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Weinberger freebsd_committer freebsd_triage 2014-06-22 13:25:22 UTC
Created attachment 144026 [details]
patch

Quite often, binaries are needed as build-time and run-time dependencies. There are even instructions floating around about why you can't RUN_DEPENDS=${BUILD_DEPENDS} (needing RUN_DEPENDS:= instead). So why not give a convenient way to do it all at once?

This adds BUILD_RUN_DEPENDS=.
It also adds ${opt}_BUILD_RUN_DEPENDS and ${opt}_BUILD_RUN_DEPENDS_OFF helpers.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2014-07-16 16:25:52 UTC
One concern with this sort of helper is that it makes it more likely that people will accidentally add new dependencies to both build and run depends even when it isn't needed for both stages.

That said, I don't object to this change.
Comment 2 Adam Weinberger freebsd_committer freebsd_triage 2014-07-16 17:22:19 UTC
Haha, true, but right now people are doing
    RUN_DEPENDS+= ${BUILD_DEPENDS}

which is even stupider :-)
Comment 3 Antoine Brodin freebsd_committer freebsd_triage 2014-07-17 15:06:46 UTC
Hi
I dont like this change for 2 reasons:
- I think its not necessary and encourages sloppy porting
- the name build_run_depends is already used for run_depends of option build
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2014-07-17 16:50:25 UTC
Hi Antoine, thanks for reviewing the patch.

I'm not sure that I follow you about encouraging sloppy porting. I'd suggest that it could do just the opposite.

Currently, porters accidentally do RUN_DEPENDS=${BUILD_DEPENDS}, which is most definitely sloppy and known to be harmful. Giving people a safe and convenient way to do it correctly, while reducing keystrokes... to me it seems like it would *prevent* sloppy porting.

Also, the convenience of it would be quite welcome to me, as a porter.

As for your second point, I'm not sure that I follow you, as "build_run_depends" doesn't appear anywhere under /usr/ports/Mk.
Comment 5 Adam Weinberger freebsd_committer freebsd_triage 2014-07-17 16:53:42 UTC
Also, for the record, I currently count 76 instances of ports violating BUILD_DEPENDS=${RUN_DEPENDS}. So I'm not sure that promoting an even simpler alternative would INCREASE sloppiness.
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2014-07-17 17:04:17 UTC
For the 2nd point,  build_run_depends is an option helper for build option
Comment 7 Adam Weinberger freebsd_committer freebsd_triage 2014-07-17 17:09:19 UTC
Oh, I see what you mean, if there was
OPTIONS_DEFINE=    BUILD

Then BUILD_RUN_DEPENDS would be ambiguous.

Seems a bit of a remote corner case to me, but regardless the nomenclature can certainly be changed. BOTH_DEPENDS, BUILDRUN_DEPENDS, etc. Either of those look better to you?
Comment 8 Adam Weinberger freebsd_committer freebsd_triage 2015-07-17 05:12:26 UTC
I think that, with the current discussion on svn-ports-...@ on whether := is correct and the right way to register build and run time dependencies, it bears reconsidering whether this patch would help people DTRT.

It isn't just about having a shortcut, it's about making sure that there is a simple, consistent grammar to describe what you (the porter) want the port to do.
Comment 9 Adam Weinberger freebsd_committer freebsd_triage 2015-12-12 16:15:40 UTC
Closing this