tech-pkg archive

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

Re: RFC: distbb for cross-compiling packages



> A few comments on the separation between
> build-host and target-host dependencies.

> ///
>         PKGNAME:        dict-mueller7-1.2
>         PKGPATH:        textproc/dict-mueller7
> th      BUILD_DEPENDS:  checkperms>=1.1:../../sysutils/checkperms
> th                      coreutils-[0-9]*:../../sysutils/coreutils
> th                      dict-server>=1.10.2:../../textproc/dict-server
> th                      
> p5-Unicode-Map8-[0-9]*:../../converters/p5-Unicode-Map8
> th                      perl>=5.0:../../lang/perl5

> ///
>         PKGNAME:        xdm-1.1.11
>         PKGPATH:        x11/xdm
> 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

> "th" means target-host dependency, "BH" -- build host dependency.
> I know the difference, pkgsrc doesn't.

Replying to myself. The patch in the attachment solves the above problem.

What it does:
- If USE_CROSS_COMPILE is *not* YES, nothing is changed,
  BUILD_DEPENDS contains both build-platform and target-platform dependencies.
  A behaviour of the target "depends" is also not changed.
- If USE_CROSS_COMPILE is YES,
  BUILD_DEPENDS contains build platform dependencies only, and
  TARGET_BUILD_DEPENDS contains target platform dependencies only.
  The target "depends" requires installed packages listed
  in TARGET_BUILD_DEPENDS only.

See the typescript below and the correct dependency graph for
textproc/dict-mueller7 package here

http://mova.org/~cheusov/priv/depgraph.png.

It doesn't contain target-platform perl anymore. 

BTW, I adapted distbb to use this new TARGET_BUILD_DEPENDS variable
and repeated cross-test3 partial bulk build.
Here are results: 

http://mova.org/~cheusov/pub/pkgsrc-distbb/NetBSD-sparc64/current/logs/cross-test3p1/META/report.html

As you can see a few new packages were successfully built (devel/libidn,
www/curl, net/wget) because
incorrect dependencies that failed to build do not have any affect on
these packages anymore.
http://mova.org/~cheusov/pub/pkgsrc-distbb/NetBSD-sparc64/current/logs/cross-test3/net_wget_wget-1.13.4nb1/info.html
http://mova.org/~cheusov/pub/pkgsrc-distbb/NetBSD-sparc64/current/logs/cross-test3/www_curl_curl-7.21.7/info.html
http://mova.org/~cheusov/pub/pkgsrc-distbb/NetBSD-sparc64/current/logs/cross-test3/devel_libidn_libidn-1.22/info.html

Opinions?

P.S.
Today I accidentally found the following
http://wiki.netbsd.org/projects/project/cross_nb_pkgsrc/
   Contact: tech-pkg

===========================================================================

0 xdm>pkg_src_summary -f \
      PKGNAME,PKGPATH,BUILD_DEPENDS,TARGET_BUILD_DEPENDS \
      x11/xdm textproc/dict-mueller7 | pkg_summary4view
-----------------------------------------------------------
PKGNAME:        xdm-1.1.11
PKGPATH:        x11/xdm
BUILD_DEPENDS:  checkperms>=1.1:../../sysutils/checkperms
                inputproto>=1.4:../../x11/inputproto
                kbproto>=1.0.2:../../x11/kbproto
                libtool-base>=2.2.6bnb3:../../devel/libtool-base
                pkg-config>=0.19:../../devel/pkg-config
                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

-----------------------------------------------------------
PKGNAME:        dict-mueller7-1.2
PKGPATH:        textproc/dict-mueller7
BUILD_DEPENDS:  checkperms>=1.1:../../sysutils/checkperms
                coreutils-[0-9]*:../../sysutils/coreutils
                dict-server>=1.10.2:../../textproc/dict-server
                p5-Unicode-Map8-[0-9]*:../../converters/p5-Unicode-Map8
                perl>=5.0:../../lang/perl5


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   libtool-base>=2.2.6bnb3 ../../devel/libtool-base
build   pkg-config>=0.19        ../../devel/pkg-config
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
build   checkperms>=1.1 ../../sysutils/checkperms
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>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 \
      PKGNAME,PKGPATH,BUILD_DEPENDS,TARGET_BUILD_DEPENDS \
      x11/xdm textproc/dict-mueller7 | 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

