Closed harmim closed 4 years ago
You may need to install the Xcode command line tools with xcode-select --install
. Does that help?
Well, I'm aware of it and it should be installed.
$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
I have just hit the very same problem. I can see the file NSObject.h in the directory /usr/include/objc on my machine, but, apparently, that does not help.
Btw., I got the same result using ./autogen.sh and ./configure.
same error
In between, we resolved the problem with Dominik by commenting out all references to ObjectiveC in the infer/models/Makefile file in the distribution of Infer. This is, we commented out all lines containing OBJC or OBJCPP. It is a dirty hack, but it worked perfectly for us (and we are, anyway, currently not interested in ObjectiveC).
same error. How to resolve it?
same error. How to resolve it?
Have you tried the way I mentioned in my comment above? I mean this comment https://github.com/facebook/infer/issues/1002#issuecomment-448507844.
I have tried that, but it did not work in my case. My mac is macOS Mojave Version 10.14.2 (18C54)
I have the very same version. Hard to say why it fails. For completeness, here is the full contents of my infer/models/Makefile:
# Copyright (c) 2015-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
ROOT_DIR = ../..
include $(ROOT_DIR)/Makefile.config
C_MODELS_DIR = c/src
CPP_MODELS_DIR = cpp/src
JAVA_MODELS_DIR = java
OBJC_MODELS_DIR = objc/src
OBJCPP_MODELS_DIR = objcpp/src
MODELS_INFER_OUT = infer-out
MODELS_INFER_OPTIONS = --jobs 1 --biabduction-only --results-dir $(MODELS_INFER_OUT) --models-mode
all:
.PHONY: clean_specs
clean_specs:
$(REMOVE) $(SPECS_LIB_DIR)/*.specs $(MODELS_RESULTS_FILE)
# clang models specs only for now
# The clang deps have changed, so the models need to be rebuilt. If infer itself has changed, we
# need to nuke the previous specs files in case the serialization has changed, otherwise we might
# encounter a segfault reading them.
$(MODELS_RESULTS_FILE): $(MAKEFILE_LIST) $(CLANG_DEPS_NO_MODELS)
$(QUIET)$(MAKE) clean_specs
$(QUIET)$(REMOVE_DIR) $(MODELS_INFER_OUT)
# [make clean] each time to recompile all the models
ifeq ($(BUILD_C_ANALYZERS),yes)
$(QUIET)$(MAKE) -C $(C_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(CPP_MODELS_DIR) clean
ifneq (no, $(XCODE_SELECT))
# $(QUIET)$(MAKE) -C $(OBJC_MODELS_DIR) clean
# $(QUIET)$(MAKE) -C $(OBJCPP_MODELS_DIR) clean
endif
$(QUIET)$(call silent_on_success,Capturing C models,\
$(INFER_BIN) capture $(MODELS_INFER_OPTIONS) --continue -- $(MAKE) -C $(C_MODELS_DIR) all)
$(QUIET)$(call silent_on_success,Capturing C++ models,\
$(INFER_BIN) capture $(MODELS_INFER_OPTIONS) --continue -- $(MAKE) -C $(CPP_MODELS_DIR) all)
ifneq (no, $(XCODE_SELECT))
# $(QUIET)$(call silent_on_success,Capturing ObjCPP models,\
$(INFER_BIN) capture $(MODELS_INFER_OPTIONS) --continue -- $(MAKE) -C $(OBJCPP_MODELS_DIR) all)
# $(QUIET)$(call silent_on_success,Capturing ObjC models,\
$(INFER_BIN) capture $(MODELS_INFER_OPTIONS) --continue -- $(MAKE) -C $(OBJC_MODELS_DIR) all)
endif
endif
$(QUIET)$(call silent_on_success,Analyzing clang models,\
$(INFER_BIN) analyze $(MODELS_INFER_OPTIONS))
$(QUIET)$(INSTALL_DATA) $(MODELS_INFER_OUT)/specs/*.specs $(SPECS_LIB_DIR)
$(QUIET)touch $@
.PHONY: java
java:
$(QUIET)$(MAKE) -C $@ install
ifeq ($(BUILD_C_ANALYZERS),yes)
all: $(MODELS_RESULTS_FILE)
endif
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
all: java
endif
.PHONY: clean
clean: clean_specs
$(QUIET)$(MAKE) -C $(JAVA_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(C_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(CPP_MODELS_DIR) clean
ifneq (no, $(XCODE_SELECT))
# $(QUIET)$(MAKE) -C $(OBJC_MODELS_DIR) clean
# $(QUIET)$(MAKE) -C $(OBJCPP_MODELS_DIR) clean
endif
I cannot reproduce this issue. Has anyone who encountered it managed to solve it? For completeness sake I did the following to get infer to build with Mojave:
export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Tried it out on a clean system. Looks like the full Xcode.app provides that header file (my build failed with same error with only xcode CLT installed, but succeeds with the app).
I think this issue has been solved, maybe by 346c89c71748281dd38042226ebb97348516bcf7.
Note: resolved by PR https://github.com/facebook/infer/pull/1345.
Command:
./build-infer.sh clang
OS: macOS 10.13.6