[MDEV-28107] S3 doesn't build if CURL is in non-default location Created: 2022-03-16  Updated: 2022-04-04  Resolved: 2022-04-04

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Storage Engine - S3
Affects Version/s: 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.5.16, 10.6.8, 10.7.4

Type: Bug Priority: Blocker
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-28104 Typo in storage/maria/s3_func.c: 'FN_... Closed
relates to MDEV-28106 S3 tries to include thread.h while co... Closed

 Description   

If a path to CURL has to be provided explicitly via cmake options, S3 is able to recognize the presence of CURL, but later cannot find included files.

  C:\_home\10.6x\storage\maria\libmarias3\libmarias3/marias3.h(26,10): error C1083:  Cannot open include file: 'curl/curl.h': No such file or directory [C:\_home\10.6x\storage\maria\aria.vcxproj]
C:\_home\10.6x\storage\maria\libmarias3\libmarias3/marias3.h(26,10): error C1083: #include <curl/curl.h> [C:\_home\10.6x\storage\maria\aria.vcxproj]
...

The files are there and other components find them.

This seems to be fixing the problem, although I'm not sure whether it's the right way:

diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index 284837403d9..9dfdfd42171 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -122,6 +122,7 @@ IF(NOT PLUGIN_S3 STREQUAL NO)
 ENDIF()
 
 IF (CURL_FOUND AND NOT APPLE)
+  INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
   LINK_DIRECTORIES(${PC_CURL_LIBDIR})
   MYSQL_ADD_PLUGIN(s3 ha_s3.cc ${S3_SOURCES} COMPONENT s3-engine
     LINK_LIBRARIES curl z STORAGE_ENGINE NOT_EMBEDDED CONFIG s3.cnf)

The failure is from Windows, but I guess it may happen elsewhere.


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