Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Detect Darwin OS and try to determine lib paths #1

Merged
merged 1 commit into from
Oct 1, 2021
Merged

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Sep 30, 2021

This tries to automatically determine the location of openssl@1.1 and
libssh2 if installed on MacOS using the brew package manager, or
provides a warning with an install / configuration suggestion.

Tested this on MacOS in a VM, and works properly if the user has installed
the libraries using brew. It could also detect cmake, but because that
error is so obvious (given it's the first command), I did not include it
for the sake of simplicity.

This tries to automatically determine the location of `openssl@1.1` and
`libssh2` if installed on MacOS using the brew package manager, or
provides a warning with an install / configuration suggestion.

Signed-off-by: Hidde Beydals <hello@hidde.co>
@hiddeco hiddeco added area/tooling (Developer) tooling related pull requests or issues enhancement New feature or request labels Oct 1, 2021
@hiddeco
Copy link
Member Author

hiddeco commented Oct 1, 2021

@somtochiama who is in the possession of a real 🍏 has tried this on her machine in combination with the source-controller branch from fluxcd/source-controller#437, and it works (within the context of this PR) without any issues:

-- Found OpenSSL: /usr/local/Cellar/openssl@1.1/1.1.1k/lib/libcrypto.dylib (found version "1.1.1k")
...
-- Checking for module 'libssh2'
--   Found libssh2, version 1.9.0
--   Resolved libraries: /usr/local/lib/libssh2.dylib
-- Looking for libssh2_userauth_publickey_frommemory in /usr/local/lib/libssh2.dylib
-- Looking for libssh2_userauth_publickey_frommemory in /usr/local/lib/libssh2.dylib - found
-- Checking for module 'heimdal-gssapi'
--   No package 'heimdal-gssapi' found
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES)
-- Found GSS.framework /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/GSS.framework
-- Looking for iconv_open
-- Looking for iconv_open - not found
-- Found Iconv: -L/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib -liconv
-- Enabled features:
 * nanoseconds, whether to use sub-second file mtimes and ctimes
 * tracing, tracing support
 * threadsafe, threadsafe support
 * HTTPS, using OpenSSL
 * SHA, using CollisionDetection
 * regex, using bundled PCRE
 * http-parser, http-parser support (bundled)
 * zlib, using system zlib
 * SSH, SSH transport support
 * ntlmclient, NTLM authentication support for Unix
 * iconv, iconv encoding conversion support
-- Disabled features:
 * debugpool, debug pool allocator
 * SPNEGO, SPNEGO authentication support
-- Configuring done
-- Generating done

The UX on the side of the source-controller can use some improvements, e.g. to facilitate enforcing the build of the libgit2 dependency in the Git repository while the system version matches, but this shouldn't be handled here.

@hiddeco hiddeco merged commit 59b9b24 into main Oct 1, 2021
@hiddeco hiddeco deleted the macos-detection branch October 1, 2021 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tooling (Developer) tooling related pull requests or issues enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant