pkgsrc-Users archive

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

Re: infer GCC_REQD from USE_LANGUAGES



On Sun, 6 Jan 2019 at 14:02, Jason Bacon <outpaddling%yahoo.com@localhost> wrote:
>
> On 1/6/19 5:16 AM, Benny Siegert wrote:
> > On Sun, Jan 6, 2019 at 2:00 AM Joerg Sonnenberger <joerg%bec.de@localhost> wrote:
> >> Mixing GCC versions doesn't work well. That's exactly what you end up
> >> with when non-leaf packages start to randomly require higher versions.
> >> The only reasonable solution is to actually just require a version
> >> that's new enough for your package set up front and stick with it.
> > What can the pksrc infrastructure do to help the user picking a
> > new-enough version?
> >
> What I've settled on is setting a minimum GCC_REQD in each package I
> maintain and an equal or higher GCC_REQD for everything (except GCC and
> its deps) in mk.conf.
>
> As you may know, GCC_REQD is actually a list from which pkgsrc chooses
> the highest version.  So, setting GCC_REQD in mk.conf at least as high
> as the highest requirement of all the packages you need ensures a
> consistent tool chain.
>
> Here is a basic config for my CentOS systems:
>
> Linux login.avi bacon ~ 993: more /usr/pkg/etc/mk.conf
> # Example /usr/pkg/etc/mk.conf file produced by bootstrap-pkgsrc
> # Wed Oct 24 13:00:27 CDT 2018
>
> .ifdef BSD_PKG_MK    # begin pkgsrc settings
>
> ABI=            64
>
> PKG_DBDIR=        /usr/pkg/pkgdb
> LOCALBASE=        /usr/pkg
> VARBASE=        /usr/pkg/var
> PKG_TOOLS_BIN=        /usr/pkg/sbin
> PKGINFODIR=        info
> PKGMANDIR=        man
>
>
> .endif            # end pkgsrc settings
>
> X11_TYPE=        modular
> PREFER_NATIVE=        no
> PREFER_PKGSRC=        yes
> PKGSRC_FORTRAN=        gfortran
> PKG_DEVELOPER=        yes
> FETCH_USING=        curl
> SKIP_LICENSE_CHECK=    yes
> PKG_OPTIONS.libfetch=    inet6 openssl
>
> .if     empty(PKGPATH:Marchivers/bzip2) && \
>      empty(PKGPATH:Marchivers/pax) && \
>      empty(PKGPATH:Marchivers/xz) && \
>      empty(PKGPATH:Mconverters/help2man) && \
>      empty(PKGPATH:Mconverters/libiconv) && \
>      empty(PKGPATH:Mconverters/p5-Unicode-EastAsianWidth) && \
>      empty(PKGPATH:Mdevel/autoconf) && \
>      empty(PKGPATH:Mdevel/binutils) && \
>      empty(PKGPATH:Mdevel/gettext-lib) && \
>      empty(PKGPATH:Mdevel/gettext-tools) && \
>      empty(PKGPATH:Mdevel/gmake) && \
>      empty(PKGPATH:Mdevel/gmp) && \
>      empty(PKGPATH:Mdevel/gtexinfo) && \
>      empty(PKGPATH:Mdevel/pkgconf) && \
>      empty(PKGPATH:Mdevel/libtool-base) && \
>      empty(PKGPATH:Mdevel/m4) && \
>      empty(PKGPATH:Mdevel/ncurses) && \
>      empty(PKGPATH:Mdevel/nbpatch) && \
>      empty(PKGPATH:Mdevel/p5-gettext) && \
>      empty(PKGPATH:Mlang/gcc6) && \
>      empty(PKGPATH:Mlang/gcc6-libs) && \
>      empty(PKGPATH:Mlang/perl5) && \
>      empty(PKGPATH:Mmath/cloog) && \
>      empty(PKGPATH:Mmath/isl) && \
>      empty(PKGPATH:Mmath/mpcomplex) && \
>      empty(PKGPATH:Mmath/mpfr) && \
>      empty(PKGPATH:Mmisc/p5-Locale-libintl) && \
>      empty(PKGPATH:Mnet/libfetch) && \
>      empty(PKGPATH:Mpkgtools/cwrappers) && \
>      empty(PKGPATH:Mpkgtools/digest) && \
>      empty(PKGPATH:Mpkgtools/pkg_install-info) && \
>      empty(PKGPATH:Mpkgtools/pkgin) && \
>      empty(PKGPATH:Msysutils/checkperms) && \
>      empty(PKGPATH:Mtextproc/gsed) && \
>      empty(PKGPATH:Mtextproc/p5-Text-Unidecode)
>
> GCC_REQD+=6.0
>
> .endif  # GCC_REQD
>
> # RHEL systems may have an outdated "as" that cannot translate instructions
> # from current GCC code generators, so force pkgsrc binutils.
> .if exists(/etc/redhat-release) && !empty(PKGPATH:Mlang/gcc*)
> CONFIGURE_ARGS+=        --with-gnu-as --with-as=${PREFIX}/bin/gas
> CONFIGURE_ARGS+=        --with-gnu-ld --with-ld=${PREFIX}/bin/gld
> BUILDLINK_DEPMETHOD.binutils=   full
> .  include "../../devel/binutils/buildlink3.mk"
> .endif

I've been doing something similar on NetBSD-8 (since I have to build
gcc6 anyway for Firefox I thought it made sense to try to build the
rest of the packages with it).

Leaving X11_TYPE at the default native caused quite a few x11 programs
to fail horribly at runtime (presumably due to mixing base
libstdc++.so.8 with pkgsrc gcc), so I needed to set it to modular.

With that everything I needed worked, *except* openjdk8 which choked
with an Abort trap, however there are additional runtime path
complexities there with the initial compile using prebuilt binaries
that need to override LD_LIBRARY_PATH, then the stage2 compile needing
to not have LD_LIBRARY_PATH overridden to pickup the pkgsrc gcc's libs
and just using simple wrappers for the initial compile chokes as java
really wants to know form where its running. Essentially I need an
evening free to have some digging :)

For reference my config is below (I have BASE_COMPILER_PKGPATHS_GCC7
and BASE_COMPILER_PKGPATHS_GCC8 but they are very much more WIP :)

  BASE_COMPILER_PKGPATHS_GCC6=\
    \
    lang/gcc6 \
    pkgtools/digest \
    pkgtools/cwrappers \
    sysutils/checkperms \
    \
    devel/gmake \
    lang/perl5 \
    textproc/gsed \
    \
    lang/openjdk8 \

  X11_TYPE=modular
  BASE_COMPILER_PKGPATHS=${BASE_COMPILER_PKGPATHS_GCC6}
. if empty(BASE_COMPILER_PKGPATHS:M${PKGPATH})
    GCC_REQD+=6
. else
    GCC_BUILD=true
. endif

I was wondering if there was a simple way to automate the
determination all this handling of PKG_PATHs to exclude for GCC_REQD:
maybe one of

- a command you could run from lang/gccX which would trawl through all
dependencies and generate a list
- setting and propagating a make variable when a build is started in
lang/gccX which would cause any required packages to skip the GCC_REQD
settings. This would require building gcc first, and could be fiddly
in pkgrc updates
- a well defined way to build just the compiler (and needed tools)
with a prefix like /usr/pkg-build, which is then used to build the
main tree

Thanks

David


Home | Main Index | Thread Index | Old Index