-----------------------------------------------------------
PKGNAME:        dict-mueller7-1.2
PKGPATH:        textproc/dict-mueller7
BUILD_DEPENDS:  checkperms>=1.1:../../sysutils/checkperms
                coreutils-[0-9]*:../../sysutils/coreutils
                dict-server>=1.10.2:../../textproc/dict-server
                p5-Unicode-Map8-[0-9]*:../../converters/p5-Unicode-Map8
                perl>=5.0:../../lang/perl5


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>

Index: mk/bsd.utils.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.utils.mk,v
retrieving revision 1.9
diff -u -r1.9 bsd.utils.mk
--- mk/bsd.utils.mk     8 Sep 2011 20:17:15 -0000       1.9
+++ mk/bsd.utils.mk     18 Nov 2011 21:50:20 -0000
@@ -10,7 +10,7 @@
 #
 DEPENDS_TYPE?=  all
 .if !empty(DEPENDS_TYPE:Mbuild) || !empty(DEPENDS_TYPE:Mall)
-_ALL_DEPENDS+= ${BOOTSTRAP_DEPENDS} ${BUILD_DEPENDS}
+_ALL_DEPENDS+= ${BOOTSTRAP_DEPENDS} ${_REAL_BUILD_DEPENDS}
 .endif
 .if !empty(DEPENDS_TYPE:Minstall) || !empty(DEPENDS_TYPE:Mpackage) || \
     !empty(DEPENDS_TYPE:Mall)
Index: mk/buildlink3/bsd.buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink3/bsd.buildlink3.mk,v
retrieving revision 1.209
diff -u -r1.209 bsd.buildlink3.mk
--- mk/buildlink3/bsd.buildlink3.mk     3 Dec 2010 18:59:20 -0000       1.209
+++ mk/buildlink3/bsd.buildlink3.mk     18 Nov 2011 21:50:20 -0000
@@ -222,7 +222,11 @@
 .endfor
 .for _depmethod_ in DEPENDS BUILD_DEPENDS ABI_DEPENDS BUILD_ABI_DEPENDS
 .  if !empty(_BLNK_ADD_TO.${_depmethod_})
+.if !empty(USE_CROSS_COMPILE:M[Yy][Ee][Ss]) && ${_depmethod_} == 
"BUILD_DEPENDS"
+TARGET_${_depmethod_}+=        ${_BLNK_ADD_TO.${_depmethod_}}
+.else
 ${_depmethod_}+=       ${_BLNK_ADD_TO.${_depmethod_}}
+.endif
 .  endif
 .endfor        # _BLNK_DEPENDS
 
Index: mk/pkgformat/pkg/depends.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/pkgformat/pkg/depends.mk,v
retrieving revision 1.1
diff -u -r1.1 depends.mk
--- mk/pkgformat/pkg/depends.mk 15 Oct 2011 00:23:09 -0000      1.1
+++ mk/pkgformat/pkg/depends.mk 18 Nov 2011 21:50:20 -0000
@@ -38,12 +38,17 @@
        DEPENDS|*)      ${_REDUCE_DEPENDS_CMD} ${DEPENDS:Q} ;;          \
        esac
 
+.if !empty(USE_CROSS_COMPILE:M[Yy][Ee][Ss])
+_REAL_BUILD_DEPENDS=${TARGET_BUILD_DEPENDS}
+.else
+_REAL_BUILD_DEPENDS=${BUILD_DEPENDS}
+.endif
 _LIST_DEPENDS_CMD=     \
        ${PKGSRC_SETENV} AWK=${AWK:Q} PKG_ADMIN=${PKG_ADMIN:Q} \
                PKGSRCDIR=${PKGSRCDIR:Q} PWD_CMD=${PWD_CMD:Q} SED=${SED:Q} \
                ${SH} ${PKGSRCDIR}/mk/pkgformat/pkg/list-dependencies \
                        " "${BOOTSTRAP_DEPENDS:Q} \
-                       " "${BUILD_DEPENDS:Q} \
+                       " "${_REAL_BUILD_DEPENDS:Q} \
                        " "${DEPENDS:Q}
 
 _LIST_DEPENDS_CMD.bootstrap=   \

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index