[MDEV-26319] Mismatch in MARIADB_UNIX_ADDR default value for MariaDB Server and Connector C Created: 2021-08-07 Updated: 2023-03-18 Resolved: 2021-08-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Configuration, libmariadb |
| Affects Version/s: | 10.6.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Otto Kekäläinen | Assignee: | Daniel Black |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
While working on MariaDB 10.6.4 compilation I noticed this warning:
It is understanable that the variable is defined twice, but it is not good that we have two different default values of MARIADB_UNIX_ADDR. The client sets it to /tmp/mysql.sock in https://github.com/mariadb-corporation/mariadb-connector-c/blob/1f320a663cf08191e3be03be11bd61c7560b0cb7/CMakeLists.txt#L181 The server sets MARIADB_UNIX_ADDR to MYSQL_UNIX_ADDR which in turn is set to INSTALL_UNIX_ADDRDIR which ends up being /var/lib/mysql in the build. I suggest the default path would be the same in both projects. |
| Comments |
| Comment by Daniel Black [ 2021-08-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It is configured to propagate:
Where does /var/lib/mysql/mysql.sock come from if /run/mysqld/mysqld.sock is the Debian default? Are you building with `-DDEB=1`? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-08-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is not a Debian build. This is vanilla build of upstream with `cmake -DRPM=`. I did not manage to track down exactly where `/var/lib/mysql/mysql.sock` comes from other than what is already above. I came across this while working with improving https://github.com/MariaDB/server/blob/10.6/.gitlab-ci.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-08-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The -DRPM is definitely getting the CI_JOB_NAME value? If its blank that could explain the observed results as it will fallback to a "STANDALONE" layout if both DEB and RPM are blank/undefined. Because on RPM distros the INSTALL_UNIX_ADDRDIR_RPM is the install_layout.cmake too which is where the path comes from.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-08-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
otto, could you show the complete command line that you used for invoking cmake? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-08-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Looking at latest https://gitlab.com/ottok/mariadb/-/pipelines/351707761 and e.g. https://storage.googleapis.com/gitlab-gprd-artifacts/ef/be/efbe5970cae20178291094d61fe81817e0d99f85c40a27182aab9db8e4ab370a/2021_08_11/1496181632/1610210407/job.log?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&response-content-disposition=inline&GoogleAccessId=gitlab-object-storage-prd@gitlab-production.iam.gserviceaccount.com&Signature=UqsJYBoFMcNkKI3EkoZZGk4aRPLZnJGOkDylwMQzM96fFGwcpDYUVUS6sBOy%0AyQt3FdH2XG7lKKDokexz2ihJ3X4cEXbVZLtmIMEg7k0L8NwWaAbZWJcm%2FtIe%0Aupa7f5eof9Ww%2BiRX%2B16JtB5lavzS3I%2FVrBC3fBtNinRMwIPkiWjT0kkzSrYD%0AGE1Uv3OWgFU3r96y7pOzoTPCnitM3B8kfi%2F%2BQVx8nXdsleXeWux1WfcBJyCS%0AqH5srIC%2BTpvTfjJ4pGYmOnNoA1ikJS3fdQTcN6QRW9OrCTJn03kCcNJ3UG67%0A5Ya4OTedfX7dr2hKs9yi%2FNNZnnuR1EAbVWojN%2Bnn0A%3D%3D&Expires=1629092253 ..the exact build line is unfortunately printed out only in the non-evaluated form:
I need to do a test run that echoes it out to verify what the -DRPM value actually ends up being. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-08-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
"-- Installation layout: DEFAULT" in the output suggests its likely to be blank. Could just set -DRPM= {some-fixed-value}. It really only affects the names of the generated RPMs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-08-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Verified looking at RPM based builds on buildbot like http://buildbot.askmonty.org/buildbot/builders/kvm-rpm-centos73-ppc64/builds/18101/steps/compile/logs/stdio
exists when the -DRPM="actual value". So Otto, you must have it blank. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
danblack The value of `-DRPM` is not empty. Seems that it is just not being picked up. I added to CPackRPM.cmake a debug line to print out the value:
In the example log of a Gitlab test build one can see that `-DRPM=centos8` was for sure passed to `cmake'. The debug code does however not see any:
The lines output by libmariadb/CMakeLists.txt also say DEFAULT and not RPM:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
please edit the example log url. I'm getting "ExpiredToken". Found - https://gitlab.com/ottok/mariadb/-/jobs/1528209679 for cento7 showing Installation layout: DEFAULT but not for centos8. Same with https://gitlab.com/ottok/mariadb/-/jobs/1543385136 Could this be tied to the cmake version?
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Indeed, the INSTALL_LAYOUT is DEFAULT if RPM=centos7. On all other values for RPM (centos8, fedora, generic) seem to work and INSTALL_LAYOUT is RPM. New debug code:
RPM=centos7 https://gitlab.com/ottok/mariadb/-/jobs/1544023335
RPM=centos8 https://gitlab.com/ottok/mariadb/-/jobs/1544023333
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I confirm this was a CMake version issue. Centos 7 has cmake version 2.8.12.2. After installing cmake3 version 3.17.5 from EPEL the exact same build evaluated INSTALL_LAYOUT correctly:
I ran the trace cmake -DRPM=centos7 --trace-source=cmake/install_layout.cmake --trace-expand on both CMake 2 and CMake 3 and compared, but in traces both evaluated INSTALL_LAYOUT "DEFAULT".
After adding a bunch of MESSAGE here and there to debug I arrived that the root cause is the STRQUAL comparison, and the fix is:
Should I make a PR of this? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-08-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Did now https://github.com/MariaDB/server/pull/1897 as CentOS 7 will be around for a while more.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2023-03-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Since CMake 2.x use is getting very rare I will just close https://github.com/MariaDB/server/pull/1897, in particular since nobody else reported running into this issue in https://jira.mariadb.org/browse/MDEV-26319. |