Ошибка установки glog CocoaPod "configure: error: C препроцессор" / lib / cpp "не проходит проверку работоспособности" - PullRequest
1 голос
/ 28 апреля 2020

При запуске pod install я получаю сообщение об ошибке "configure: error: C препроцессор" / lib / cpp "не проходит проверку работоспособности"

Я попытался вручную экспортировать CXX CPP в местоположение G CC, я пробовал символическую ссылку CPP на G CC. Я переустановил Xcode. Я запустил xcode-select для Xcode.app. Я переустановил Инструменты командной строки.

Я нахожусь: macOS Catalina 10.15.3 Xcode 11.4.1 узел 10.16 npm 6.14.4 ruby 2.7 CocoaPods 1.9.1

Я запустил очистку кэша pod --all, удалил производные данные, удалил node_modules, обновил watchman, brew, много раз. Я не понимаю, почему / lib / cpp является значением по умолчанию вместо g cc.

. Я также могу воспроизвести это с помощью ios -configure-glog. sh из node_modules / реаги- нативный / сторонний / glog-0.3.5 (разработка): $> ../../scripts/ios-configure-glog.sh`

[!] /bin/bash -c
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -e

PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"

if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
    # Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
    # it's better to rely on platform name as fallback because architecture differs between simulator and device

    if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
        CURRENT_ARCH="x86_64"
    else
        CURRENT_ARCH="armv7"
    fi
fi

export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"

# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
    rm test-driver
fi

./configure --host arm-apple-darwin

# Fix build for tvOS
cat << EOF >> src/config.h

/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif

/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif

/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF

# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"

checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk accepts -g... yes
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk option to accept ISO C89... unsupported
checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk... gcc3
checking how to run the C preprocessor... /lib/cpp
/Users/matthudson/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/missing: Unknown `--is-lightweight' option
Try `/Users/matthudson/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/matthudson/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da':


See `config.log' for more details

config.log выходные переменные

## Output variables. ##
## ----------------- ##

ACLOCAL='aclocal-1.14'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR=''
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.14'
AWK='gawk'
CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
CPP='/lib/cpp'
CPPFLAGS=''
CXX='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk'
CXXCPP='/usr/bin/gcc'
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DISABLE_RTTI_FALSE=''
DISABLE_RTTI_TRUE=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENABLE_FRAME_POINTERS_FALSE=''
ENABLE_FRAME_POINTERS_TRUE=''
EXEEXT=''
FGREP=''
GCC_FALSE=''
GCC_TRUE=''
GFLAGS_CFLAGS=''
GFLAGS_LIBS=''
GMOCK_CFLAGS=''
GMOCK_CONFIG=''
GMOCK_LIBS=''
GREP=''
GTEST_CFLAGS=''
GTEST_CONFIG=''
GTEST_LIBS=''
HAVE_GMOCK_FALSE=''
HAVE_GMOCK_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIBTOOL_DEPS=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='makeinfo'
MANIFEST_TOOL=''
MINGW_CFLAGS=''
MKDIR_P='/usr/local/bin/gmkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT='o'
OTOOL64=''
OTOOL=''
PACKAGE='glog'
PACKAGE_BUGREPORT='opensource@google.com'
PACKAGE_NAME='glog'
PACKAGE_STRING='glog 0.3.5'
PACKAGE_TARNAME='glog'
PACKAGE_URL=''
PACKAGE_VERSION='0.3.5'
PATH_SEPARATOR=':'
PTHREAD_CC=''
PTHREAD_CFLAGS=''
PTHREAD_LIBS=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
UNWIND_LIBS=''
VERSION='0.3.5'
X86_64_FALSE=''
X86_64_TRUE=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
ac_cv___attribute___noinline=''
ac_cv___attribute___noreturn=''
ac_cv___attribute___printf_4_5=''
ac_cv_cxx_using_operator=''
ac_cv_have___builtin_expect=''
ac_cv_have___uint16=''
ac_cv_have_inttypes_h=''
ac_cv_have_libgflags=''
ac_cv_have_stdint_h=''
ac_cv_have_systypes_h=''
ac_cv_have_u_int16_t=''
ac_cv_have_uint16_t=''
ac_cv_have_unistd_h=''
ac_google_end_namespace=''
ac_google_namespace=''
ac_google_start_namespace=''
acx_pthread_config=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='arm-apple-darwin'
host_alias='arm-apple-darwin'
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/matthudson/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "glog"
#define PACKAGE_TARNAME "glog"
#define PACKAGE_VERSION "0.3.5"
#define PACKAGE_STRING "glog 0.3.5"
#define PACKAGE_BUGREPORT "opensource@google.com"
#define PACKAGE_URL ""
#define PACKAGE "glog"
#define VERSION "0.3.5"

1 Ответ

1 голос
/ 01 мая 2020

разобрался !! Оказывается, мой CPATH был ошибочно установлен в bash_profile. Я видел этот пост: https://www.bountysource.com/issues/86031070-failing-build-on-macos

И понял, что pod install пытался использовать MacOS.sdk для компиляции вместо iPhone SDK. Я не уверен, почему clang из iPhone SDK правильно подобран в ../../scripts/ios-configure-glog.sh. Он есть в выводе, но по какой-то причине он не использует его для компиляции и по умолчанию / lib / cpp

Само собой разумеется, что комментирование CPATH в bash_profile и перезапуск iterm2 решили проблему.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...