tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: TOOL_DEPENDS vs. BUILD_DEPENDS



> Date: Tue, 22 Nov 2022 11:34:14 +0100
> From: Thomas Klausner <wiz%NetBSD.org@localhost>
> 
> Do I understand this correctly:
> 
> The difference between TOOL_DEPENDS and BUILD_DEPENDS only matters
> when you are cross-building packages for a different architecture.
> 
> TOOL_DEPENDS are programs that need to be run on the build system when
> building the package. So they must match the architecture of the
> system on which the package is built.
> 
> BUILD_DEPENDS are dependencies that are only needed at build time, but
> must match the architecture of the target system (not the build system).

Correct.  And TOOL_DEPENDS is installed in the host's destdir so it
appears in $PATH, while BUILD_DEPENDS is installed in the target's
destdir so is picked up by toolchain components via --sysroot.

> I think pkgsrc mostly uses BUILD_DEPENDS since cross-building was only
> added later and before that, there was no difference between the too.
> 
> In general, most BUILD_DEPENDS should probably be TOOL_DEPENDS
> instead. I can't think of a good example for a BUILD_DEPENDS, but
> there must be one, somewhere :)
> 
> Is this correct?

Yes.

> What are good examples for BUILD_DEPENDS?

Mostly BUILD_DEPENDS is created by mk/buildlink3.  I'm not sure there
are any correct uses of BUILD_DEPENDS outside mk/buildlink3.  In
retrospect, perhaps I should have renamed that one BUILDLINK_DEPENDS,
and changed the semantics of BUILD_DEPENDS to be what TOOL_DEPENDS is
now.  But at the time I was reluctant to make changes to that
infrastructure so I created a new name instead for the part I was
working on, cross-compilation.


Home | Main Index | Thread Index | Old Index