Bug #93755 Compilation error using -DWITH_LZMA=system
Submitted: 28 Dec 2018 13:53 Modified: 15 Jan 18:32
Reporter: Przemysław Skibiński (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.13 OS:Ubuntu
Assigned to: CPU Architecture:Any

[28 Dec 2018 13:53] Przemysław Skibiński
Description:
cmake returns:
CMake Error at cmake/lzma.cmake:57 (MESSAGE):
  Cannot find system lzma libraries.
Call Stack (most recent call first):
  CMakeLists.txt:915 (MYSQL_CHECK_LZMA)

while "apt-get install liblzma-dev" prints:
liblzma-dev is already the newest version (5.2.2-1.3).

How to repeat:
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DREPRODUCIBLE_BUILD=OFF -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_LZMA=system

Suggested fix:
diff --git a/cmake/lzma.cmake b/cmake/lzma.cmake
index 887cf472a86..7aaf15aa5e6 100644
--- a/cmake/lzma.cmake
+++ b/cmake/lzma.cmake
@@ -25,6 +25,9 @@
 
 MACRO (FIND_SYSTEM_LZMA)
   FIND_PATH(PATH_TO_LZMA NAMES lzma/lzma.h)
+  IF (NOT PATH_TO_LZMA)
+    FIND_PATH(PATH_TO_LZMA NAMES lzma.h)
+  ENDIF()
   FIND_LIBRARY(LZMA_SYSTEM_LIBRARY NAMES lzma)
   IF (PATH_TO_LZMA AND LZMA_SYSTEM_LIBRARY)
     SET(SYSTEM_LZMA_FOUND 1)
[28 Dec 2018 15:04] Miguel Solorzano
Thank you for the bug report.
miguel@tikal:~/bug/mysql-8.0.13 $ sudo apt-get install lzma*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'lzma-alone' for glob 'lzma*'
Note, selecting 'lzma-dev' for glob 'lzma*'
Note, selecting 'lzma' for glob 'lzma*'
lzma is already the newest version (9.22-2.1).
The following NEW packages will be installed:
  lzma-alone lzma-dev zlib1g-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 286 kB of archives.
After this operation, 836 kB of additional disk space will be used.
Get:1 http://br.archive.ubuntu.com/ubuntu cosmic/universe amd64 lzma-alone amd64 9.22-2.1 [69,0 kB]
Get:2 http://br.archive.ubuntu.com/ubuntu cosmic/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-0ubuntu2 [176 kB]
Get:3 http://br.archive.ubuntu.com/ubuntu cosmic/universe amd64 lzma-dev all 9.22-2.1 [41,6 kB]
Fetched 286 kB in 0s (3.040 kB/s)
Selecting previously unselected package lzma-alone.
(Reading database ... 231857 files and directories currently installed.)
Preparing to unpack .../lzma-alone_9.22-2.1_amd64.deb ...
Unpacking lzma-alone (9.22-2.1) ...
Selecting previously unselected package zlib1g-dev:amd64.
Preparing to unpack .../zlib1g-dev_1%3a1.2.11.dfsg-0ubuntu2_amd64.deb ...
Unpacking zlib1g-dev:amd64 (1:1.2.11.dfsg-0ubuntu2) ...
Selecting previously unselected package lzma-dev.
Preparing to unpack .../lzma-dev_9.22-2.1_all.deb ...
Unpacking lzma-dev (9.22-2.1) ...
Setting up lzma-alone (9.22-2.1) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-0ubuntu2) ...
Setting up lzma-dev (9.22-2.1) ...

-- OpenSSL include: /usr/include
-- OpenSSL lib:
CMake Error at cmake/lzma.cmake:57 (MESSAGE):
  Cannot find system lzma libraries.
Call Stack (most recent call first):
  CMakeLists.txt:915 (MYSQL_CHECK_LZMA)

-- Configuring incomplete, errors occurred!
[15 Jan 18:32] Paul Dubois
Posted by developer:
 
Fixed in 8.0.15.

The WITH_LZMA CMake option was removed.