| 1 |
|
| 2 |
########################################################################### |
| 3 |
# Here are some information that are only of interest for the current and # |
| 4 |
# following Debian maintainers of MySQL. # |
| 5 |
########################################################################### |
| 6 |
|
| 7 |
The debian/ directory is under GIT control, see debian/control for URL. |
| 8 |
|
| 9 |
# |
| 10 |
# Building with sbuild and running dep8 tests |
| 11 |
# |
| 12 |
- Note: This is tested on Ubuntu 16.04 with xenial-backports enabled. There are bugs in older |
| 13 |
- versions of the required packages that might break the build/test run |
| 14 |
- You need packages autopkgtest, qemu, sbuild, ubuntu-dev-tools and vmdebootstrap |
| 15 |
|
| 16 |
- To create a basic sbuild image for building: |
| 17 |
mk-sbuild --eatmydata [codename] |
| 18 |
- eg. mk-sbuild --eatmydata sid |
| 19 |
|
| 20 |
- Build using the created image |
| 21 |
DEB_BUILD_OPTIONS=parallel=15 sbuild -Ad[codename] mysql-5.7_[version].dsc |
| 22 |
- eg. DEB_BUILD_OPTIONS=parallel=15 sbuild -Adsid-amd64 mysql-5.7_5.7.15-1.dsc |
| 23 |
|
| 24 |
- Create raw sid image for running dep8 |
| 25 |
sudo vmdebootstrap --verbose --serial-console --distribution=sid --customize=/usr/share/autopkgtest/setup-commands/setup-testbed --user=adt/adt --size=10000000000 --grub --image=adt-sid.raw |
| 26 |
- If behind a proxy, add an ADT_APT_PROXY=[url:port] before vmdebootstrap |
| 27 |
- Convert to qemu image |
| 28 |
qemu-img convert -O qcow2 adt-sid.raw adt-sid.img |
| 29 |
rm adt-sid.raw |
| 30 |
|
| 31 |
- Run dep8 tests |
| 32 |
adt-run -oadt -B *.deb mysql-5.7_[version].dsc --- adt-virt-qemu ./adt-sid.img |
| 33 |
- eg. adt-run -oadt -B *.deb mysql-5.7_5.7.15-1.dsc --- adt-virt-qemu ./adt-sid.img | tee testresult.txt |
| 34 |
|
| 35 |
# |
| 36 |
# Preparing a new version |
| 37 |
# |
| 38 |
The new orig.tar.gz (without non-free documentation) is created in /tmp/ when |
| 39 |
running this command: |
| 40 |
|
| 41 |
debian/rules get-orig-source |
| 42 |
|
| 43 |
# |
| 44 |
# mysqlreport |
| 45 |
# |
| 46 |
The authors e-mail address is <[email protected]>. |
| 47 |
|
| 48 |
# |
| 49 |
# Remarks to dependencies |
| 50 |
# |
| 51 |
libwrap0-dev (>= 7.6-8.3) |
| 52 |
According to bug report 114582 where where build problems on |
| 53 |
IA-64/sid with at least two prior versions. |
| 54 |
psmisc |
| 55 |
/usr/bin/killall in the initscript |
| 56 |
|
| 57 |
zlib1g in libmysqlclient-dev: |
| 58 |
"mysql_config --libs" ads "-lz" |
| 59 |
|
| 60 |
Build-Dep: |
| 61 |
|
| 62 |
debhelper (>=4.1.16): |
| 63 |
See po-debconf(7). |
| 64 |
|
| 65 |
autoconf (>= 2.13-20), automake1.7 |
| 66 |
Try to get rid of them. |
| 67 |
|
| 68 |
doxygen, tetex-bin, tetex-extra, gs |
| 69 |
for ndb/docs/*tex |
| 70 |
|
| 71 |
# |
| 72 |
# Remarks to the start scripts |
| 73 |
# |
| 74 |
|
| 75 |
## initscripts rely on mysqladmin from a different package |
| 76 |
We have the problem that "/etc/init.d/mysql stop" relies on mysqladmin which |
| 77 |
is in another package (mysql-client) and a passwordless access that's maybe |
| 78 |
only available if the user configured his /root/.my.cnf. Can this be a problem? |
| 79 |
* normal mode: not because the user is required to have it. Else: |
| 80 |
* purge/remove: not, same as normal mode |
| 81 |
* upgrade: not, same as normal mode |
| 82 |
* first install: not, it depends on mysql-client which at least is unpacked |
| 83 |
so mysqladmin is there (to ping). It is not yet configured |
| 84 |
passwordles but if there's a server running then there's a |
| 85 |
/root/.my.cnf. Anyways, we simply kill anything that's mysqld. |
| 86 |
|
| 87 |
## Passwordless access for the maintainer scripts |
| 88 |
Another issue is that the scripts needs passwordless access. To ensure this |
| 89 |
a debian-sys-maint user is configured which has process and shutdown privs. |
| 90 |
The file with the randomly (that's important!) generated password must be |
| 91 |
present as long as the databases remain installed because else a new install |
| 92 |
would have no access. This file should be used like: |
| 93 |
mysqladmin --defaults-file=/etc/mysql/debian.cnf restart |
| 94 |
to avoid providing the password in plaintext on a commandline where it would |
| 95 |
be visible to any user via the "ps" command. |
| 96 |
|
| 97 |
## When to start the daemon? |
| 98 |
We aim to give the admin full control on when MySQL is running. |
| 99 |
Issues to be faced here: |
| 100 |
OLD: |
| 101 |
1. Debconf asks whether MySQL should be started on boot so update-rc.d is |
| 102 |
only run if the answer has been yes. The admin is likely to forget |
| 103 |
this decision but update-rc.d checks for an existing line in |
| 104 |
/etc/runlevel.conf and leaves it intact. |
| 105 |
2. On initial install, if the answer is yes, the daemon has to be started. |
| 106 |
3. On upgrades it should only be started if it was already running, everything |
| 107 |
else is confusing. Especiall relying on an debconf decision made month ago |
| 108 |
is considered suboptimal. See bug #274264 |
| 109 |
Implementation so far: |
| 110 |
prerm (called on upgrade before stopping the server): |
| 111 |
check for a running server and set flag if necessary |
| 112 |
preinst (called on initial install and before unpacking when upgrading): |
| 113 |
check for the debconf variable and set flag if necessary |
| 114 |
postinst (called on initial install and after each upgrade after unpacking): |
| 115 |
call update-rc.d if debconf says yes |
| 116 |
call invoce-rc.d if the flag has been set |
| 117 |
Problems remaining: |
| 118 |
dpkg-reconfigure and setting mysql start on boot to yes did not start mysql |
| 119 |
(ok "start on boot" literally does not mean "start now" so that might have been ok) |
| 120 |
NEW: |
| 121 |
1. --- no debconf anymore for the sake of simplicity. We have runlevel.conf, |
| 122 |
the admin should use it |
| 123 |
2. On initial install the server is started. |
| 124 |
3. On upgrades the server is started exactly if it was running before so the |
| 125 |
runlevel configuration is irrelevant. It will be preserved by the mean of |
| 126 |
update-rc.d's builtin check. |
| 127 |
Implementation: |
| 128 |
prerm (called on upgrade before stopping the server): |
| 129 |
check for a running server and set flag if necessary |
| 130 |
preinst (called on initial install and before unpacking when upgrading): |
| 131 |
check for $1 beeing (initial) "install" and set flag |
| 132 |
postinst (called on initial install and after each upgrade after unpacking): |
| 133 |
call update-rc.d |
| 134 |
call invoce-rc.d if the flag has been set |
| 135 |
|
| 136 |
|
| 137 |
Test plan |
| 138 |
========= |
| 139 |
|
| 140 |
This is the test plan agreed to at the meeting in London, December |
| 141 |
2014. Please revisit and keep this document up-to-date if you're |
| 142 |
changing any tests. |
| 143 |
|
| 144 |
|
| 145 |
Why we're changing the test plan |
| 146 |
-------------------------------- |
| 147 |
|
| 148 |
Historically, the main suite of the upstream MTR tests have been run at |
| 149 |
build time. This has deteced real bugs, especially when building for |
| 150 |
platforms not supported by upstream, so we definitely see a value in |
| 151 |
running these tests. |
| 152 |
|
| 153 |
Test runs are taking a long time to finish. Some tests are unstable and |
| 154 |
may return false positives, leading to failed builds. In addition, we're |
| 155 |
testing a lot of things that have already been tested upstream and that |
| 156 |
are unlikely to change when packaged for Debian/Ubuntu. |
| 157 |
|
| 158 |
We're also adding DEP8 tests, so we have to decide what goes into the |
| 159 |
build tests and what goes into DEP8 tests. |
| 160 |
|
| 161 |
|
| 162 |
Build tests |
| 163 |
----------- |
| 164 |
|
| 165 |
Instead of running the main test suite for every build, we should spend |
| 166 |
time on testing the things that are actually different from upstream: |
| 167 |
|
| 168 |
- Dependencies (both build and runtime) |
| 169 |
- Install paths |
| 170 |
|
| 171 |
Until we figure out a set of test for this, we continue with the main |
| 172 |
MTR suite, as before. We skip rpl tests (using --skip-rpl) to reduce the |
| 173 |
number of false positives. |
| 174 |
|
| 175 |
The build itself fails on the first error, and we do the same in testing |
| 176 |
by running MTR without --force. This shortens down build cycles in case |
| 177 |
of failures. |
| 178 |
|
| 179 |
DEP8 tests |
| 180 |
---------- |
| 181 |
|
| 182 |
The time it takes to run the tests isn't that much of an issue for DEP8 |
| 183 |
as it is for build tests, so we can do more thorough testing here. |
| 184 |
|
| 185 |
We run the build tests in DEP8 in order to detect when dependency |
| 186 |
updates that don't require a rebuild of MySQL will cause the MySQL |
| 187 |
package to break. |
| 188 |
|
| 189 |
Since bugs on platforms not supported by upstream has been found by the |
| 190 |
main suite earlier, upstream recommends that we continue to run this |
| 191 |
suite in DEP8. |
| 192 |
|
| 193 |
We skip rpl tests to reduce the number of false positives. |
| 194 |
|
| 195 |
We run MTR with --force in order not to stop at the first failure. Since |
| 196 |
DEP8 tests are expected to run for a while, and we expect the tests to |
| 197 |
pass since the build tests passed, it's more useful to come back and see |
| 198 |
that all tests have run, but a couple of them failed, than to see that |
| 199 |
the first test failure was after 5 minutes and that it aborted |
| 200 |
immediately. It will also give us more information, since we can see |
| 201 |
from the log if this was an unstable test that passed when rerun or if |
| 202 |
it is a real test failure. |
| 203 |
|
| 204 |
|
| 205 |
# |
| 206 |
# Bundled boost and rapidjson headers |
| 207 |
# |
| 208 |
|
| 209 |
MySQL bundles code from two projects that are technically available in Debian: boost and rapidjson |
| 210 |
For both of these projects, MySQL bundles header files only. |
| 211 |
|
| 212 |
For boost, MySQL relies on a very specific version, so using the version available on the system |
| 213 |
will generally not work. |
| 214 |
|
| 215 |
For rapidjson, they have not published a release for years (https://github.com/Tencent/rapidjson/issues/1006), |
| 216 |
and MySQL requires more recent patches (and will occasionally sync with their master branch). |