commit 81e077a6cea50b04ac9be4f63abd004846653251 from: Thomas Adam date: Tue Mar 08 20:31:07 2022 UTC portable: improve macos compat with bison/openssl Some MacOS systems might not have GNU Bison installed, or have openssl installed. In such instances the host versions of those can be used, with a few tweaks around the edges to make them work. This commit addresses these by: * Relaxing a HAVE_CRYPTO check for __APPLE__, since the inclusion of the machine-specific headers isn't dependent on openssl being installed; * If the non-GNU version of bison on MacOS is being used, define any missing YY* variables, and add a compiler #warning so we log something. This also updates the CI scripts to default to the system versions of bison and removes openssl as a core dependency -- it's more likely openssl is going to be installed, so removing it here will mean we can catch the case for just the MacOS-specific failures, and the inclusion of openssl on other OSes should cover the rest. Noticed by Evan Silberman commit - de3c84b6c8bbf16375d2e224b441bf38fece5b9c commit + 81e077a6cea50b04ac9be4f63abd004846653251 blob - 5a1188d24d06e95fa2a8afc67be7359b7fdfb6f1 blob + 66c1e5ac3b4515700307153d27d644399770fc97 --- .github/ci/before-install.sh +++ .github/ci/before-install.sh @@ -22,9 +22,7 @@ fi if [ "$CIRRUS_OS" = "darwin" ]; then brew install autoconf \ automake \ - bison \ pkg-config \ ncurses \ - openssl \ ossp-uuid fi blob - a51529c96bbd21fc03ecd3acd8ae4225251a1d00 blob + a76d1e8930bc07a69b0c917abf83b12e25a4e87c --- include/got_compat.h +++ include/got_compat.h @@ -139,8 +139,8 @@ void uuid_to_string(uuid_t *, char **, uint32_t *); #include "compat/imsg.h" #endif -/* Include Apple-specific headers when libcrypto is in use. */ -#if defined(HAVE_LIBCRYPTO) && defined(__APPLE__) +/* Include Apple-specific headers. Mostly for crypto.*/ +#if defined(__APPLE__) #define COMMON_DIGEST_FOR_OPENSSL #include #endif blob - deabda5d8aec84464b9d75cbacf2ae77e665af58 blob + 756c326f7d619cfaaa0c5825f8b254e67e6ad4b7 --- libexec/got-read-gotconfig/parse.y +++ libexec/got-read-gotconfig/parse.y @@ -95,6 +95,10 @@ typedef struct { int lineno; } YYSTYPE; +#if defined(__APPLE__) && !defined(YYSTYPE) +#warning "Setting YYSTYPE - is GNU Bison installed?" +#define YYSTYPE YYSTYPE +#endif %} %token ERROR