tech-pkg archive

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

Re: RFC: distbb for cross-compiling packages

Aleksey Cheusov <> writes:

> Let me repeat one fragment from the typescript. After applying my patch
> BUILD_DEPENDS and TARGET_BUILD_DEPENDS are set like the following
> when USE_CROSS_COMPILE is set to YES.
> ======================================================================
> 0 xdm>export _GCC_VERSION=4.5.3 USE_CROSS_COMPILE=yes
> 0 xdm>make clean
> ===> Cleaning for xdm-1.1.11
> 0 xdm>pkg_src_summary -f \
>       x11/xdm | pkg_summary4view
> -----------------------------------------------------------
> PKGNAME:        xdm-1.1.11
> PKGPATH:        x11/xdm
> BUILD_DEPENDS:  checkperms>=1.1:../../sysutils/checkperms
>                 libtool-base>=2.2.6bnb3:../../devel/libtool-base
>                 pkg-config>=0.19:../../devel/pkg-config
> TARGET_BUILD_DEPENDS:inputproto>=1.4:../../x11/inputproto
>                 kbproto>=1.0.2:../../x11/kbproto
>                 renderproto>=0.9.3nb1:../../x11/renderproto
>                 renderproto>=0.9:../../x11/renderproto
>                 xcb-proto>=1.4:../../x11/xcb-proto
>                 xextproto>=7.0:../../x11/xextproto
>                 xineramaproto>=1.1.1:../../x11/xineramaproto
>                 xproto>=7.0.9:../../x11/xproto

That makes perfect sense.

My only remaining point is that I think it should be


instead, because "a depends on b" is naturally about target dependencies
and exceptional when it's a build tool.   In the NetBSD base system, we
have nbfoo for the build-host tools, and regular dependencies in
makefiles for the target dependencies.

And, I still don't understand why *proto above isn't bl3 instead of

> 0 0 xdm>make /tmp/obj-pkgsrc/x11/xdm/work/.depends
> 0 xdm>cat /tmp/obj-pkgsrc/x11/xdm/work/.depends
> bootstrap       digest>=20010302        ../../pkgtools/digest
> build   kbproto>=1.0.2  ../../x11/kbproto
> build   xproto>=7.0.9   ../../x11/xproto
> build   xcb-proto>=1.4  ../../x11/xcb-proto
> build   xextproto>=7.0  ../../x11/xextproto
> build   inputproto>=1.4 ../../x11/inputproto
> build   renderproto>=0.9.3nb1   ../../x11/renderproto
> build   xineramaproto>=1.1.1    ../../x11/xineramaproto
> full    sessreg-[0-9]*  ../../x11/sessreg
> full    libXaw>=1.0.5   ../../x11/libXaw
> full    libXmu>=1.0.0   ../../x11/libXmu
> full    libXft>=2.1.14nb1       ../../x11/libXft
> full    libXinerama>=1.0.1      ../../x11/libXinerama
> 0 xdm>

So that makes sense, to have them listed as build there, where that
implies target packages.

Presumably USE_TOOLS causes a different kind of dependency, where the
tools have to be installed on the build host, but it's not a dependency
of the package at all.

> Result:
>   - BUILD_DEPENDS contains only build host dependencies

It's still my view that these are bugs that should be in USE_TOOLS,
similar to how when we need a utility in the base system we either
depend on the native one or add a new nbfoo.

>   - TARGET_BUILD_DEPENDS contains target dependencies only (headers).
>   - "depends" target doesn't require build host packages (checkperms,
>     libtool-base and pkg-config) anymore.

I agree that this is the right behavior (and just differ on naming).

> This is exactly what is required by cross-build tools.
>>   th      BUILD_DEPENDS:  checkperms>=1.1:../../sysutils/checkperms
>>   BH                      inputproto>=1.4:../../x11/inputproto
>>   BH                      kbproto>=1.0.2:../../x11/kbproto
>>   th                      libtool-base>=2.2.6bnb3:../../devel/libtool-base
>>   th                      pkg-config>=0.19:../../devel/pkg-config
>>   BH                      renderproto>=0.9.3nb1:../../x11/renderproto
>>   BH                      renderproto>=0.9:../../x11/renderproto
>>   BH                      xcb-proto>=1.4:../../x11/xcb-proto
>>   BH                      xextproto>=7.0:../../x11/xextproto
>>   BH                      xineramaproto>=1.1.1:../../x11/xineramaproto
>>   BH                      xproto>=7.0.9:../../x11/xproto
>> The rest, *proto, are .h files that should be present in the target
>> destdir, and should be "th".
> I apologize. I really swapped "BH" and "th" by mistake. I'm sorry for that.

No worries - now I understand.

So, what do you and others think about the notion that any use of
BUILD_DEPENDS is (almost) intrinsicially a bug, and should be replaced
by bl3 (for target dependencies) or USE_TOOLS.

Actually, I'll go farther and say that BUILD_DEPENDS as a target
dependency that isn't reasonably expressed as bl3 on packages containing
headers or the functional equivalent also is a bug.  In particular, the
use of BUILD_DEPENDS to list perl packages that are needed to run tests
seems fishy.

Attachment: pgpzVuRz6bY9w.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index