This is part 1 to support additional platforms with the RC scripts provided in
pkgsrc, in privileged as well as in unprivileged mode, including on NetBSD
(with part 2 in pkgtools/rc.subr).
This variable is meant to point to the configuration directory of the base
system (as opposed to pkgsrc's own prefix) when it should be used by pkgsrc in
special cases (e.g. installing RC scripts), or to point to the existing
PKG_SYSCONFBASE directory otherwise (e.g. for any unprivileged bootstrap).
This teaches pkgsrc where the RC scripts should be installed, and more
importantly, where the local copy of rc.subr can be expected. Part 3 will
progressively update each and every RC script to substitute this path as
expected.
No functional changes are intended in privileged mode without a bootstrap. The
only variable affected by this change directly is RCD_SCRIPTS_DIR, which
currently remains with the same default of /etc/rc.d, and can be overridden as
before.
When bootstrapping, SYSCONFBASE also remains with the existing default when no
prefix is set or is "/usr/pkg" or "/usr"; it is set to $prefix/etc otherwise. It
can be specified specifically with --sysconfbase if necessary.
Existing installations or bootstraps are not affected, as this change needs
setting SYSCONFBASE in the corresponding $sysconfdir/mk.conf to have an impact.
Tested in privileged and unprivileged modes on NetBSD/amd64, and unprivileged
mode on Darwin/amd64; submitted for review on tech-pkg@.
From a discussion with jperkin, who tested this on bulk builds, the
remaining issues with non-BSD echo are in legacy wrappers.
Keep the workaround to use bash on Debian GNU kFreeBSD because it still
uses legacy wrappers and add a comment that that's why it's there.
Now naive usage of bootstrap on many popular Linux distros doesn't require
setting an environment variable.
can catch users out with the two --prefer options. Make the parsing
of these better by checking their argument exists and is not another
command line option.
Addresses PR#55952. Reviewed with jperkin@
A lot of patches for Elbrus 2000 have not been upstreamed, which results
in important packages such as openssl failing to build, while the native
one is quite up-to-date and working.
Tested building devel/fossil with this, which results in a fully working
binary.
It looks like lld doesn't want to statically link a libarchive without
resolving all of the symbols, even if only a few symbols are used.
In order to resolve all of the symbols, we need to also link with -lmd.
One generic way to do so is inspect Libs.private in the pkgconfig file.
While pkgsrc is likely not at fault here, having a dysfunctional bootstrap
is bad. We should check again in the future to see if this can be removed.
Actually fixes PR pkg/55400.
Tested with QNX 6.5.0SP1.
Two things were needed:
* bootstrap needs to export ACCEPT_INFERIOR_RM_PROGRAM=yes on QNX,
because libarchive checks for "rm -f" (with no arguments) working in
configure. It doesn't seem to actually use it during the build, so
this works.
* QNX.sys.mk sets LORDER to echo, but sets TSORT to tsort -q. This
results in tsort complaining about having an uneven number of inputs,
since of course there are no dependency pairs.
Hence, if LORDER is overridden to echo, TSORT also needs to be
overridden to cat. Interestingly, Linux.sys.mk also sets LORDER=echo
and TSORT=tsort -q, so it's surprising this isn't broken as well?
Avoids problems caused by linking against aging enterprise Linux libraries or
libraries from Linux package managers that undergo ABI changes outside pkgsrc
control.
Add --prefer-native flag to bootstrap script so all PREFER_* values can be
set during bootstrap. This resolves issues where bootstrap links packages
against native libraries and pkgsrc equivalents are installed afterward due
to changes to PREFER_NATIVE after bootstrap.
Automatically document danger of changing PREFER_PKGSRC or PREFER_NATIVE after
boostrap in mk.conf
Tested by @astr0baby on Twitter on Tru64 5.1B, where bootstrap fails due to
incomplete C99 support for libarchive on the host system, but after mksh has
already been built successfully.
That leaves only AIX now remaining on pdksh, so if anyone has an AIX system
and is able to test a bootstrap run it would be appreciated.
El Capitan (10.11) introduced System Integrity Protection (SIP), and one of
the side effects of this protection is that system shells (i.e. /bin/*sh)
unset any variables that may affect the security of the system. This causes
problems with packages that rely on e.g. LD_LIBRARY_PATH.
Using a shell outside of the system paths allows us to work around this, at
least for now.
Tested in bulk builds on macOS Catalina, though with SIP disabled (as there
is no way to run sandboxed builds with SIP enabled).
Over time, and as they are tested, platforms will be migrated over to
shells/mksh ($need_mksh) instead of shells/pdksh ($need_ksh) when a
bootstrap shell is required. Once mksh is selected, it takes precedence
over pdksh.
Our shells/pdksh has been unmaintained for many years and has known
issues, shells/mksh is expected to provide a portable, fast, and well
maintained alternative.
With the upcoming Big Sur release we can't assume that the major version will
always be 10. Creating a combined major and minor version number also allows
us to simplify and future-proof some tests.
Should be no functional change.
Use the kernel architecture via isainfo -k to base our default on, as uname
will always return the same result regardless. Ensures we default to 64-bit
pkgsrc on amd64, as well as adding support for sparcv9.
Fixes issue seen bootstrapping on Solaris 9 when bash is available and being
used for SH, bmake was still defaulting to /usr/xpg4/bin/sh which dumps core
with some of the mk/check infrastructure.
Note this is only for the bmake used during the initial bootstrap, the final
bmake package will still use the defshell logic in its Makefile.
Move sanitfy check for absolute path of $prefix at a place where we are
sure it has been defined to avoid that a bootstrap can be built in a path
containing symbolic link when --prefix is not specified and default $prefix
is set.
This runs the echo command with fewer arguments (1 in most cases).
The observable behavior is still the same, except for directory names
containing spaces, which are not supported anyway.
Without this check, bootstrap will fail later when it builds
bootstrap-mk-files in the usual pkgsrc way. There is an additional check
in bsd.pkg.mk which then fails. Therefore, better fail fast to save some
time.
The working directory is only needed for bootstrapping pkgsrc, therefore
there aren't too many packages that can fail.
Loosening this check is needed for macOS, where /etc, /tmp and /var are
symlinks to /private, and using /tmp as the workdir for bootstrapping is
a sane choice.
libarchive 3.3.3:
Avoid super-linear slowdown on malformed mtree files
Many fixes for building with Visual Studio
NO_OVERWRITE doesn't change existing directory attributes
New support for Zstandard read and write filters
Running bootstrap with short options (like -q for --quiet) is not
implemented. Therefore, instead of silently ignoring such options, fail
with an appropriate error message.
If not, set _OPSYS_SUPPORTS_SSP=no during bootstrap and in mk.conf.
Do SSP detection on "SunOS", and let mk/platform/SunOS.mk's default
"yes" be overridden in mk.conf.
No change to generated mk.conf on NetBSD 8 or CentOS 6. Fixes bootstrap
on Tribblix.
* Put indentation right to follow the existing style
* Correct wrong justification for need of pax on Arch: pax (and not PaX) is
only provided throw https://aur.archlinux.org/packages/pax/ and get low
support (currently broken)
This avoids errors when running from a read-only pkgsrc checkout as the
resulting packages cannot be written to the default PACKAGES directory. The
binary packages aren't useful anyway, as they are often built with reduced
configuration options due to the limited bootstrap environment.
Fixes issue reported by Julien Savard and others.