pkgsrc-Bugs archive

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

pkg/48906: bootstrap MACHINE_ARCH handling issues



>Number:         48906
>Category:       pkg
>Synopsis:       bootstrap MACHINE_ARCH handling issues
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 14 02:25:00 +0000 2014
>Originator:     David A. Holland
>Release:        pkgsrc 20140613
>Organization:
>Environment:
System: n/a
>Description:

1. The bootstrap script explicitly probes and sets MACHINE_ARCH for
all platforms except: Cygwin, Interix, OSF1, SCO_SV, and UnixWare.
This represents an odd choice of platforms to fall back to defaults
on. (If anything, these are platforms where the default is likely to
be messed up.) It should set MACHINE_ARCH for all OSes.

2. The bootstrap script does not have an option to set MACHINE_ARCH
explicitly. You can set it via --mk-fragment, but it isn't immediately
obvious if doing it this way propagates to everywhere it needs to
reach, and even if it currently does it might not in the future. There
should be an explicit option, perhaps "--build-for=arch" or something
like that.

2a. If you set MACHINE_ARCH in the environment when calling bootstrap,
it will register in some places and not others -- this should be
either explicitly supported or (my preference) ignored in favor of
explicit arguments only.

3. For most of the OSes MACHINE_ARCH is blindly set to uname output
with no crosschecking. There should be (after the big case for OS
types) a big case for MACHINE_ARCH to make sure that wrong stuff,
whether arising from user mistakes or from uname results that don't
match what we expect, fails or at least gets warned about up front.
Only known values and spellings (this includes all the arm variants)
should be accepted without question. Certain known wrong values, like
"mips", should be explicitly rejected. (I don't think it's necessary,
however, to try to maintain a list of known OS and MACHINE_ARCH
pairs. If you bootstrap for e.g. IRIX on PowerPC you deserve the
consequences.)

4. The bootstrap script uses different logic for whether it exports
MACHINE_ARCH in the environment to its subprocesses and whether it
issues a MACHINE_ARCH line into the output mk.conf. This cannot be
desirable.

5. As I understand things bmake compiles in the value of MACHINE_ARCH;
bootstrap should make sure that the value bootstrap chooses is always
the value compiled in. In this case it should never be necessary to
set MACHINE_ARCH in mk.conf. Alternatively we could always let bmake
compile in the native value that it works out for itself, always set
MACHINE_ARCH in mk.conf, and never use the compiled-in value in
pkgsrc. (Not sure which of these choices is more desirable. I don't
really like having things compiled in, though.)

6. This interacts with cross-compiling, but AIUI for cross-compiling
we set MACHINE_ARCH explicitly to the crosscompile target arch when
bootstrapping and that's that, and the changes described above make it
possible to do so tidily and have it behave predictably.

7. None of this is adequately documented.

>How-To-Repeat:
code reading

>Fix:
as above



Home | Main Index | Thread Index | Old Index