diff --git a/infer/models/Makefile b/infer/models/Makefile index 8d9e0d8be..d649c362f 100644 --- a/infer/models/Makefile +++ b/infer/models/Makefile @@ -34,7 +34,7 @@ clean_specs: $(REMOVE) $(SPECS_LIB_DIR)/*.specs $(C_MODELS_FILE) $(CPP_MODELS_FILE) $(OBJC_MODELS_FILE) $(CLANG_SUBDIRS): - $(QUIET)$(MAKE) -C $@ install + $(QUIET)$(MAKE) -C $@ out/report.json # 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 @@ -44,6 +44,9 @@ $(CLANG_MODELS_FILE): $(CLANG_DEPS_NO_MODELS) # Since [CLANG_DEPS_NO_MODELS] is newer than [CLANG_MODELS_FILE], it is also newer than the # previously built clang models, so they will all be rebuilt by the subdirs' Makefiles. $(QUIET)$(MAKE) $(CLANG_SUBDIRS) +# Run the installs sequentially as the models shared some of the C procedures. This can cause +# race conditions when copying specs files inside lib/specs/ + $(QUIET)for clang_dir in $(CLANG_SUBDIRS); do $(MAKE) -C "$$clang_dir" install; done # Maintain the invariant that [CLANG_MODELS_FILE] is newer than the clang models. $(QUIET)touch $@ diff --git a/infer/models/java/Makefile b/infer/models/java/Makefile index be3ef4f28..41a7f309d 100644 --- a/infer/models/java/Makefile +++ b/infer/models/java/Makefile @@ -32,7 +32,7 @@ $(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES) $(QUIET)$(MKDIR_P) $(MODELS_OUT) $(QUIET)rm -f $(JAVA_MODELS_JAR) $(QUIET)$(call silent_on_success,Building Java models,\ - $(INFER_BIN) --jobs 1 --results-dir $(INFER_RESULTS_DIR) --models-mode -- \ + $(INFER_BIN) --results-dir $(INFER_RESULTS_DIR) --models-mode -- \ $(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) \ $(JAVA_SOURCES)) diff --git a/infer/src/base/ZipLib.ml b/infer/src/base/ZipLib.ml index d111bda05..52fd8a0bc 100644 --- a/infer/src/base/ZipLib.ml +++ b/infer/src/base/ZipLib.ml @@ -78,7 +78,7 @@ let zip_libraries = in List.fold ~f:add_zip ~init:[] Config.specs_library in - if Config.biabduction && Sys.file_exists Config.models_jar = `Yes then + if Config.biabduction && not Config.models_mode && Sys.file_exists Config.models_jar = `Yes then mk_zip_lib true Config.models_jar :: zip_libs else zip_libs) )