Repository: spack/spack

Issue:
Cannot install mysql beause there are two error,how to solve?
I'm trying to install mysql ,but when build, there are two errors:
ocal/spack/var/spack/stage/mysql-5.7.25-3ltbh4ch5ufssm7xhimtix3zy4vnlqku/mysql-5.7.25/sql/item_buff.cc
###   **>> 5945    /usr/bin/ld: cannot find -lboost_system
  >> 5946    /usr/bin/ld: cannot find -lboost_chrono
  >> 5947    collect2: error: ld returned 1 exit status
  >> 5948    make[2]: *** [client/dump/CMakeFiles/mysqlpump.dir/build.make:91: client/dump/mysqlpump] Error 1
     5949    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-t15E3u/spack-build'
  >> 5950    make[1]: *** [CMakeFiles/Makefile2:7559: client/dump/CMakeFiles/mysqlpump.dir/all] Error 2**
     5951    make[1]: *** Waiting for unfinished jobs....
     5952    [ 81%] Building CXX object libmysqld/CMakeFiles/sql_embedded.dir/__/sql/item_cmpfunc.cc.o
     5953    cd /tmp/root/spack-stage/spack-stage-t15E3u/spack-build/libmysqld && /usr/local/spack/lib/spack/env/gcc/g++  -DEMBEDDED_LIBRARY -DHAVE_CONFIG_H -DHAVE_LI
             BEVENT1 -DMYSQL_SERVER -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/tmp/root/spack-stage/spack-stage-t15E3u/spack-build/include -I/usr/local/spack/var/spack/s
             tage/mysql-5.7.25-3ltbh4ch5ufssm7xhimtix3zy4vnlqku/mysql-5.7.25/extra/rapidjson/include -I/tmp/root/spack-stage/spack-stage-t15E3u/spack-build/libbinloge
             vents/include -I/usr/local/spack/var/spack/stage/mysql-5.7.25-3ltbh4ch5ufssm7xhimtix3zy4vnlqku/mysql-5.7.25/libbinlogevents/export -I/usr/local/spack/var
            
         My OS is ubuntu18.04 on ARM64,. Could anyone help me to solve it? Thanks!



Discussion:
on the X86_X64,there are also same errors:
 **>> 6040    /usr/bin/ld: cannot find -lboost_system
  >> 6041    /usr/bin/ld: cannot find -lboost_chrono
  >> 6042    collect2: error: ld returned 1 exit status
  >> 6043    make[2]: *** [client/dump/CMakeFiles/mysqlpump.dir/build.make:91: client/dump/mysqlpump] Error 1
     6044    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-gfLAlM/spack-build'
  >> 6045    make[1]: *** [CMakeFiles/Makefile2:7457: client/dump/CMakeFiles/mysqlpump.dir/all] Error 2**
     6046    make[1]: *** Waiting for unfinished jobs....
     6047    [ 79%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/sync/sync0rw.cc.o
     6048    cd /tmp/root/spack-stage/spack-stage-gfLAlM/spack-build/storage/innobase && /usr/local/spack/lib/spack/env/gcc/g++  -DCOMPILER_HINTS -DHAVE_CONFIG_H -DHA
             VE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE=1 -DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1 -DHAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE=1 -DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1 -DHAVE_
             IB_GCC_SYNC_SYNCHRONISE=1 -DHAVE_IB_LINUX_FUTEX=1 -DHAVE_LIBEVENT1 -DHAVE_LZ4=1 -DHAVE_NANOSLEEP=1 -DHAVE_SCHED_GETCPU=1 -DLINUX_NATIVE_AIO=1 -DMUTEX_EVE
             NT -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/tmp/root/spack-stage/spack-stage-gfLAlM/spack-build/include -I/usr/local/spack/var/spack/stage/mysql-5.7.25-4p
             haerg44dwxat24jetlc2dpkpagwldz/mysql-5.7.25/extra/rapidjson/include -I/tmp/root/spack-stage/spack-stage-gfLAlM/spack-build/libbinlogevents/include -I/usr
             /local/spack/var/spack/stage/mysql-5.7.25-4phaerg44dwxat24jetlc2dpkpagwldz/mysql-5.7.25/libbinlogevents/export -I/usr/local/spack/var/spack/stage/mysql-5
             .7.25-4phaerg44dwxat24jetlc2dpkpagwldz/mysql-5.7.25/extra/lz4 -I/usr/local/spack/var/spack/stage/mysql-5.7.25-4phaerg44dwxat24jetlc2dpkpagwldz/mysql-5.7.
             25/storage/innobase/include -I/usr/local/spack/var/spack/stage/mysql-5.7.25-4phaerg44dwxat24jetlc2dpkpagwldz/mysql-5.7.25/storage/innobase/handler -I/usr
             /local/spack/var/spack/stage/mysql-5.7.25-4phaerg44dwxat
Can you post the output of `spack spec -It mysql@5.7.25` and `spack find -lvp`, and your `packages.yaml` files, if any?
A first guess would be that (probably old) Boost headers are being picked up from the system. Can you verify what boost libraries and/or headers are available on your system and post your full build log as an attachment?
Also, what version of Spack are you using? If you are not using `develop`, can you reproduce in a clean installation with `develop`?
I have successfully reproduced this error in a VM. Attempting to diagnose ...


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/mysql/package.py b/var/spack/repos/builtin/packages/mysql/package.py
--- a/var/spack/repos/builtin/packages/mysql/package.py
+++ b/var/spack/repos/builtin/packages/mysql/package.py
@@ -79,10 +79,10 @@ class Mysql(CMakePackage):
     depends_on('boost@1.66.0 cxxstd=14', type='build', when='@8.0.11 cxxstd=14')
     depends_on('boost@1.66.0 cxxstd=17', type='build', when='@8.0.11 cxxstd=17')
     # 5.7.X
-    depends_on('boost@1.59.0 cxxstd=98', type='build', when='@5.7.0:5.7.999 cxxstd=98')
-    depends_on('boost@1.59.0 cxxstd=11', type='build', when='@5.7.0:5.7.999 cxxstd=11')
-    depends_on('boost@1.59.0 cxxstd=14', type='build', when='@5.7.0:5.7.999 cxxstd=14')
-    depends_on('boost@1.59.0 cxxstd=17', type='build', when='@5.7.0:5.7.999 cxxstd=17')
+    depends_on('boost@1.59.0 cxxstd=98', when='@5.7.0:5.7.999 cxxstd=98')
+    depends_on('boost@1.59.0 cxxstd=11', when='@5.7.0:5.7.999 cxxstd=11')
+    depends_on('boost@1.59.0 cxxstd=14', when='@5.7.0:5.7.999 cxxstd=14')
+    depends_on('boost@1.59.0 cxxstd=17', when='@5.7.0:5.7.999 cxxstd=17')
 
     depends_on('ncurses')
     depends_on('openssl')


Test patch: