neko icon indicating copy to clipboard operation
neko copied to clipboard

Build failure on macOS Big Sur

Open fxcoudert opened this issue 4 years ago • 2 comments

neko 2.3.0 fails to build on macOS 11 (Big Sur) with:

==> cmake . -G Ninja -DSTATIC_DEPS=MariaDBConnector -DRELOCATABLE=OFF -DRUN_LDCONFIG=OFF
2409
==> ninja install
2410
Last 150 lines from /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs/neko/02.ninja:
2411
-- Found Git: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/git (found version "2.24.3 (Apple Git-128)") 
2412
-- Check if the system is big endian
2413
-- Searching 16 bit integer
2414
-- Looking for sys/types.h
2415
-- Looking for sys/types.h - found
2416
-- Looking for stdint.h
2417
-- Looking for stdint.h - found
2418
-- Looking for stddef.h
2419
-- Looking for stddef.h - found
2420
-- Check size of unsigned short
2421
-- Check size of unsigned short - done
2422
-- Searching 16 bit integer - Using unsigned short
2423
-- Check if the system is big endian - little endian
2424
-- Looking for include file alloca.h
2425
-- Looking for include file alloca.h - found
2426
-- Looking for include file arpa/inet.h
2427
-- Looking for include file arpa/inet.h - found
2428
-- Looking for include file dlfcn.h
2429
-- Looking for include file dlfcn.h - found
2430
-- Looking for include file fcntl.h
2431
-- Looking for include file fcntl.h - found
2432
-- Looking for include file float.h
2433
-- Looking for include file float.h - found
2434
-- Looking for include file limits.h
2435
-- Looking for include file limits.h - found
2436
-- Looking for include file pwd.h
2437
-- Looking for include file pwd.h - found
2438
-- Looking for include file sched.h
2439
-- Looking for include file sched.h - found
2440
-- Looking for include file select.h
2441
-- Looking for include file select.h - not found
2442
-- Looking for include file signal.h
2443
-- Looking for include file signal.h - found
2444
-- Looking for include file stdlib.h
2445
-- Looking for include file stdlib.h - found
2446
-- Looking for include file string.h
2447
-- Looking for include file string.h - found
2448
-- Looking for include file strings.h
2449
-- Looking for include file strings.h - found
2450
-- Looking for include file sys/ioctl.h
2451
-- Looking for include file sys/ioctl.h - found
2452
-- Looking for include file sys/select.h
2453
-- Looking for include file sys/select.h - found
2454
-- Looking for include file sys/socket.h
2455
-- Looking for include file sys/socket.h - found
2456
-- Looking for include file sys/un.h
2457
-- Looking for include file sys/un.h - found
2458
-- Looking for include file unistd.h
2459
-- Looking for include file unistd.h - found
2460
-- Looking for include file utime.h
2461
-- Looking for include file utime.h - found
2462
-- Looking for include file ucontext.h
2463
-- Looking for include file ucontext.h - not found
2464
-- Looking for alloca
2465
-- Looking for alloca - not found
2466
-- Looking for dlerror
2467
-- Looking for dlerror - found
2468
-- Looking for dlopen
2469
-- Looking for dlopen - found
2470
-- Looking for fcntl
2471
-- Looking for fcntl - found
2472
-- Looking for memcpy
2473
-- Looking for memcpy - found
2474
-- Looking for nl_langinfo
2475
-- Looking for nl_langinfo - found
2476
-- Looking for setlocale
2477
-- Looking for setlocale - found
2478
-- Looking for poll
2479
-- Looking for poll - found
2480
-- Check size of char *
2481
-- Check size of char * - done
2482
-- Check size of int
2483
-- Check size of int - done
2484
-- Check size of long
2485
-- Check size of long - done
2486
-- Check size of long long
2487
-- Check size of long long - done
2488
-- Check size of size_t
2489
-- Check size of size_t - done
2490
-- Check size of uchar
2491
-- Check size of uchar - failed
2492
-- Check size of uint
2493
-- Check size of uint - done
2494
-- Check size of ulong
2495
-- Check size of ulong - failed
2496
-- Check size of int8
2497
-- Check size of int8 - failed
2498
-- Check size of uint8
2499
-- Check size of uint8 - failed
2500
-- Check size of int16
2501
-- Check size of int16 - failed
2502
-- Check size of uint16
2503
-- Check size of uint16 - failed
2504
-- Check size of int32
2505
-- Check size of int32 - failed
2506
-- Check size of uint32
2507
-- Check size of uint32 - failed
2508
-- Check size of int64
2509
-- Check size of int64 - failed
2510
-- Check size of uint64
2511
-- Check size of uint64 - failed
2512
-- Check size of socklen_t
2513
-- Check size of socklen_t - failed
2514
-- Performing Test SOCKET_SIZE_FOUND_socklen_t
2515
-- Performing Test SOCKET_SIZE_FOUND_socklen_t - Success
2516
-- Looking for dlopen
2517
-- Looking for dlopen - found
2518
-- Looking for floor
2519
-- Looking for floor - found
2520
-- Looking for pthread_getspecific
2521
-- Looking for pthread_getspecific - found
2522
-- Looking for gethostbyname_r
2523
-- Looking for gethostbyname_r - not found
2524
-- Looking for gethostbyname_r in nsl_rnsl
2525
-- Looking for gethostbyname_r in nsl_rnsl - not found
2526
-- Looking for setsockopt
2527
-- Looking for setsockopt - found
2528
-- Looking for pthread.h
2529
-- Looking for pthread.h - found
2530
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
2531
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
2532
-- Found Threads: TRUE  
2533
-- Found OpenSSL: /usr/local/opt/[email protected]/lib/libcrypto.dylib (found version "1.1.1i")  
2534
-- TLS library/version: OpenSSL 1.1.1i
2535
-- SYSTEM_LIBS ICONV_LIBRARIES-NOTFOUND;/usr/local/opt/[email protected]/lib/libssl.dylib;/usr/local/opt/[email protected]/lib/libcrypto.dylib
2536
-- Found CURL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/lib/libcurl.tbd (found version "7.64.1")  
2537
-- Dynamic column API support: ON
2538
-- SYSTEM processor: x86_64
2539
-- MariaDB Connector/c configuration:
2540
-- Static PLUGINS mysql_native_password;mysql_old_password;pvio_socket
2541
-- Dynamic PLUGINS dialog;caching_sha2_password;auth_gssapi_client;sha256_password;mysql_clear_password;remote_io
2542
-- CPack generation: TGZ
2543
-- SSL support: OPENSSL Libs: /usr/local/opt/[email protected]/lib/libssl.dylib;/usr/local/opt/[email protected]/lib/libcrypto.dylib
2544
-- Zlib support: yes (using bundled zlib)
2545
-- Installation layout: DEFAULT
2546
-- Include files will be installed in include/mariadb
2547
-- Libraries will be installed in lib/mariadb
2548
-- Binaries will be installed in bin
2549
-- Documentation included from 
2550
-- Required: 
2551
-- Configuring done
2552
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
2553
Please set them or make sure they are set and tested correctly in the CMake files:
2554
ICONV_LIBRARIES (ADVANCED)
2555
    linked by target "libmariadb" in directory /tmp/neko-20201214-18584-66sb5j/neko-2-3-0/libs/src/MariaDBConnector/libmariadb
2556
    linked by target "mariadbclient" in directory /tmp/neko-20201214-18584-66sb5j/neko-2-3-0/libs/src/MariaDBConnector/libmariadb
2557

2558
-- Generating done
2559
CMake Generate step failed.  Build files cannot be regenerated correctly.
2560
ninja: build stopped: subcommand failed.
2561

See full log output at https://github.com/Homebrew/homebrew-core/runs/1546897078

fxcoudert avatar Dec 15 '20 15:12 fxcoudert

-- SYSTEM_LIBS ICONV_LIBRARIES-NOTFOUND

This seems to be part of the problem. For some reason, cmake can't find libiconv. This may have something to do with built-in libraries no longer being visible in the file system on Big Sur.

My impression is that CMake were supposed to have fixed that though, so 🤷.

carlocab avatar Dec 15 '20 19:12 carlocab

That particular issue is actually coming from the downloaded mariadb-connector-c tarball which has a handrolled cmake/FindIconv.cmake file which seems to have problems. The version of mariadb-connector is a bit older than upstream (3.0.9 vs 3.1.9) but I don't think that iconv-detection logic has been improved. Haven't tried, but don't see any diffs that indicate a change

It might also be possible to work around this issue by forcing the values of ICONV_INCLUDE_DIR and ICONV_LIBRARIES when neko runs mariadb-connector's cmakefile (specifically the ExternalProject_Add() call in libs/mysql/CMakeLists.txt

mitchblank avatar Dec 15 '20 22:12 mitchblank

This works for me. It disables the special handling of the libiconv library on Apple platforms. They already removed the special handling of the libiconv headers on Apple platforms years ago in https://github.com/mariadb-corporation/mariadb-connector-c/commit/a57406cb3b0d4d2153fc2c62c90bb72cbf5b369d.

--- cmake/patch_mariadb.cmake.orig	2023-01-12 23:26:04.000000000 -0600
+++ cmake/patch_mariadb.cmake	2023-01-12 23:28:31.000000000 -0600
@@ -23,4 +23,17 @@
 	content ${content}
 )
 
+file(WRITE ${cmakelists} ${content})
+
+set(cmakelists ${mariadb_source}/cmake/FindIconv.cmake)
+
+file(READ ${cmakelists} content)
+
+# Don't handle libiconv differently on Apple platforms.
+string(REPLACE
+	"(APPLE)"
+	"(FALSE)"
+	content ${content}
+)
+
 file(WRITE ${cmakelists} ${content})
\ No newline at end of file

ryandesign avatar Jan 13 '23 06:01 ryandesign

#272 will update MariaDBConnector to 3.3.4, which should fix this build issue.

tobil4sk avatar Apr 09 '23 20:04 tobil4sk