05db4b
Avoid errors like:
05db4b
05db4b
|  Path length (109) is longer than maximum supported length (108) and will be truncated at /usr/lib64/perl5/vendor_perl/Socket.pm line 880, <GEN16094> line 1.
05db4b
|  worker[2] mysql-test-run: *** ERROR: Socket path '/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.s390x/usr/share/mysql-test/var/tmp/2' too long,
05db4b
|  it would be  truncated and thus not possible to use for connection to  MySQL Server. Set a shorter with --tmpdir=<path> option
05db4b
05db4b
===
05db4b
05db4b
On Fedora 32:
05db4b
05db4b
|  $ grep -e "PATH" /usr/include/linux/limits.h
05db4b
|  #define PATH_MAX        4096	/* # chars in a path name including nul */
05db4b
05db4b
===
05db4b
05db4b
Thus setting the maximum path length on Fedora to 108 characters is just too short.
05db4b
05db4b
BTW on the modern filesystems you can easily create path longer than PATH_MAX.
05db4b
The PATH_MAX constant is unsafe.
05db4b
Interesting article: https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
05db4b
05db4b
===
05db4b
05db4b
The question is why haven't I encountered this issue until recently ?
05db4b
05db4b
After the recent tweaks to the testsuite (between 8.0.24 and 8.0.25 release), the generated --tmpdir path changed from
05db4b
|  --tmpdir=/builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/mysql-test/var/tmp/
05db4b
to
05db4b
|  --tmpdir=/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var/tmp/
05db4b
05db4b
===
05db4b
05db4b
The whole setup changed as follows:
05db4b
BEFORE:
05db4b
05db4b
|  Installing system database
05db4b
|  ### safe_path: /builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/runtime_output_directory///mysqltest_safe_process --verbose -- /builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/runtime_output_directory/mysqld --no-defaults --initialize-insecure --loose-skip-ndbcluster --tmpdir=/builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/mysql-test/var/tmp/ --core-file --datadir=/builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/mysql-test/var/data/ --secure-file-priv=/builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/mysql-test/var --innodb_buffer_pool_size=24M --innodb-log-file-size=5M --innodb_autoextend_increment=8 --character-sets-dir=/builddir/build/BUILD/mysql-8.0.24/share/charsets --loose-auto_generate_certs=OFF --loose-sha256_password_auto_generate_rsa_keys=OFF --loose-caching_sha2_password_auto_generate_rsa_keys=OFF --init-file=/builddir/build/BUILD/mysql-8.0.24/x86_64-redhat-linux-gnu/mysql-test/var/tmp/bootstrap.sql
05db4b
05db4b
AFTER:
05db4b
05db4b
|  Installing system database
05db4b
|  ### safe_path: /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/bin//mysqltest_safe_process --verbose -- /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/libexec/mysqld --no-defaults --initialize-insecure --loose-skip-ndbcluster --tmpdir=/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var/tmp/ --core-file --datadir=/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var/data/ --secure-file-priv=/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var --innodb_buffer_pool_size=24M --innodb-log-file-size=5M --innodb_autoextend_increment=8 --character-sets-dir=/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql/charsets --loose-auto_generate_certs=OFF --loose-sha256_password_auto_generate_rsa_keys=OFF --loose-caching_sha2_password_auto_generate_rsa_keys=OFF --init-file=/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var/tmp/bootstrap.sql
05db4b
05db4b
===
05db4b
05db4b
The likely cause is the added
05db4b
05db4b
|  cd %{buildroot}%{_datadir}/mysql-test
05db4b
05db4b
which was not originally present in the SPECfile.
05db4b
05db4b
However the MariaDB implementation does not have this issue, even though it has the same SPECfile %check phase code.
05db4b
05db4b
05db4b
===
05db4b
05db4b
In the extended log, you can see '/tmp/XfTFAis2Jl' being created and deleted short after.
05db4b
Even though the script warns about the path length, tries to workaround it; it destroyes that workaround short after and use the too-long path instead.
05db4b
05db4b
I'm not sure whether the output is synchronous, but even if it wasn'tit still looks weird.
05db4b
05db4b
| + cd /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test
05db4b
| Logging: ./mysql-test-run.pl  --verbose --parallel=auto --force --retry=2 --suite-timeout=900 --testcase-timeout=30 --mysqld=--binlog-format=mixed --max-test-fail=5 --report-unstable-tests --clean-vardir --suite=main --mem --skip-test-list=platform-specific-tests.list
05db4b
| Path length (109) is longer than maximum supported length (108) and will be truncated at /usr/lib64/perl5/vendor_perl/Socket.pm line 880.
05db4b
| Too long tmpdir path '/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var/tmp'  creating a shorter one
05db4b
|  - Using tmpdir: '/tmp/XfTFAis2Jl'
05db4b
| > Collecting: main
05db4b
| > testdir: /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/t
05db4b
| > resdir: /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/r
05db4b
| > Collecting: i_main
05db4b
| Removing old var directory
05db4b
| > opt_vardir: /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var
05db4b
| > Removing /builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var/
05db4b
| > Removing /dev/shm/var_933_jfTb
05db4b
| > Removing /tmp/XfTFAis2Jl/
05db4b
| Creating var directory '/builddir/build/BUILDROOT/mysql-8.0.24-1.fc35.x86_64/usr/share/mysql-test/var'
05db4b
| > Creating /dev/shm/var_933_jfTb
05db4b
|  - symlinking 'var' to '/dev/shm/var_933_jfTb'
05db4b
05db4b
05db4b
05db4b
05db4b
--- mysql-8.0.24/mysql-test/mysql-test-run.pl	2021-05-10 04:29:44.391897891 +0200
05db4b
+++ mysql-8.0.24/mysql-test/mysql-test-run.pl_patched	2021-05-10 04:38:51.031702753 +0200
05db4b
@@ -3374,17 +3374,6 @@ sub setup_vardir() {
05db4b
   mkpath("$opt_vardir/tmp");
05db4b
   mkpath($opt_tmpdir) if ($opt_tmpdir ne "$opt_vardir/tmp");
05db4b
 
05db4b
-  # On some operating systems, there is a limit to the length of a
05db4b
-  # UNIX domain socket's path far below PATH_MAX. Don't allow that
05db4b
-  # to happen.
05db4b
-  my $res =
05db4b
-    check_socket_path_length("$opt_tmpdir/mysqld.NN.sock", $opt_parallel);
05db4b
-  if ($res) {
05db4b
-    mtr_error("Socket path '$opt_tmpdir' too long, it would be ",
05db4b
-              "truncated and thus not possible to use for connection to ",
05db4b
-              "MySQL Server. Set a shorter with --tmpdir=<path> option");
05db4b
-  }
05db4b
-
05db4b
   # Copy all files from std_data into var/std_data
05db4b
   # and make them world readable
05db4b
   copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");