facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.92k stars 2.01k forks source link

Fix argument issue on Makefile for clang plugin #1804

Closed hidenorly closed 6 months ago

hidenorly commented 9 months ago

In clang_plugin of makefile, some of arguments aren't escaped with "". Then it's build break on some environment.

The following is error case's example. Then this change will solve the issue with "" escape.

[01:22:22][82676] Building clang plugin OCaml interface... [*ERROR**][82676] *** ERROR 'Building clang plugin OCaml interface' [*ERROR**][82676] *** command: ' make -C /Users/hidenorly/work/infer/facebook-clang-plugins/clang-ocaml build/clang_ast_proj.ml build/clang_ast_proj.mli CC=clang CXX=clang++ -std=gnu++11 CFLAGS="-g -O2" CXXFLAGS="-g -O2" CPP="clang -E" LDFLAGS="" LIBS="" LOCAL_CLANG=/Users/hidenorly/work/infer/facebook-clang-plugins/clang/install/bin/clang CLANG_PREFIX=/Users/hidenorly/work/infer/facebook-clang-plugins/clang/install CLANG_INCLUDES=/Users/hidenorly/work/infer/facebook-clang-plugins/clang/install/include SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ' [*ERROR**][82676] *** CWD: '/Users/hidenorly/work/infer' [*ERROR**][82676] *** stdout:
[*ERROR**][82676] *** stderr:
[*ERROR**][82676] make: invalid option -- =
[*ERROR**][82676] make: invalid option -- g
[*ERROR**][82676] make: invalid option -- u
[*ERROR**][82676] make: invalid option -- +
[*ERROR**][82676] make: invalid option -- +
[*ERROR**][82676] make: invalid option -- 1
[*ERROR**][82676] make: invalid option -- 1
[*ERROR**][82676] Usage: make [options] [target] ...

Since this is makefile, I did build test with ./build-infer.sh clang and ./autogen.sh; ./configure; make And build was success with this modification.

jvillard commented 6 months ago

Thank you @hidenorly , I wish I'd seen this sooner! I did something similar and a bit more extensive in c30c04535058f78d2e7770d1f2cbdd6c180462ea so I believe we can close this one