Merge lp:~metacollin/kicad/boosting_boost into lp:kicad/product

Proposed by metacollin
Status: Rejected
Rejected by: Chris Pavlina
Proposed branch: lp:~metacollin/kicad/boosting_boost
Merge into: lp:kicad/product
Diff against target: 250 lines (+125/-85)
1 file modified
CMakeModules/download_boost.cmake (+125/-85)
To merge this branch: bzr merge lp:~metacollin/kicad/boosting_boost
Reviewer Review Type Date Requested Status
Wayne Stambaugh Disapprove
Review via email: mp+248085@code.launchpad.net

Description of the change

It's a known bug that KiCad crashes on newer OS X versions unless -DKICAD_SKIP_BOOST is enabled. Unfortunately, boost 1.57 is still not 'KiCad ready', there is still one tiny but vital patch that must be applied. If virgin boost is used, the push and shove router crashes almost immediately, due to how boost handles pointers to polygon points.

This is a one file merge/patch that will instead download and patch boost 1.57. This change applies only to OS X builds, all other platforms will not be effected.

I am very sorry for the duplicate merge proposal. I will try to be more careful in the future. I left a line of old code I wrote and commented out and, some how, lost the threading argument line for boost. I fixed that and made sure the white spaces were tidy. Sorry.

To post a comment you must log in.
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

After the next stable release, this patch will be lost. I plan on ripping out all of the custom dependency download, patch, and build code from the CMake files after the next stable. If someone needs this to build dependencies on their platform than it will have to be maintained as an external project. The complexity it has added to the project configure and build has been a major source of pain. I recommend creating a kicad-boost project that downloads, patches, and builds boost for the platforms that need it.

review: Disapprove
Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Boost download is gone now, so marking rejected.

Unmerged revisions

5392. By metacollin

Fixed accidental removal of multithreading and cleaned up code white spacing.

5391. By metacollin

Readded non-apple platform code (oops).

5390. By metacollin

Merged.

5389. By metacollin

