Page MenuHomeFreeBSD

Mk/Uses/go.mk: Add no_targets and run args
AbandonedPublic

Authored by tobik on Jun 24 2019, 4:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 11:05 PM
Unknown Object (File)
Mar 22 2024, 5:36 PM
Unknown Object (File)
Feb 13 2024, 10:36 PM
Unknown Object (File)
Jan 15 2024, 8:56 PM
Unknown Object (File)
Jan 13 2024, 3:36 AM
Unknown Object (File)
Dec 23 2023, 11:38 PM
Unknown Object (File)
Dec 23 2023, 3:34 AM
Unknown Object (File)
Dec 13 2023, 10:36 AM

Details

Reviewers
mat
swills
jlaffaye
dmgk
Group Reviewers
O5: Ports Framework(Owns No Changed Paths)
portmgr
Summary

Add two new arguments in addition to modules:

  • no_targets to allow using go.mk with ports that require Go as build dependency but rely on make/cmake for building. Currently, unless already defined by port's Makefile, adding USES=go defines do-build/do-install targets and this breaks make based builds.
  • run to add run-time dependency on Go, thus avoiding the need for explicit RUN_DEPENDS.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 25053
Build 23766: arc lint + arc unit

Event Timeline

Mk/Uses/go.mk
56–57
.if !empty(go_ARGS:Nmodules:Nbuild:Nrun)

is a little simpler and should do the same I think.

Is there any port that would USES=go:run ? Because there is none in the other review, and we really do not like to add code that is never used.

Also, I think :build is badly named, I would think it means "build with go" or as there is a "run" argument "do the same as run but at build-time, probably something to do with dependencies". But what it does is completely different than any other USES's :build argument, it removes targets, it should probably be named no_build or no_targets or dep_only.

In D20735#448830, @mat wrote:

Is there any port that would USES=go:run ? Because there is none in the other review, and we really do not like to add code that is never used.

Yes, devel/liteide and www/gobuffalo do use go:run. (Also sysutils/docker-freebsd but it's marked as broken)

In D20735#448830, @mat wrote:

Also, I think :build is badly named, I would think it means "build with go" or as there is a "run" argument "do the same as run but at build-time, probably something to do with dependencies". But what it does is completely different than any other USES's :build argument, it removes targets, it should probably be named no_build or no_targets or dep_only.

Maybe :make?

Another option is :env. imake.mk and pear.mk use it as an arg to not define targets.

I can see how USES=go:build might be ambiguous and cause confusion.

make seems as ambiguous as build.

env is confusing to me too, since something like USES=python:env does not add any build dependencies at all, but USES=go:env would. That being said I would still be fine with it.

no_targets is probably the most to the point option though.

Rename build to no_targets.

dmgk marked an inline comment as done.Jun 26 2019, 1:01 PM
dmgk retitled this revision from Mk/Uses/go.mk: Add `build` and `run` args to Mk/Uses/go.mk: Add no_targets and run args.
dmgk edited the summary of this revision. (Show Details)
tobik abandoned this revision.
tobik edited reviewers, added: dmgk; removed: tobik.

Committed in rP505321.