You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
6.3 KiB

# Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
SHELL = bash
# Make infer crash a bit more often to detect issues in the way we call infer within this repo, eg,
# using deprecated options.
export INFER_STRICT_MODE=1
include $(ROOT_DIR)/Makefile.autoconf
PLATFORM = $(shell uname)
move all config variables to Makefile.config.in Summary: Hardcoding `variable@` in Makefiles is Bad™ because it prevents the users from overwriting them easily with `make variable="my custom value"`. The right way to do it is thus: ``` variable = variable@ # then use $(variable) everywhere ``` This diff puts all the `variable = variable@` lines in Makefile.config.in, and changes every occurrence of a `variable@` to `$(variable)` everywhere else. I mostly automated generating this diff. Here are the steps I did: - find out which `variable@`s we use: find . -name 'Makefile*' -exec grep -e '@[^@ []\+@' -o -h \{\} \+ | sort | uniq > config_variables - write this `replace.sh` script to replace every `variable@` with `$(variable)`: ``` #!/bin/sh config_vars_file=$1 shift for line in $(cat $config_vars_file); do var=$(echo $line | tr -d @) sed -i -e "s/$line/\$($var)/g" $@ > /dev/null done ``` - run the script as such: find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \) -exec ./replace.sh config_variables \{\} \+ - put all the `VARIABLE = VARIABLE@` lines in Makefile.config.in - move all `Makefile.in` to `Makefile`, since they don't need to be generated by `./configure` anymore: ``` for i in $(find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \)); do \ rm $(dirname $i)/$(basename $i .in) && git mv $i $(dirname $i)/$(basename $i .in) ; \ done ``` - delete all Makefile except Makefile.config from configure.ac - manually inspect and remove remaining instances of `VAR = $(VAR)` in makefiles, looking at the output of `git grep '^\(\w\+\) = $(\1)'` Reviewed By: jberdine Differential Revision: D3358379 fbshipit-source-id: 5d37f02
9 years ago
COPY = cp -f
move all config variables to Makefile.config.in Summary: Hardcoding `variable@` in Makefiles is Bad™ because it prevents the users from overwriting them easily with `make variable="my custom value"`. The right way to do it is thus: ``` variable = variable@ # then use $(variable) everywhere ``` This diff puts all the `variable = variable@` lines in Makefile.config.in, and changes every occurrence of a `variable@` to `$(variable)` everywhere else. I mostly automated generating this diff. Here are the steps I did: - find out which `variable@`s we use: find . -name 'Makefile*' -exec grep -e '@[^@ []\+@' -o -h \{\} \+ | sort | uniq > config_variables - write this `replace.sh` script to replace every `variable@` with `$(variable)`: ``` #!/bin/sh config_vars_file=$1 shift for line in $(cat $config_vars_file); do var=$(echo $line | tr -d @) sed -i -e "s/$line/\$($var)/g" $@ > /dev/null done ``` - run the script as such: find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \) -exec ./replace.sh config_variables \{\} \+ - put all the `VARIABLE = VARIABLE@` lines in Makefile.config.in - move all `Makefile.in` to `Makefile`, since they don't need to be generated by `./configure` anymore: ``` for i in $(find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \)); do \ rm $(dirname $i)/$(basename $i .in) && git mv $i $(dirname $i)/$(basename $i .in) ; \ done ``` - delete all Makefile except Makefile.config from configure.ac - manually inspect and remove remaining instances of `VAR = $(VAR)` in makefiles, looking at the output of `git grep '^\(\w\+\) = $(\1)'` Reviewed By: jberdine Differential Revision: D3358379 fbshipit-source-id: 5d37f02
9 years ago
COPY_DIR = cp -Rf
REMOVE = rm -f
REMOVE_DIR = rm -rf
ABSOLUTE_ROOT_DIR = $(shell cd $(ROOT_DIR) && pwd)
DEPENDENCIES_DIR = $(ABSOLUTE_ROOT_DIR)/dependencies
DOCKER_DIR = $(ABSOLUTE_ROOT_DIR)/docker
EXAMPLES_DIR = $(ABSOLUTE_ROOT_DIR)/examples
INFER_DIR = $(ABSOLUTE_ROOT_DIR)/infer
FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins
M4_DIR = $(ABSOLUTE_ROOT_DIR)/m4
SCRIPT_DIR = $(ABSOLUTE_ROOT_DIR)/scripts
FCP_CLANG_OCAML_DIR = $(FCP_DIR)/clang-ocaml
ANNOTATIONS_DIR = $(INFER_DIR)/annotations
BIN_DIR = $(INFER_DIR)/bin
ETC_DIR = $(INFER_DIR)/etc
LIB_DIR = $(INFER_DIR)/lib
MAN_DIR = $(INFER_DIR)/man
MODELS_DIR = $(INFER_DIR)/models
JAVA_BUILTINS_DIR = $(MODELS_DIR)/java/builtins
JAVA_MODELS_DIR = $(MODELS_DIR)/java/src
SRC_DIR = $(INFER_DIR)/src
BUILD_DIR = $(INFER_DIR)/_build
JAVA_LIB_DIR = $(LIB_DIR)/java
SPECS_LIB_DIR = $(LIB_DIR)/specs
PYTHON_DIR = $(LIB_DIR)/python
PYTHON_LIB_DIR = $(PYTHON_DIR)/inferlib
CAPTURE_LIB_DIR = $(PYTHON_LIB_DIR)/capture
INFERUNIT_BIN = $(BIN_DIR)/InferUnit
INFER_BIN = $(BIN_DIR)/infer
INFER_COMMANDS = \
infer-analyze \
infer-capture \
infer-compile \
infer-report \
infer-reportdiff \
infer-run \
INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs
INFER_CREATE_TRACEVIEW_LINKS = InferCreateTraceViewLinks
INFER_CREATE_TRACEVIEW_LINKS_BIN = $(BIN_DIR)/$(INFER_CREATE_TRACEVIEW_LINKS)
INFERTRACEBUGS_BIN_RELPATH = infer/bin/inferTraceBugs
INFER_COMMAND_MANUALS = $(INFER_COMMANDS:%=$(MAN_DIR)/man1/%.1)
INFER_MANUAL = $(MAN_DIR)/man1/infer.1
INFER_MANUALS = $(INFER_COMMAND_MANUALS) $(INFER_MANUAL)
INFER_MANUALS_GZIPPED = $(INFER_MANUALS:=.gz)
move all config variables to Makefile.config.in Summary: Hardcoding `variable@` in Makefiles is Bad™ because it prevents the users from overwriting them easily with `make variable="my custom value"`. The right way to do it is thus: ``` variable = variable@ # then use $(variable) everywhere ``` This diff puts all the `variable = variable@` lines in Makefile.config.in, and changes every occurrence of a `variable@` to `$(variable)` everywhere else. I mostly automated generating this diff. Here are the steps I did: - find out which `variable@`s we use: find . -name 'Makefile*' -exec grep -e '@[^@ []\+@' -o -h \{\} \+ | sort | uniq > config_variables - write this `replace.sh` script to replace every `variable@` with `$(variable)`: ``` #!/bin/sh config_vars_file=$1 shift for line in $(cat $config_vars_file); do var=$(echo $line | tr -d @) sed -i -e "s/$line/\$($var)/g" $@ > /dev/null done ``` - run the script as such: find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \) -exec ./replace.sh config_variables \{\} \+ - put all the `VARIABLE = VARIABLE@` lines in Makefile.config.in - move all `Makefile.in` to `Makefile`, since they don't need to be generated by `./configure` anymore: ``` for i in $(find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \)); do \ rm $(dirname $i)/$(basename $i .in) && git mv $i $(dirname $i)/$(basename $i .in) ; \ done ``` - delete all Makefile except Makefile.config from configure.ac - manually inspect and remove remaining instances of `VAR = $(VAR)` in makefiles, looking at the output of `git grep '^\(\w\+\) = $(\1)'` Reviewed By: jberdine Differential Revision: D3358379 fbshipit-source-id: 5d37f02
9 years ago
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
JAVA_HOME=$(USER_JAVA_HOME)
endif
ANDROID_JAR = $(LIB_DIR)/java/android/android-23.jar
GUAVA_JAR = $(DEPENDENCIES_DIR)/java/guava/guava-10.0.1-fork.jar
INFER_ANNOTATIONS_JAR = $(ANNOTATIONS_DIR)/annotations.jar
JACKSON_JAR = $(DEPENDENCIES_DIR)/java/jackson/jackson-2.2.3.jar
JSR_305_JAR = $(DEPENDENCIES_DIR)/java/jsr-305/jsr305.jar
JAVA_MODELS_JAR = $(LIB_DIR)/java/models.jar
JAVA_DEPS_NO_MODELS = \
$(addprefix $(PYTHON_LIB_DIR)/, \
analyze.py bucklib.py config.py issues.py jwlib.py source.py utils.py) \
$(addprefix $(CAPTURE_LIB_DIR)/, util.py) \
$(ANDROID_JAR) $(GUAVA_JAR) $(JACKSON_JAR) $(JSR_305_JAR) $(INFER_ANNOTATIONS_JAR) \
$(INFER_BIN)
JAVA_DEPS = $(JAVA_DEPS_NO_MODELS) $(JAVA_MODELS_JAR)
# markers to keep track of when clang models have been rebuilt
C_MODELS_FILE = $(SPECS_LIB_DIR)/c_models
CPP_MODELS_FILE = $(SPECS_LIB_DIR)/cpp_models
OBJC_MODELS_FILE = $(SPECS_LIB_DIR)/objc_models
CLANG_DEPS_NO_MODELS = \
$(addprefix $(PYTHON_LIB_DIR)/, \
analyze.py config.py issues.py source.py utils.py) \
$(addprefix $(CAPTURE_LIB_DIR)/, util.py) \
$(INFER_BIN)
CLANG_DEPS = $(CLANG_DEPS_NO_MODELS) $(C_MODELS_FILE) $(CPP_MODELS_FILE) \
$(shell find $(MODELS_DIR)/cpp/include -type f)
ifneq ($(XCODE_SELECT),no)
CLANG_DEPS += $(OBJC_MODELS_FILE)
endif
[tests] awesomize make output Summary: Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information. ``` $ make -j 4 test [17:39:18][27290] Facebook setup... [17:39:18][27363] Building checkCopyright... [17:39:18][27443] Validating facebook/... [ 0s][27363] SUCCESS Building checkCopyright [ 0s][27290] SUCCESS Facebook setup [17:39:18][27863] Building clang plugin... [ 0s][27443] SUCCESS Validating facebook/ [ 0s][27863] SUCCESS Building clang plugin [17:39:18][27898] Building clang plugin OCaml interface... [ 0s][27898] SUCCESS Building clang plugin OCaml interface [17:39:18][27974] Testing Infer builds without warnings... [17:39:18][28033] Building native Infer... [ 12s][27974] SUCCESS Testing Infer builds without warnings [17:39:30][28998] Testing Infer toplevel builds... [ 6s][28998] SUCCESS Testing Infer toplevel builds [17:39:36][31417] Running OCaml unit tests... [17:39:36][31456] Testing infer OCaml REPL... [ 6s][31417] SUCCESS Running OCaml unit tests [ 9s][31456] SUCCESS Testing infer OCaml REPL [ 92s][28033] SUCCESS Building native Infer [17:40:50][ 2170] Building Java annotations... [ 0s][ 2170] SUCCESS Building Java annotations [17:40:50][ 2186] Building Infer models... [ 11s][ 2186] SUCCESS Building Infer models [17:41:01][ 2803] Running build assembly test... [17:41:01][ 2861] Running build ck analytics test... [17:41:01][ 2941] Running build ck imports test... [17:41:01][ 3035] Running build clang compilation db escaped test... [ 1s][ 3035] SUCCESS Running build clang compilation db escaped test [17:41:02][ 3139] Running build clang compilation db relpath test... [ 3s][ 2861] SUCCESS Running build ck analytics test [17:41:04][ 3296] Running build clang multiple files test... [*ERROR**][2803] *** ERROR Running build assembly test [*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0) [*ERROR**][2803] *** CWD: /home/jul/infer [*ERROR**][2803] *** stdout: [*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly [*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c [*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly [*ERROR**][2803] Capturing in make/cc mode... [*ERROR**][2803] Starting analysis... [*ERROR**][2803] [*ERROR**][2803] legend: [*ERROR**][2803] "F" analyzing a file [*ERROR**][2803] "." analyzing a procedure [*ERROR**][2803] [*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out [*ERROR**][2803] [*ERROR**][2803] [*ERROR**][2803] No issues found [*ERROR**][2803] [*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed [*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000 [*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100 [*ERROR**][2803] @@ -1 +0,0 @@ [*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()] [*ERROR**][2803] [*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp [*ERROR**][2803] Run the following command to replace the expected test output with the new output: [*ERROR**][2803] [*ERROR**][2803] make -C build_systems/assembly replace [*ERROR**][2803] [*ERROR**][2803] make[1]: *** [test] Error 1 [*ERROR**][2803] *** stderr: Makefile:230: recipe for target 'build_assembly_test' failed make: *** [build_assembly_test] Error 1 make: *** Waiting for unfinished jobs.... [...] ``` Reviewed By: jberdine Differential Revision: D4781857 fbshipit-source-id: cbce26d
8 years ago
INTERACTIVE = $(shell [ -t 0 ] && echo 1)
# remove "jobserver-fds" because it contains "s"...
SILENT = $(findstring s,$(subst jobserver-fds,,$(MAKEFLAGS)))
ifeq (1,$(INTERACTIVE))
TERM_ERROR = $(shell printf '\e[31;1m')
TERM_INFO = $(shell printf '\e[;1m')
TERM_SUCCESS = $(shell printf '\e[;2m')
TERM_RESET = $(shell printf '\e[0m')
endif
ifneq ($(VERBOSE),1)
[tests] awesomize make output Summary: Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information. ``` $ make -j 4 test [17:39:18][27290] Facebook setup... [17:39:18][27363] Building checkCopyright... [17:39:18][27443] Validating facebook/... [ 0s][27363] SUCCESS Building checkCopyright [ 0s][27290] SUCCESS Facebook setup [17:39:18][27863] Building clang plugin... [ 0s][27443] SUCCESS Validating facebook/ [ 0s][27863] SUCCESS Building clang plugin [17:39:18][27898] Building clang plugin OCaml interface... [ 0s][27898] SUCCESS Building clang plugin OCaml interface [17:39:18][27974] Testing Infer builds without warnings... [17:39:18][28033] Building native Infer... [ 12s][27974] SUCCESS Testing Infer builds without warnings [17:39:30][28998] Testing Infer toplevel builds... [ 6s][28998] SUCCESS Testing Infer toplevel builds [17:39:36][31417] Running OCaml unit tests... [17:39:36][31456] Testing infer OCaml REPL... [ 6s][31417] SUCCESS Running OCaml unit tests [ 9s][31456] SUCCESS Testing infer OCaml REPL [ 92s][28033] SUCCESS Building native Infer [17:40:50][ 2170] Building Java annotations... [ 0s][ 2170] SUCCESS Building Java annotations [17:40:50][ 2186] Building Infer models... [ 11s][ 2186] SUCCESS Building Infer models [17:41:01][ 2803] Running build assembly test... [17:41:01][ 2861] Running build ck analytics test... [17:41:01][ 2941] Running build ck imports test... [17:41:01][ 3035] Running build clang compilation db escaped test... [ 1s][ 3035] SUCCESS Running build clang compilation db escaped test [17:41:02][ 3139] Running build clang compilation db relpath test... [ 3s][ 2861] SUCCESS Running build ck analytics test [17:41:04][ 3296] Running build clang multiple files test... [*ERROR**][2803] *** ERROR Running build assembly test [*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0) [*ERROR**][2803] *** CWD: /home/jul/infer [*ERROR**][2803] *** stdout: [*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly [*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c [*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly [*ERROR**][2803] Capturing in make/cc mode... [*ERROR**][2803] Starting analysis... [*ERROR**][2803] [*ERROR**][2803] legend: [*ERROR**][2803] "F" analyzing a file [*ERROR**][2803] "." analyzing a procedure [*ERROR**][2803] [*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out [*ERROR**][2803] [*ERROR**][2803] [*ERROR**][2803] No issues found [*ERROR**][2803] [*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed [*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000 [*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100 [*ERROR**][2803] @@ -1 +0,0 @@ [*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()] [*ERROR**][2803] [*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp [*ERROR**][2803] Run the following command to replace the expected test output with the new output: [*ERROR**][2803] [*ERROR**][2803] make -C build_systems/assembly replace [*ERROR**][2803] [*ERROR**][2803] make[1]: *** [test] Error 1 [*ERROR**][2803] *** stderr: Makefile:230: recipe for target 'build_assembly_test' failed make: *** [build_assembly_test] Error 1 make: *** Waiting for unfinished jobs.... [...] ``` Reviewed By: jberdine Differential Revision: D4781857 fbshipit-source-id: cbce26d
8 years ago
# quiet
QUIET = @
endif
[tests] awesomize make output Summary: Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information. ``` $ make -j 4 test [17:39:18][27290] Facebook setup... [17:39:18][27363] Building checkCopyright... [17:39:18][27443] Validating facebook/... [ 0s][27363] SUCCESS Building checkCopyright [ 0s][27290] SUCCESS Facebook setup [17:39:18][27863] Building clang plugin... [ 0s][27443] SUCCESS Validating facebook/ [ 0s][27863] SUCCESS Building clang plugin [17:39:18][27898] Building clang plugin OCaml interface... [ 0s][27898] SUCCESS Building clang plugin OCaml interface [17:39:18][27974] Testing Infer builds without warnings... [17:39:18][28033] Building native Infer... [ 12s][27974] SUCCESS Testing Infer builds without warnings [17:39:30][28998] Testing Infer toplevel builds... [ 6s][28998] SUCCESS Testing Infer toplevel builds [17:39:36][31417] Running OCaml unit tests... [17:39:36][31456] Testing infer OCaml REPL... [ 6s][31417] SUCCESS Running OCaml unit tests [ 9s][31456] SUCCESS Testing infer OCaml REPL [ 92s][28033] SUCCESS Building native Infer [17:40:50][ 2170] Building Java annotations... [ 0s][ 2170] SUCCESS Building Java annotations [17:40:50][ 2186] Building Infer models... [ 11s][ 2186] SUCCESS Building Infer models [17:41:01][ 2803] Running build assembly test... [17:41:01][ 2861] Running build ck analytics test... [17:41:01][ 2941] Running build ck imports test... [17:41:01][ 3035] Running build clang compilation db escaped test... [ 1s][ 3035] SUCCESS Running build clang compilation db escaped test [17:41:02][ 3139] Running build clang compilation db relpath test... [ 3s][ 2861] SUCCESS Running build ck analytics test [17:41:04][ 3296] Running build clang multiple files test... [*ERROR**][2803] *** ERROR Running build assembly test [*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0) [*ERROR**][2803] *** CWD: /home/jul/infer [*ERROR**][2803] *** stdout: [*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly [*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c [*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly [*ERROR**][2803] Capturing in make/cc mode... [*ERROR**][2803] Starting analysis... [*ERROR**][2803] [*ERROR**][2803] legend: [*ERROR**][2803] "F" analyzing a file [*ERROR**][2803] "." analyzing a procedure [*ERROR**][2803] [*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out [*ERROR**][2803] [*ERROR**][2803] [*ERROR**][2803] No issues found [*ERROR**][2803] [*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed [*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000 [*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100 [*ERROR**][2803] @@ -1 +0,0 @@ [*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()] [*ERROR**][2803] [*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp [*ERROR**][2803] Run the following command to replace the expected test output with the new output: [*ERROR**][2803] [*ERROR**][2803] make -C build_systems/assembly replace [*ERROR**][2803] [*ERROR**][2803] make[1]: *** [test] Error 1 [*ERROR**][2803] *** stderr: Makefile:230: recipe for target 'build_assembly_test' failed make: *** [build_assembly_test] Error 1 make: *** Waiting for unfinished jobs.... [...] ``` Reviewed By: jberdine Differential Revision: D4781857 fbshipit-source-id: cbce26d
8 years ago
MAKE := $(MAKE) INTERACTIVE=$(INTERACTIVE)
# 99999 PIDs ought to be enough for anybody, but check if pid_max can be found just in case
MAX_PID_SIZE = \
$(shell PID_MAX=$$(cat /proc/sys/kernel/pid_max 2>/dev/null); echo $${\#PID_MAX} || echo 5)
# Arguments:
# $(1) is a string describing the command
# $(2) is the command to run
#
ifeq ($(VERBOSE),1)
define silent_on_success
$(2)
endef
else
[tests] awesomize make output Summary: Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information. ``` $ make -j 4 test [17:39:18][27290] Facebook setup... [17:39:18][27363] Building checkCopyright... [17:39:18][27443] Validating facebook/... [ 0s][27363] SUCCESS Building checkCopyright [ 0s][27290] SUCCESS Facebook setup [17:39:18][27863] Building clang plugin... [ 0s][27443] SUCCESS Validating facebook/ [ 0s][27863] SUCCESS Building clang plugin [17:39:18][27898] Building clang plugin OCaml interface... [ 0s][27898] SUCCESS Building clang plugin OCaml interface [17:39:18][27974] Testing Infer builds without warnings... [17:39:18][28033] Building native Infer... [ 12s][27974] SUCCESS Testing Infer builds without warnings [17:39:30][28998] Testing Infer toplevel builds... [ 6s][28998] SUCCESS Testing Infer toplevel builds [17:39:36][31417] Running OCaml unit tests... [17:39:36][31456] Testing infer OCaml REPL... [ 6s][31417] SUCCESS Running OCaml unit tests [ 9s][31456] SUCCESS Testing infer OCaml REPL [ 92s][28033] SUCCESS Building native Infer [17:40:50][ 2170] Building Java annotations... [ 0s][ 2170] SUCCESS Building Java annotations [17:40:50][ 2186] Building Infer models... [ 11s][ 2186] SUCCESS Building Infer models [17:41:01][ 2803] Running build assembly test... [17:41:01][ 2861] Running build ck analytics test... [17:41:01][ 2941] Running build ck imports test... [17:41:01][ 3035] Running build clang compilation db escaped test... [ 1s][ 3035] SUCCESS Running build clang compilation db escaped test [17:41:02][ 3139] Running build clang compilation db relpath test... [ 3s][ 2861] SUCCESS Running build ck analytics test [17:41:04][ 3296] Running build clang multiple files test... [*ERROR**][2803] *** ERROR Running build assembly test [*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0) [*ERROR**][2803] *** CWD: /home/jul/infer [*ERROR**][2803] *** stdout: [*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly [*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c [*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly [*ERROR**][2803] Capturing in make/cc mode... [*ERROR**][2803] Starting analysis... [*ERROR**][2803] [*ERROR**][2803] legend: [*ERROR**][2803] "F" analyzing a file [*ERROR**][2803] "." analyzing a procedure [*ERROR**][2803] [*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out [*ERROR**][2803] [*ERROR**][2803] [*ERROR**][2803] No issues found [*ERROR**][2803] [*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed [*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000 [*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100 [*ERROR**][2803] @@ -1 +0,0 @@ [*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()] [*ERROR**][2803] [*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp [*ERROR**][2803] Run the following command to replace the expected test output with the new output: [*ERROR**][2803] [*ERROR**][2803] make -C build_systems/assembly replace [*ERROR**][2803] [*ERROR**][2803] make[1]: *** [test] Error 1 [*ERROR**][2803] *** stderr: Makefile:230: recipe for target 'build_assembly_test' failed make: *** [build_assembly_test] Error 1 make: *** Waiting for unfinished jobs.... [...] ``` Reviewed By: jberdine Differential Revision: D4781857 fbshipit-source-id: cbce26d
8 years ago
# Run and time the command and redirect its stdout and stderr to files. Display info about the
# command only in case of error. Try to be as helpful as possible in the error case.
#
# The PID of the process is used in the names of the output files, and as a prefix for each error
# message so that it's possible to piece error messages together even when they are interleaved with
# other messages from concurrent `make` processes.
#
# Detect if we are already wrapped inside a silent_on_success call and try not to clutter the output
# too much in that case.
define silent_on_success
if [ "$$INSIDE_SILENT_ON_SUCCESS" = 1 ]; then \
echo "*** inner $(1)"; \
echo "*** inner command: $(2)"; \
echo "*** inner CWD: $(CURDIR)"; \
($(2)); \
exit $$?; \
fi; \
export INSIDE_SILENT_ON_SUCCESS=1; \
HASH="$$$$"; \
UNIX_START_DATE=$$(date +"%s"); \
HUMAN_START_DATE=$$(date +"%H:%M:%S"); \
if [ -z $(SILENT) ]; then \
printf "[%s][%$(MAX_PID_SIZE)s] $(TERM_INFO)%s...$(TERM_RESET)\n" \
"$$HUMAN_START_DATE" "$$HASH" "$(1)"; \
[tests] awesomize make output Summary: Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information. ``` $ make -j 4 test [17:39:18][27290] Facebook setup... [17:39:18][27363] Building checkCopyright... [17:39:18][27443] Validating facebook/... [ 0s][27363] SUCCESS Building checkCopyright [ 0s][27290] SUCCESS Facebook setup [17:39:18][27863] Building clang plugin... [ 0s][27443] SUCCESS Validating facebook/ [ 0s][27863] SUCCESS Building clang plugin [17:39:18][27898] Building clang plugin OCaml interface... [ 0s][27898] SUCCESS Building clang plugin OCaml interface [17:39:18][27974] Testing Infer builds without warnings... [17:39:18][28033] Building native Infer... [ 12s][27974] SUCCESS Testing Infer builds without warnings [17:39:30][28998] Testing Infer toplevel builds... [ 6s][28998] SUCCESS Testing Infer toplevel builds [17:39:36][31417] Running OCaml unit tests... [17:39:36][31456] Testing infer OCaml REPL... [ 6s][31417] SUCCESS Running OCaml unit tests [ 9s][31456] SUCCESS Testing infer OCaml REPL [ 92s][28033] SUCCESS Building native Infer [17:40:50][ 2170] Building Java annotations... [ 0s][ 2170] SUCCESS Building Java annotations [17:40:50][ 2186] Building Infer models... [ 11s][ 2186] SUCCESS Building Infer models [17:41:01][ 2803] Running build assembly test... [17:41:01][ 2861] Running build ck analytics test... [17:41:01][ 2941] Running build ck imports test... [17:41:01][ 3035] Running build clang compilation db escaped test... [ 1s][ 3035] SUCCESS Running build clang compilation db escaped test [17:41:02][ 3139] Running build clang compilation db relpath test... [ 3s][ 2861] SUCCESS Running build ck analytics test [17:41:04][ 3296] Running build clang multiple files test... [*ERROR**][2803] *** ERROR Running build assembly test [*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0) [*ERROR**][2803] *** CWD: /home/jul/infer [*ERROR**][2803] *** stdout: [*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly [*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c [*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly [*ERROR**][2803] Capturing in make/cc mode... [*ERROR**][2803] Starting analysis... [*ERROR**][2803] [*ERROR**][2803] legend: [*ERROR**][2803] "F" analyzing a file [*ERROR**][2803] "." analyzing a procedure [*ERROR**][2803] [*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out [*ERROR**][2803] [*ERROR**][2803] [*ERROR**][2803] No issues found [*ERROR**][2803] [*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed [*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000 [*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100 [*ERROR**][2803] @@ -1 +0,0 @@ [*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()] [*ERROR**][2803] [*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp [*ERROR**][2803] Run the following command to replace the expected test output with the new output: [*ERROR**][2803] [*ERROR**][2803] make -C build_systems/assembly replace [*ERROR**][2803] [*ERROR**][2803] make[1]: *** [test] Error 1 [*ERROR**][2803] *** stderr: Makefile:230: recipe for target 'build_assembly_test' failed make: *** [build_assembly_test] Error 1 make: *** Waiting for unfinished jobs.... [...] ``` Reviewed By: jberdine Differential Revision: D4781857 fbshipit-source-id: cbce26d
8 years ago
fi; \
$(MKDIR_P) $(ABSOLUTE_ROOT_DIR)/_build_logs; \
($(2)) 1>$(ABSOLUTE_ROOT_DIR)/_build_logs/cmd-$$HASH.out \
2>$(ABSOLUTE_ROOT_DIR)/_build_logs/cmd-$$HASH.err; \
ERRCODE=$$?; \
if [ $$ERRCODE != 0 ]; then \
echo "$(TERM_ERROR)[*ERROR**][$$HASH] *** ERROR $(1)$(TERM_RESET)" >&2; \
echo "$(TERM_ERROR)[*ERROR**][$$HASH] *** command: $(2)$(TERM_RESET)" >&2; \
echo "$(TERM_ERROR)[*ERROR**][$$HASH] *** CWD: $(CURDIR)$(TERM_RESET)" >&2; \
echo "$(TERM_ERROR)[*ERROR**][$$HASH] *** stdout:$(TERM_RESET)" >&2; \
sed -e "s/^\(.*\)$$/$(TERM_ERROR)[*ERROR**][$$HASH]$(TERM_RESET) \1/" \
$(ABSOLUTE_ROOT_DIR)/_build_logs/cmd-$$HASH.out; >&2; \
echo "$(TERM_ERROR)[*ERROR**][$$HASH] *** stderr:$(TERM_RESET)" >&2; \
sed -e "s/^\(.*\)$$/$(TERM_ERROR)[*ERROR**][$$HASH]$(TERM_RESET) \1/" \
$(ABSOLUTE_ROOT_DIR)/_build_logs/cmd-$$HASH.err; >&2; \
exit 1; \
elif [ -z $(SILENT) ]; then \
UNIX_END_DATE=$$(date +"%s"); \
printf '[%7ss][%$(MAX_PID_SIZE)s] $(TERM_SUCCESS)SUCCESS %s$(TERM_RESET)\n' \
"$$(($$UNIX_END_DATE - $$UNIX_START_DATE))" "$$HASH" "$(1)"; \
[tests] awesomize make output Summary: Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information. ``` $ make -j 4 test [17:39:18][27290] Facebook setup... [17:39:18][27363] Building checkCopyright... [17:39:18][27443] Validating facebook/... [ 0s][27363] SUCCESS Building checkCopyright [ 0s][27290] SUCCESS Facebook setup [17:39:18][27863] Building clang plugin... [ 0s][27443] SUCCESS Validating facebook/ [ 0s][27863] SUCCESS Building clang plugin [17:39:18][27898] Building clang plugin OCaml interface... [ 0s][27898] SUCCESS Building clang plugin OCaml interface [17:39:18][27974] Testing Infer builds without warnings... [17:39:18][28033] Building native Infer... [ 12s][27974] SUCCESS Testing Infer builds without warnings [17:39:30][28998] Testing Infer toplevel builds... [ 6s][28998] SUCCESS Testing Infer toplevel builds [17:39:36][31417] Running OCaml unit tests... [17:39:36][31456] Testing infer OCaml REPL... [ 6s][31417] SUCCESS Running OCaml unit tests [ 9s][31456] SUCCESS Testing infer OCaml REPL [ 92s][28033] SUCCESS Building native Infer [17:40:50][ 2170] Building Java annotations... [ 0s][ 2170] SUCCESS Building Java annotations [17:40:50][ 2186] Building Infer models... [ 11s][ 2186] SUCCESS Building Infer models [17:41:01][ 2803] Running build assembly test... [17:41:01][ 2861] Running build ck analytics test... [17:41:01][ 2941] Running build ck imports test... [17:41:01][ 3035] Running build clang compilation db escaped test... [ 1s][ 3035] SUCCESS Running build clang compilation db escaped test [17:41:02][ 3139] Running build clang compilation db relpath test... [ 3s][ 2861] SUCCESS Running build ck analytics test [17:41:04][ 3296] Running build clang multiple files test... [*ERROR**][2803] *** ERROR Running build assembly test [*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0) [*ERROR**][2803] *** CWD: /home/jul/infer [*ERROR**][2803] *** stdout: [*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly [*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c [*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly [*ERROR**][2803] Capturing in make/cc mode... [*ERROR**][2803] Starting analysis... [*ERROR**][2803] [*ERROR**][2803] legend: [*ERROR**][2803] "F" analyzing a file [*ERROR**][2803] "." analyzing a procedure [*ERROR**][2803] [*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out [*ERROR**][2803] [*ERROR**][2803] [*ERROR**][2803] No issues found [*ERROR**][2803] [*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed [*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly' [*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000 [*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100 [*ERROR**][2803] @@ -1 +0,0 @@ [*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()] [*ERROR**][2803] [*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp [*ERROR**][2803] Run the following command to replace the expected test output with the new output: [*ERROR**][2803] [*ERROR**][2803] make -C build_systems/assembly replace [*ERROR**][2803] [*ERROR**][2803] make[1]: *** [test] Error 1 [*ERROR**][2803] *** stderr: Makefile:230: recipe for target 'build_assembly_test' failed make: *** [build_assembly_test] Error 1 make: *** Waiting for unfinished jobs.... [...] ``` Reviewed By: jberdine Differential Revision: D4781857 fbshipit-source-id: cbce26d
8 years ago
fi
endef
endif