hidden dependencyproblem
Typical command sequence:
10 Install OpenSSL package.20 Build and install Mutt.30 Remove OpenSSL package./usr/pkg/bin/mutt no longer works.
What went wrong?
/usr/pkg/bin/mutt is linked against
libssl.sohidden dependencyof Mutt.
Revised command sequence:
10 Install OpenSSL package.20 Build and install Mutt.25 Register fact that Mutt depends on OpenSSL.30 Remove OpenSSL package. ERROR!Removing OpenSSL fails because Mutt depends on OpenSSL.
Problem solved, right?
No.
How do you configure Mutt to not use OpenSSL?
Teach packages to honor WITH_* and WITHOUT_*
knobs.
WITH_SSL causes various --with-ssl*
options to be passed to configure script.WITHOUT_SSL causes --without-ssl
to be passed to configure script.Major configure script options are promoted into
WITH_* and WITHOUT_* knobs.
Problems:
--without-ssl?Manipulate the environment so that the configure script only sees what we want it to see and nothing more.
--without-ssl is available or not.In either case, the Mutt configure script shouldn't see any of the OpenSSL files.
chroot is the obvious implementation.
Problems:
chroot command is not portable across every platform.The infamous buildlink:
buildlinkdirectory, e.g.
/tmp/buildlink./tmp/buildlink/lib/libreadline.so,
/tmp/buildlink/include/readline/readline.h.cc so that the compiler never looks in
/usr/pkg, only in
/tmp/buildlink.This works for all packages that are compiled.
pkgsrc has been using buildlink for over 5 years now with good success.
Benefits of buildlink over The FreeBSD Ports Way:
Simplifies package creation and maintenance.
Current implementation is mixture of make, shell, awk and sed code.
/tmp/buildlink/bin/cc,
/tmp/buildlink/bin/ld,
/tmp/buildlink/bin/cpp
shell scripts wrap calls to the actual toolchain.
-I and -L options by replacing
/usr/pkg with /tmp/buildliink.Problems with current implementation:
fork/execbuildlinkpackage.
/usr/pkg/bin/cc/usr/pkg/bin/ld/usr/pkg/bin/cppTo integrate into other packaging systems, Force using
cc, etc. in /usr/pkg/bin in place of
ones in /usr/bin.
buildlink wrappers should call gcc with
-nostdlib and -nostdinc./usr/lib.