Skip to content

Commit 2af0867

Browse files
committed
Bug#24008883 NO DEBUG SYMBOLS INCLUDED FOR DEB PACKAGES
Fixed: Incorrect variable syntax caused cmake warnings Deb packaging automatically strips out debug symbols from the binaries. Debian 9 automatically generates separate dbgsym packages with the symbols, so we want to do the same for the other apt platforms.
1 parent 07e0735 commit 2af0867

9 files changed

+185
-0
lines changed

packaging/deb-in/CMakeLists.txt

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ IF (NOT DEFINED DEB_CHANGELOG_TIMESTAMP)
4646
)
4747
SET (DEB_CHANGELOG_TIMESTAMP ${DEB_CHANGELOG_TIMESTAMP} CACHE STRING "")
4848
ENDIF()
49+
4950
# Commercial or community
5051
IF (DEB_PRODUCT STREQUAL "commercial")
5152
INCLUDE (deb_commercial.cmake)
@@ -133,6 +134,60 @@ ELSE()
133134
SET (DEB_CONTROL_BDEPS_EXTRA "")
134135
ENDIF()
135136

137+
# Generate debug symbol packages (this is done automatically in Debian9+)
138+
SET (DEB_RULES_STRIP_DEFAULT
139+
"
140+
override_dh_strip:
141+
dh_strip -pmysql-${DEB_PRODUCTNAME}-server-core --dbg-package=mysql-${DEB_PRODUCTNAME}-server-core-dbgsym
142+
dh_strip -pmysql-${DEB_PRODUCTNAME}-client-core --dbg-package=mysql-${DEB_PRODUCTNAME}-client-core-dbgsym
143+
dh_strip -pmysql-${DEB_PRODUCTNAME}-server --dbg-package=mysql-${DEB_PRODUCTNAME}-server-dbgsym
144+
dh_strip -pmysql-${DEB_PRODUCTNAME}-client --dbg-package=mysql-${DEB_PRODUCTNAME}-client-dbgsym
145+
dh_strip -pmysql-${DEB_PRODUCTNAME}-test --dbg-package=mysql-${DEB_PRODUCTNAME}-test-dbgsym
146+
dh_strip -pmysql-server
147+
dh_strip -pmysql-client
148+
dh_strip -pmysql-testsuite
149+
dh_strip -plibmysqlclient21 --dbg-package=libmysqlclient21-dbgsym
150+
dh_strip -plibmysqlclient-dev
151+
")
152+
SET (DEB_CONTROL_DBGSYM_DEFAULT
153+
"
154+
Package: libmysqlclient21-dbgsym
155+
Architecture: any
156+
Section: debug
157+
Depends: libmysqlclient21 (=\${binary:Version}), \${misc:Depends}
158+
Description: Debugging symbols for client library
159+
160+
Package: mysql-${DEB_PRODUCTNAME}-test-dbgsym
161+
Architecture: any
162+
Section: debug
163+
Depends: mysql-${DEB_PRODUCTNAME}-test-core (= \${binary:Version}), \${misc:Depends}
164+
Description: Debugging symbols for test suite
165+
166+
Package: mysql-${DEB_PRODUCTNAME}-client-core-dbgsym
167+
Architecture: any
168+
Section: debug
169+
Depends: mysql-${DEB_PRODUCTNAME}-client-core (= \${binary:Version}), \${misc:Depends}
170+
Description: Debugging symbols for client core
171+
172+
Package: mysql-${DEB_PRODUCTNAME}-server-core-dbgsym
173+
Architecture: any
174+
Section: debug
175+
Depends: mysql-${DEB_PRODUCTNAME}-server-core (= \${binary:Version}), \${misc:Depends}
176+
Description: Debugging symbols for server core
177+
178+
Package: mysql-${DEB_PRODUCTNAME}-server-dbgsym
179+
Architecture: any
180+
Section: debug
181+
Depends: mysql-${DEB_PRODUCTNAME}-server (= \${binary:Version}), \${misc:Depends}
182+
Description: Debugging symbols for server
183+
184+
Package: mysql-${DEB_PRODUCTNAME}-client-dbgsym
185+
Architecture: any
186+
Section: debug
187+
Depends: mysql-${DEB_PRODUCTNAME}-client (= \${binary:Version}), \${misc:Depends}
188+
Description: Debugging symbols for client
189+
")
190+
136191
# Platform specifics. The differences are generally only distro version
137192
# and whether or not systemd and/or apparmor are available
138193
IF (DEB_CODENAME STREQUAL "wheezy")
@@ -148,6 +203,8 @@ IF (DEB_CODENAME STREQUAL "wheezy")
148203
SET (DEB_INSTALL_SERVER_APPARMOR "")
149204
SET (DEB_SERVICE_SERVER_EXECPRE "")
150205
SET (DEB_INIT_APPARMOR "")
206+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
207+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
151208
ELSEIF(DEB_CODENAME STREQUAL "jessie")
152209
SET (DEB_PLATFORMRELEASE "debian8")
153210
SET (DEB_CONTROL_BDEPS "dh-systemd")
@@ -163,6 +220,8 @@ ELSEIF(DEB_CODENAME STREQUAL "jessie")
163220
SET (DEB_SERVICE_SERVER_EXECPRE
164221
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
165222
SET (DEB_INIT_APPARMOR "")
223+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
224+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
166225
ELSEIF(DEB_CODENAME STREQUAL "stretch")
167226
SET (DEB_PLATFORMRELEASE "debian9")
168227
SET (DEB_CONTROL_BDEPS "dh-systemd")
@@ -178,6 +237,8 @@ ELSEIF(DEB_CODENAME STREQUAL "stretch")
178237
SET (DEB_SERVICE_SERVER_EXECPRE
179238
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
180239
SET (DEB_INIT_APPARMOR "")
240+
SET (DEB_CONTROL_DBGSYM "")
241+
SET (DEB_RULES_STRIP "")
181242
ELSEIF(DEB_CODENAME STREQUAL "sid")
182243
IF (DEFINED DEB_GCC_SNAPSHOT)
183244
SET (DEB_CMAKE_EXTRAS "${DEB_CMAKE_EXTRAS} -DCMAKE_C_COMPILER=/usr/lib/gcc-snapshot/bin/gcc -DCMAKE_CXX_COMPILER=/usr/lib/gcc-snapshot/bin/g++ -DMYSQL_MAINTAINER_MODE=0 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache")
@@ -196,6 +257,8 @@ ELSEIF(DEB_CODENAME STREQUAL "sid")
196257
SET (DEB_SERVICE_SERVER_EXECPRE
197258
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
198259
SET (DEB_INIT_APPARMOR "")
260+
SET (DEB_CONTROL_DBGSYM "")
261+
SET (DEB_RULES_STRIP "")
199262
ELSEIF(DEB_CODENAME STREQUAL "trusty")
200263
SET (DEB_PLATFORMRELEASE "ubuntu14.04")
201264
SET (DEB_CONTROL_BDEPS "dh-apparmor")
@@ -211,6 +274,8 @@ ELSEIF(DEB_CODENAME STREQUAL "trusty")
211274
SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
212275
SET (DEB_SERVICE_SERVER_EXECPRE "")
213276
SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld")
277+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
278+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
214279
ELSEIF(DEB_CODENAME STREQUAL "xenial")
215280
SET (DEB_PLATFORMRELEASE "ubuntu16.04")
216281
SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -228,6 +293,8 @@ ELSEIF(DEB_CODENAME STREQUAL "xenial")
228293
SET (DEB_SERVICE_SERVER_EXECPRE
229294
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
230295
SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
296+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
297+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
231298
ELSEIF(DEB_CODENAME STREQUAL "zesty")
232299
SET (DEB_PLATFORMRELEASE "ubuntu17.04")
233300
SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -245,6 +312,8 @@ ELSEIF(DEB_CODENAME STREQUAL "zesty")
245312
SET (DEB_SERVICE_SERVER_EXECPRE
246313
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
247314
SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
315+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
316+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
248317
ELSEIF(DEB_CODENAME STREQUAL "artful")
249318
SET (DEB_PLATFORMRELEASE "ubuntu17.10")
250319
SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -262,6 +331,8 @@ ELSEIF(DEB_CODENAME STREQUAL "artful")
262331
SET (DEB_SERVICE_SERVER_EXECPRE
263332
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
264333
SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
334+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
335+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
265336
ELSEIF(DEB_CODENAME STREQUAL "bionic")
266337
SET (DEB_PLATFORMRELEASE "ubuntu18.04")
267338
SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -279,6 +350,8 @@ ELSEIF(DEB_CODENAME STREQUAL "bionic")
279350
SET (DEB_SERVICE_SERVER_EXECPRE
280351
"ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
281352
SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
353+
SET (DEB_CONTROL_DBGSYM ${DEB_CONTROL_DBGSYM_DEFAULT})
354+
SET (DEB_RULES_STRIP ${DEB_RULES_STRIP_DEFAULT})
282355
ELSE()
283356
MESSAGE(STATUS
284357
"Skipping deb packaging on unsupported platform ${DEB_CODENAME}.")

packaging/deb-in/control.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,5 +283,6 @@ Description: MySQL Test Run MTR - The MySQL testsuite
283283
Oracle. This package contains the MySQL regression test suite for MySQL
284284
database server.
285285

286+
@DEB_CONTROL_DBGSYM@
286287
@DEB_NDB_CONTROL_EXTRAS@
287288
@DEB_COMMERCIAL_CONTROL_EXTRAS@
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
# legal
17+
usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ usr/share/doc/libmysqlclient21-dbgsym/
18+
usr/share/mysql/README usr/share/doc/libmysqlclient21-dbgsym/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
# legal
17+
usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ usr/share/doc/mysql-@DEB_PRODUCTNAME@-client-core-dbgsym/
18+
usr/share/mysql/README usr/share/doc/mysql-@DEB_PRODUCTNAME@-client-core-dbgsym/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
# legal
17+
usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ usr/share/doc/mysql-@DEB_PRODUCTNAME@-client-dbgsym/
18+
usr/share/mysql/README usr/share/doc/mysql-@DEB_PRODUCTNAME@-client-dbgsym/
19+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
# legal
17+
usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ usr/share/doc/mysql-@DEB_PRODUCTNAME@-server-core-dbgsym/
18+
usr/share/mysql/README usr/share/doc/mysql-@DEB_PRODUCTNAME@-server-core-dbgsym/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
# legal
17+
usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ usr/share/doc/mysql-@DEB_PRODUCTNAME@-server-dbgsym/
18+
usr/share/mysql/README usr/share/doc/mysql-@DEB_PRODUCTNAME@-server-dbgsym/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
# legal
17+
usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ usr/share/doc/mysql-@DEB_PRODUCTNAME@-test-dbgsym/
18+
usr/share/mysql/README usr/share/doc/mysql-@DEB_PRODUCTNAME@-test-dbgsym/

packaging/deb-in/rules.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ override_dh_auto_test:
6666
@echo "RULES.$@"
6767
touch $@
6868

69+
@DEB_RULES_STRIP@
70+
6971
override_dh_auto_install:
7072

7173
@echo "RULES.$@"

0 commit comments

Comments
 (0)