Tue Mar 18 01:28:26 2014 UTC ()
Explain problems with sed.

Basically: 10.9's sed is broken, bootstrap works around this via nbsed
on 10.9, and therefore while a 10.6 boostrap's binaries will *run* on
10.9, one can't reliably build new packages.

(Thanks to jperkin@ for pointing this out.)


(gdt)
diff -r1.16 -r1.17 pkgsrc/bootstrap/README.MacOSX

cvs diff -r1.16 -r1.17 pkgsrc/bootstrap/Attic/README.MacOSX (expand / switch to unified diff)

--- pkgsrc/bootstrap/Attic/README.MacOSX 2014/03/17 17:12:58 1.16
+++ pkgsrc/bootstrap/Attic/README.MacOSX 2014/03/18 01:28:26 1.17
@@ -1,44 +1,52 @@ @@ -1,44 +1,52 @@
1$NetBSD: README.MacOSX,v 1.16 2014/03/17 17:12:58 gdt Exp $ 1$NetBSD: README.MacOSX,v 1.17 2014/03/18 01:28:26 gdt Exp $
2 2
3* gcc vs clang 3* system tools issues
 4
 5** gcc vs clang
4 6
5Older versions of Mac OS X (with XCode, of course) provided gcc, and 7Older versions of Mac OS X (with XCode, of course) provided gcc, and
6pkgsrc defaulted to using gcc. With 10.9, gcc is no longer present 8pkgsrc defaulted to using gcc. With 10.9, gcc is no longer present
7and one must bootstrap with "--compiler=clang". (Arguably, pkgsrc 9and one must bootstrap with "--compiler=clang". (Arguably, pkgsrc
8should default to clang on 10.9.) 10should default to clang on 10.9.)
9 11
10* i386 vs x86_64 ABI issue 12** i386 vs x86_64 ABI issue
11 13
12Mac OS X Snow Leopard (10.6) through Mavericks (10.9) supports 64-bit 14Mac OS X Snow Leopard (10.6) through Mavericks (10.9) supports 64-bit
13binaries on most Intel Macs and build those by default on such 15binaries on most Intel Macs and build those by default on such
14machine. This has caused problems with packages which get confused 16machine. This has caused problems with packages which get confused
15because "MACHINE_ARCH" is in some OS versions set to "i386" (on a 17because "MACHINE_ARCH" is in some OS versions set to "i386" (on a
1664-bit system!). 1864-bit system!).
17 version: uname -m : uname -p 19 version: uname -m : uname -p
18 10.6: i386 : i386 20 10.6: i386 : i386
19 10.9: x86_64 : i386 21 10.9: x86_64 : i386
20 22
21There are of course some packages which will fail in i386 mode, and 23There are of course some packages which will fail in i386 mode, and
22some in x86_64 mode. Because of all this, the default for pkgsrc was 24some in x86_64 mode. Because of all this, the default for pkgsrc was
23set to use the 32-bit ABI, which results in packages being compiled 25set to use the 32-bit ABI, which results in packages being compiled
24and run in i386 mode. In addition, there are some Intel Macs (older 26and run in i386 mode. In addition, there are some Intel Macs (older
25Mac Minis) which can only run i386 and not x86_64. For a longer 27Mac Minis) which can only run i386 and not x86_64. For a longer
26discussion, see: 28discussion, see:
27http://mail-index.NetBSD.org/pkgsrc-users/2009/09/24/msg010817.html 29http://mail-index.NetBSD.org/pkgsrc-users/2009/09/24/msg010817.html
28 30
29As of 2014, the decision to default to i386 should probably be 31As of 2014, the decision to default to i386 should probably be
30revisited. 32revisited.
31 33
 34** sed in 10.9
 35
 36The sed that comes with 10.9 appears to be broken; it exits when
 37called on files with UTF-8 or other apparently-binary content.
 38Therefore, pkgsrc uses nbsed on 10.9.
 39
32* Developer tools and prerequisites 40* Developer tools and prerequisites
33 41
34** basic tools 42** basic tools
35 43
36If you haven't already, you will need to install the Mac OS X 44If you haven't already, you will need to install the Mac OS X
37Developer Tools package (XCode) to obtain a compiler, etc. The 45Developer Tools package (XCode) to obtain a compiler, etc. The
38procedure depends on the version of Mac OS X; recent versions use the 46procedure depends on the version of Mac OS X; recent versions use the
39App Store. 47App Store.
40 48
41Note that as of 10.9, cvs is no longer provided. You can build 49Note that as of 10.9, cvs is no longer provided. You can build
42devel/scmcvs. To obtain pkgsrc in order to bootstrap and build cvs, 50devel/scmcvs. To obtain pkgsrc in order to bootstrap and build cvs,
43it may be useful to use git to clone https://github.com/jsonn/pkgsrc 51it may be useful to use git to clone https://github.com/jsonn/pkgsrc
44 52
@@ -123,24 +131,32 @@ Mac OS X as follows: @@ -123,24 +131,32 @@ Mac OS X as follows:
123 131
124Because Apple provides 10.9 as a no-cost upgrade (from 10.6 or higher, 132Because Apple provides 10.9 as a no-cost upgrade (from 10.6 or higher,
125it is fairly likely that 10.6-10.8 will become DEPRECATED faster than 133it is fairly likely that 10.6-10.8 will become DEPRECATED faster than
126they might have otherwise. (The rationale for supporting versions 134they might have otherwise. (The rationale for supporting versions
127beyond the current and previous ones has been the difficulty for users 135beyond the current and previous ones has been the difficulty for users
128to upgrade.) 136to upgrade.)
129 137
130* Bulk build suggestions and issues 138* Bulk build suggestions and issues
131 139
132Clearly, it is desirable for a bulk build to be useful on as many 140Clearly, it is desirable for a bulk build to be useful on as many
133computers as possible. The main issues are which ABI and which OS X 141computers as possible. The main issues are which ABI and which OS X
134version. 142version.
135 143
 144** 10.6, --abi=32
 145
136jperkin@netbsd.org provides a bulk build for quarterly branches 146jperkin@netbsd.org provides a bulk build for quarterly branches
137(--abi=32, OSX 10.6, and therefore gcc 4.2.1, XQuartz, 147(--abi=32, OSX 10.6, and therefore gcc 4.2.1, XQuartz,
138X11_TYPE=native): 148X11_TYPE=native):
139 http://www.perkin.org.uk/pages/pkgsrc-binary-packages-for-osx.html 149 http://www.perkin.org.uk/pages/pkgsrc-binary-packages-for-osx.html
140 http://mail-index.netbsd.org/pkgsrc-bulk/2014/01/10/msg010276.html 150 http://mail-index.netbsd.org/pkgsrc-bulk/2014/01/10/msg010276.html
141which should run on any version from 10.6 to 10.9. 151which should run on any version from 10.6 to 10.9.
142 152
 153Note that sed on 10.9 is broken, but a bootstrap on 10.6 will not
 154avoid it, so while one can install this bootstrap on 10.9 and run
 155binary packages, building packages will not in general work.
 156
 157** 10.9, --abi=64 --compiler=clang
 158
143Given the 10.9 license situation, a bulk build on 10.9 (and therefore 159Given the 10.9 license situation, a bulk build on 10.9 (and therefore
144clang) seems reasonable, with either --abi=32 or --abi=64. Such 160clang) seems reasonable, with either --abi=32 or --abi=64. Such
145builds are almost certainly only usable on 10.9, but that is or will 161builds are almost certainly only usable on 10.9, but that is or will
146be soon a large fraction of Macs. 162be soon a large fraction of Macs.