Builds a patched version of Boost 1.57.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeModules/download_boost.cmake'
2--- CMakeModules/download_boost.cmake 2014-11-28 17:34:00 +0000
3+++ CMakeModules/download_boost.cmake 2015-01-30 07:49:21 +0000
4@@ -32,6 +32,11 @@
5 set( BOOST_RELEASE 1.54.0 )
6 set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
7
8+if( APPLE )
9+ set( BOOST_RELEASE 1.57.0 )
10+ set( BOOST_MD5 1be49befbdd9a5ce9def2983ba3e7b76 )
11+endif()
12+
13 # The boost headers [and static libs if built] go here, at the top of KiCad
14 # source tree in boost_root.
15 set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
16@@ -144,33 +149,18 @@
17 set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
18 set( BOOST_TOOLSET "toolset=darwin" )
19
20- if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
21- set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
22- set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
23- endif()
24-
25 if( CMAKE_OSX_ARCHITECTURES )
26
27- if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
28- (CMAKE_OSX_ARCHITECTURES MATCHES "64"))
29+ if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" AND CMAKE_OSX_ARCHITECTURES MATCHES "64") )
30 message( "-- BOOST found 32/64 Address Model" )
31
32 set( BOOST_ADDRESSMODEL "address-model=32_64" )
33- endif()
34-
35- if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND
36- (CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
37- message("-- BOOST found ppc/x86 Architecture")
38-
39- set(BOOST_ARCHITECTURE "architecture=combined")
40- elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
41+ endif()
42+
43+ if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
44 message("-- BOOST found x86 Architecture")
45
46 set(BOOST_ARCHITECTURE "architecture=x86")
47- elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
48- message("-- BOOST found ppc Architecture")
49-
50- set(BOOST_ARCHITECTURE "architecture=ppc")
51 endif()
52
53 set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
54@@ -179,71 +169,41 @@
55 endif()
56 endif()
57
58-ExternalProject_Add( boost
59- PREFIX "${PREFIX}"
60-
61- URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
62- DOWNLOAD_DIR "${DOWNLOAD_DIR}"
63- TIMEOUT 1200 # 20 minutes
64- URL_MD5 ${BOOST_MD5}
65- # If download fails, then enable "LOG_DOWNLOAD ON" and try again.
66- # Upon a second failure with logging enabled, then look at these logs:
67- # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
68- # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
69- # If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
70- # into <src>/.downloads-by-cmake/ dir.
71- # LOG_DOWNLOAD ON
72-
73- INSTALL_DIR "${BOOST_ROOT}"
74-
75- # The patch command executes with the working directory set to <SOURCE_DIR>
76- # Revert the branch to pristine before applying patch sets as bzr patch
77- # fails when applying a patch to the branch twice and doesn't have a switch
78- # to ignore previously applied patches
79- PATCH_COMMAND bzr revert
80- # bzr revert is insufficient to remove "added" files:
81- COMMAND bzr clean-tree -q --force
82-
83- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
84- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
85-
86- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
87- # tell bzr about "added" files by last patch:
88- COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
89- COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
90-
91- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
92- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
93-
94- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
95- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
96-
97- # tell bzr about "added" files by last patch:
98- COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
99- COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
100- COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
101- COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
102-
103- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
104- COMMAND bzr add libs/context/build/Jamfile.v2
105- COMMAND bzr add libs/context/build/architecture.jam
106- COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
107- COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
108- COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
109- COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
110- COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
111- COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
112-
113- # [Mis-]use this step to erase all the boost headers and libraries before
114- # replacing them below.
115- UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
116-
117- BINARY_DIR "${PREFIX}/src/boost/"
118- CONFIGURE_COMMAND ${bootstrap}
119-
120- BUILD_COMMAND ./b2
121+if( APPLE )
122+ ExternalProject_Add( boost
123+ PREFIX "${PREFIX}"
124+
125+ URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
126+ DOWNLOAD_DIR "${DOWNLOAD_DIR}"
127+ TIMEOUT 1200 # 20 minutes
128+ URL_MD5 ${BOOST_MD5}
129+ # If download fails, then enable "LOG_DOWNLOAD ON" and try again.
130+ # Upon a second failure with logging enabled, then look at these logs:
131+ # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
132+ # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
133+ # If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
134+ # into <src>/.downloads-by-cmake/ dir.
135+ # LOG_DOWNLOAD ON
136+
137+ INSTALL_DIR "${BOOST_ROOT}"
138+
139+ # The patch command executes with the working directory set to <SOURCE_DIR>
140+ # Revert the branch to pristine before applying patch sets as bzr patch
141+ # fails when applying a patch to the branch twice and doesn't have a switch
142+ # to ignore previously applied patches
143+ PATCH_COMMAND bzr revert
144+ COMMAND bzr clean-tree -q --force
145+
146+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
147+
148+ UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
149+
150+ BINARY_DIR "${PREFIX}/src/boost/"
151+ CONFIGURE_COMMAND ${bootstrap} ${b2_libs}
152+
153+ BUILD_COMMAND ./b2
154 variant=release
155- threading=multi
156+ threading=multi
157 ${BOOST_CFLAGS}
158 ${BOOST_TOOLSET}
159 ${BOOST_CXXFLAGS}
160@@ -255,8 +215,88 @@
161 --prefix=<INSTALL_DIR>
162 install
163
164- INSTALL_COMMAND ""
165- )
166+ INSTALL_COMMAND ""
167+ )
168+else()
169+ ExternalProject_Add( boost
170+ PREFIX "${PREFIX}"
171+
172+ URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
173+ DOWNLOAD_DIR "${DOWNLOAD_DIR}"
174+ TIMEOUT 1200 # 20 minutes
175+ URL_MD5 ${BOOST_MD5}
176+ # If download fails, then enable "LOG_DOWNLOAD ON" and try again.
177+ # Upon a second failure with logging enabled, then look at these logs:
178+ # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
179+ # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
180+ # If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
181+ # into <src>/.downloads-by-cmake/ dir.
182+ # LOG_DOWNLOAD ON
183+
184+ INSTALL_DIR "${BOOST_ROOT}"
185+
186+ # The patch command executes with the working directory set to <SOURCE_DIR>
187+ # Revert the branch to pristine before applying patch sets as bzr patch
188+ # fails when applying a patch to the branch twice and doesn't have a switch
189+ # to ignore previously applied patches
190+ PATCH_COMMAND bzr revert
191+ # bzr revert is insufficient to remove "added" files:
192+ COMMAND bzr clean-tree -q --force
193+
194+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
195+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
196+
197+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
198+ # tell bzr about "added" files by last patch:
199+ COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
200+ COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
201+
202+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
203+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
204+
205+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
206+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
207+
208+ # tell bzr about "added" files by last patch:
209+ COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
210+ COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
211+ COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
212+ COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
213+
214+ COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
215+ COMMAND bzr add libs/context/build/Jamfile.v2
216+ COMMAND bzr add libs/context/build/architecture.jam
217+ COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
218+ COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
219+ COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
220+ COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
221+ COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
222+ COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
223+
224+ # [Mis-]use this step to erase all the boost headers and libraries before
225+ # replacing them below.
226+ UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
227+
228+ BINARY_DIR "${PREFIX}/src/boost/"
229+ CONFIGURE_COMMAND ${bootstrap}
230+
231+ BUILD_COMMAND ./b2
232+ variant=release
233+ threading=multi
234+ ${BOOST_CFLAGS}
235+ ${BOOST_TOOLSET}
236+ ${BOOST_CXXFLAGS}
237+ ${BOOST_LINKFLAGS}
238+ ${BOOST_ADDRESSMODEL}
239+ ${BOOST_ARCHITECTURE}
240+ ${b2_libs}
241+ ${BOOST_LINKTYPE}
242+ --prefix=<INSTALL_DIR>
243+ install
244+
245+ INSTALL_COMMAND ""
246+ )
247+endif()
248
249 if( MINGW )
250 execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion