Commit graph

300 commits

Author SHA1 Message Date
khorben
727ba708e4 Introduce a new SYSCONFBASE variable (defaults to /etc)
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@.
2021-05-30 23:41:05 +00:00
maya
a3734b24bd Don't reject dash as /bin/sh.
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.
2021-04-28 11:14:51 +00:00
ryoon
db93e5dcb0 bootstrap: Add MidnightBSD support to bootstrap shell script 2021-03-15 16:22:06 +00:00
cjep
0a2c636f19 In the process of looking at PR#55952, we discovered something that
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@
2021-02-15 12:56:53 +00:00
js
aca1caebd8 bootstrap: Prefer native on Elbrus 2000
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.
2020-12-05 16:50:52 +00:00
maya
aa26c432dd Bootstrap: Fix bootstrap on FreeBSD 12.1, likely broken by an issue in lld.
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.
2020-10-28 16:52:43 +00:00
jperkin
0ce8ac1477 bootstrap: Fix numerical calculation on Big Sur. 2020-10-07 10:44:14 +00:00
js
d224d1e96f Fix bootstrap on QNX
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?
2020-08-29 20:11:21 +00:00
bacon
ec632c0843 bootstrap: Default to PREFER_PKGSRC=yes on Linux
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
2020-08-20 13:04:01 +00:00
jperkin
0b9fe9575a bootstrap: No need to find packagemaker any longer. 2020-08-14 08:45:30 +00:00
schmonz
7378495b05 Retire --binary-macpkg option, which would generate a binary pkgsrc
bootstrap kit for macOS in the form of a double-clickable .pkg.
2020-08-14 07:24:16 +00:00
sjmulder
7f3992708d bootstrap: Fix machine_arch detection on Apple Sillicon
machine_arch was empty on Apple Sillicon. We could also use `uname -m` but that
returns arm64 which is not accepted by mk/gnu-config/config.sub.
2020-07-21 15:53:10 +00:00
jperkin
be1e3f78ff bootstrap: Switch OSF1 to mksh.
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.
2020-07-15 10:32:12 +00:00
jperkin
c86754145b bootstrap: Switch --full over to mksh. 2020-07-07 11:50:04 +00:00
jperkin
9200b8a227 boostrap: Enable mksh by default on macOS 10.11+.
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).
2020-07-06 10:43:47 +00:00
jperkin
5dba98583a bootstrap: Switch SunOS to mksh.
Tested in a bulk build on SmartOS, and bootstrap tested on Solaris 9.
2020-07-06 10:25:29 +00:00
jperkin
800925fe24 bootstrap: Enable support for building mksh.
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.
2020-07-06 10:21:01 +00:00
jperkin
e9427ff4b2 bootstrap: Overhaul Darwin version selection.
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.
2020-06-29 12:38:03 +00:00
jperkin
b0ba1c9419 bootstrap: Set some default variables.
Saves having to duplicate them for every OS, and also removes some obsolete
settings, should be no functional change.
2020-06-29 12:01:38 +00:00
jperkin
111bcd3ffd bootstrap: Fix default target arch on SunOS.
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.
2020-05-30 21:36:15 +00:00
jperkin
038325578c bootstrap: Consolidate setting of CC if unset.
Should fix issue seen on IRIX where --compiler was specified but CC was not
passed to bootstrap, resulting in "gcc" being picked as the default.
2020-05-25 07:32:59 +00:00
jperkin
1c31b13f70 bootstrap: Use SH for bmake if specified.
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.
2020-05-06 15:34:31 +00:00
triaxx
a50f71f0f3 bootstrap: fix PR pkg/55217
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.
2020-04-29 20:27:03 +00:00
nia
6c8ef55de3 bootstrap: Allow overriding EGREP/FGREP.
Makes bootstrapping on minimal Linux systems that don't include these
binaries in a normal location less broken.

