[MDEV-22812] "failed to create symbolic link" during the build Created: 2020-06-05  Updated: 2020-06-12  Resolved: 2020-06-11

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.5.4
Fix Version/s: 10.5.4

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: not-10.4
Environment:

Ubuntu 18.04, gcloud instance 32 cores


Issue Links:
Relates
relates to MDEV-22003 mysql_config disappeared from 10.5 (e... Closed

 Description   

10.5.4 9c55f83eaedc4fdb1c1e5538646b0a9325f670fb

...build...
[100%] Built target mariadb-backup
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: MySQL
CPack: - Install project: MySQL
failed to create symbolic link 'bin/mariadb-config': No such file or directory
CPack: Create package
CPack: - package: /test/10.5_opt/mariadb-10.5.4-linux-x86_64.tar.gz generated.

Reason:

/test/MD050620-mariadb-10.5.4-linux-x86_64-opt$ ls bin/mariadb*-*config
ls: cannot access 'bin/mariadb-config': No such file or directory
/test/MD050620-mariadb-10.5.4-linux-x86_64-opt$ ls bin/mariadb*_*config
bin/mariadb_config

i.e. - vs _. Likely recent change or typo.

10.4 not affected.

Build command used & full deterministic testcase:

git clone --depth=1 --recurse-submodules -j8 --branch=10.5 https://github.com/MariaDB/server.git 10.5
cp -r 10.5 10.5_opt
cd 10.5_opt
cmake . -DWITH_SSL=bundled -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DWITH_EMBEDDED_SERVER=0 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp/boost_135307 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_ZLIB=bundled -DWITH_ROCKSDB=1 -DWITH_PAM=ON -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=ON -DFORCE_INSOURCE_BUILD=1
make -j 32
./scripts/make_binary_distribution

List of most libs previously installed, in case it matters (unlikely), on Ubuntu 18.04:

 sudo apt-get install -y build-essential man-db patch make cmake automake autoconf git gcc libtool bison openssl lshw lzma lzma-dev git linux-headers-generic g++ libncurses5-dev libaio1 libaio-dev libjemalloc1 libjemalloc-dev libdbd-mysql libssl-dev libgtest-dev zlib1g zlib1g-dbg zlib1g-dev libreadline-dev libreadline7-dbg debhelper devscripts pkg-config dpkg-dev lsb-release libpam0g-dev libcurl4-openssl-dev libssh-dev fail2ban libz-dev libgcrypt20 libgcrypt20-dev libssl-dev libboost-all-dev python-mysqldb libbz2-dev gnutls-dev libbsd-dev libedit-dev liblz4-dev chrpath dh-apparmor dh-exec dh-systemd libcrack2-dev libcurl4-openssl-dev libjudy-dev libkrb5-dev libpcre2-dev libsnappy-dev libsystemd-dev libxml2-dev libzstd-dev unixodbc-dev uuid-dev 



 Comments   
Comment by Alexey Bychko (Inactive) [ 2020-06-05 ]

it's in cmake/mariadb_connector_c.cmake:46

IF(UNIX)
  INSTALL(CODE "EXECUTE_PROCESS(
                  COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BINDIR}
                  COMMAND ${CMAKE_COMMAND} -E create_symlink mariadb_config ${INSTALL_BINDIR}/mariadb-config // Sergei Golubchik 2 months ago MDEV-22003 
                  WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX})"
          COMPONENT Development)
ENDIF()

Comment by Elena Stepanova [ 2020-06-05 ]

If I understand the logic correctly, it's the other way round – it attempts to create a symlink called bin/mariadb-config (to the file mariadb_config). And fails, on whatever reason. We saw it in buildbot in one of builders even in March. At that point it was a sporadic failure – that is, in one build it goes all right, next one fails, then again all right. There was a suggestion then that some sort of a race condition is involved in symlink creation. I don't know if it still happens in buildbot, that builder was replaced, and it's the kind of problem which is [nearly] impossible to search for with the structure of the old buildbot.

Comment by Alexey Bychko (Inactive) [ 2020-06-05 ]

I can't reproduce it on 8cores VM, so yes, it may be race condition

Comment by Sergei Golubchik [ 2020-06-10 ]

I cannot reproduce it either

Comment by Roel Van de Paar [ 2020-06-12 ]

Thank you Sergei for the fix. I can confirmed this is fixed (opt+dbg tested)

10.5.4 07d1c8567cbfe94398a9857c47fb9919cad42651

[100%] Built target mariadb-backup
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: MySQL
CPack: - Install project: MySQL
CPack: Create package
CPack: - package: /test/10.5_opt/mariadb-10.5.4-linux-x86_64.tar.gz generated.

Generated at Thu Feb 08 09:17:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.