tech-pkg archive

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

Fixing MACHINE_ARCH



Inspired by pkg/50658 and Sevan's work, I'd like to finally sort out
MACHINE_ARCH which has been causing so many issues recently.

The problem is that we currently have multiple sources of truth for
what MACHINE_ARCH is set to, and unless all of them are perfectly
aligned you will run into problems sooner or later (just ask Sevan how
many times he ran into this):

 * The bootstrap script sets it for some platforms.

 * devel/bmake then sets its own setting for some other platforms.

 * pkg_install then has its own variable for setting it

 * mk/bsd.prefs.mk then has a large logic section for each platform,
   where it is set for some of them, but not all, with a lot of
   duplication of bootstrap logic.

 * Finally, the bootstrap script sets it into mk.conf for some
   platforms which overrides the bsd.prefs.mk setting.

I have a patch to fix this and move to a single source of truth,
namely the bootstrap script.  This encodes the correct value of
MACHINE_ARCH directly into bmake during bootstrap based on the host
machine and the requested ABI, and that is then used as the single
source for this variable.

The branch with this work, and the diff is here:

  https://github.com/jsonn/pkgsrc/compare/trunk...joyent:joyent/dev/machine-arch

Append ".patch" to the URL to get a machine-readable diff.  I've
tested this on OSX and Linux in various combinations, and would like
to see testing on others.  Simply bootstrapping on your favourite
platform should suffice.

Thanks,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index