from Michael Forney
2020-03-26 15:30:27 +00:00
rillig
d1232083f8 bootstrap: create the binary packages before the summary message
It's strange to see the summary before all the actual work is done.
2020-03-22 16:40:19 +00:00
rillig
8c8a1eeaba bootstrap: remove unused BOOTSTRAP_VERSION variable
It had not been updated between 2006 and 2019, and there is no apparent
benefit of having this version number.
2020-03-22 16:34:46 +00:00
rillig
9e159c6bfe bootstrap: use $* instead of $@ where appropriate
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.
2020-02-23 18:32:46 +00:00
sevan
863d545b7b Skip trying to make use of a 64bit ABI on Darwin as the system libraries on
Tiger lack support and it doesn't work out too great on Leopard either, though
it's much better than the former release.
2019-12-05 22:19:56 +00:00
triaxx
f91c2c26b7 boostrap: need_awk=yes for Arch Linux
Arch uses GNU Awk 5 that breaks some regexps.
2019-11-05 13:58:06 +00:00
rillig
1474c11ffb bootstrap/bootstrap: prevent --wrkdir from being a symlink
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.
2019-09-13 20:10:35 +00:00
rillig
5605d45593 bootstrap/bootstrap: fix word wrapping in symlink error message
When $2 is expanded, it is longer than 2 characters, which leaded to an
ugly line break.
2019-09-13 19:53:03 +00:00
rillig
cc59fe8b6b bootstrap/bootstrap: fix bootstrap on Solaris 10
Fixes pkg/54349.
2019-07-21 20:14:06 +00:00
sevan
f99d86c003 libarchive no longer has a without-lzmadec option 2019-07-08 19:44:08 +00:00
rillig
23afdbe9b9 bootstrap/bootstrap: allow the working directory to be a symlink
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.
2019-07-02 16:27:04 +00:00
jperkin
7bb25ca970 bootstrap: Enable sed on Cygwin by default.
Michael Dexter reported that the native Cygwin sed is unable to correctly
build libtool.  Switching to nbsed solved the issue.
2019-06-20 09:11:26 +00:00
rillig
cdd45d3d5c bootstrap: fix endless when checking nonexisting directory
./bootstrap --prefix=/nonexisting had run into an endless loop.
2019-05-07 19:54:46 +00:00
jperkin
fc30af8caa bootstrap: Invert the awk/sed test on Darwin.
This stops us having to continue to add new macOS releases, it appears
that Apple is not going to fix this issue any time soon.
2019-05-03 13:26:34 +00:00
rillig
b25f3a40b4 bootstrap: prevent pkgsrcdir, prefix and wrkdir from being symlinks 2019-05-01 18:29:20 +00:00
adam
eae608d908 libarchive: updated to 3.3.3
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
2019-04-10 08:24:03 +00:00
triaxx
68e4a61489 set $CC when clang is detected in bootstrap
The commit in pkgsrc-2018Q4 is due to a mistake.

Sorry :(
2019-02-06 17:38:54 +00:00
sevan
07b8418439 Update the root_group for Minix to match the changes to mk files.
Head up by <leot>
2018-11-15 22:08:30 +00:00
rillig
8279aa9744 bootstrap/bootstrap: detect unknown options and print usage
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.
2018-11-11 19:31:54 +00:00
jperkin
6baaeb9379 bootstrap: Ensure CC is considered for SSP tests. 2018-11-09 13:37:09 +00:00
schmonz
c4f430b744 Optionally detect whether the compiler supports "-fstack-protector-strong".
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.
2018-11-05 19:26:38 +00:00
sevan
f94c4766af Minix 3.4RC6 includes install(1) from NetBSD. 2018-10-30 15:22:53 +00:00
triaxx
2cd43afe22 Fix commit v 1.254
* 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)
2018-10-29 17:41:35 +00:00
triaxx
dfba945451 Arch Linux does not provide pax anymore
https://lists.archlinux.org/pipermail/arch-general/2017-April/043604.html
2018-10-29 15:16:32 +00:00
sevan
0a5a21105a libcompat_minix was removed some years back and minlib does not exist as a
linkable library in 3.4RC6 so don't try to link against these.
2018-10-28 18:41:41 +00:00
sevan
a26e1226e0 Minix/arm currently ships with GCC but the i386 build ships with clang so check
the compiler.
2018-10-28 16:59:00 +00:00
jperkin
dba7653756 bootstrap: Set PKGSRC_KEEP_BIN_PKGS=no during bootstrap.
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.
2018-10-17 11:12:46 +00:00