Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld_logger result is different with the latest version "make" #2689

Closed
bruntib opened this issue Apr 18, 2020 · 0 comments · Fixed by #2911
Closed

ld_logger result is different with the latest version "make" #2689

bruntib opened this issue Apr 18, 2020 · 0 comments · Fixed by #2911

Comments

@bruntib
Copy link
Contributor

bruntib commented Apr 18, 2020

When logging a one liner "Hello World" with a simple Makefile then the g++ invocation should be in the compilation database JSON file. This works fine until make version 4.3. From this version cc1plus is logged:

// main.cpp
int main() {}
# Makefile
all:
  g++ main.cpp
CodeChecker log -b make -o build.json

The resulting build.json is different when using make 4.3 which is the current version under Arch Linux.

The practical problem with this behavior is that when cc1plus is logged then that command has a temporary output file: cc1plus <blabla> main.cpp -o /tmp/<random_string>.s. Since this build command is the part of the hash value which goes to the .plist file name, every new analysis results a new .plist file. This means that a fixed report can't be indicated as resolved, because the previous .plist file (which belongs to the previous build command with the random output filename) will still contain that report.
For this reason detection status related functional tests fail on Arch Linux.

I think this will be a serous issue when the make commands will be upgraded in the CI systems using CodeChecker.

The change was introduced in make 4.3 because the process execution was changed.
The behavior depend on how make was built. There is a configure option which can be used to build make with the old behavior.

* GNU make will now use posix_spawn() on systems where it is available.
  If you prefer to use fork/exec even on systems where posix_spawn() is
  present, you can use the --disable-posix-spawn option to configure.
  Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant