dotnet / dotnet/msbuild

MSBuild incorrectly detects error from ignored error in Makefile .

Open
#2,424 2 comments 0 reactions 1 assignee Claimed by @rainersigwald View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

Hello,

We've noticed issue with MSBuild's error detection for Makefile projects that ignore some of the errors. MSBuild **parses console output** for "errors". Simply "echo error :" will trigger failure. We have Makefile project building FFmpeg and it fails because of that. **Exit code of our build command is 0**, but it still fails due to this output:

```
strip.exe : error : the input file 'libavcodec/x86/proresdsp.o' has no sections [{..}.vcxproj]
make: [{...}/ffmpeg/ffbuild/common.mak:83: libavcodec/x86/proresdsp.o] Error 1 (ignored)
```

Notice the `(ignored)` part? That's because this error is expected and should be ignored and it indeed is ignored. (see minus sign)

common.mak:83
```
%.o: %.asm
$(COMPILE_X86ASM)
-$(if $(ASMSTRIPFLAGS), $(STRIP) $(ASMSTRIPFLAGS) $@)
```

Yet MSBuild after parsing first line with error sets build task to fail state.

I think MSBuild's error parser should be more clever in such cases.

```
Microsoft (R) Build Engine 15.1.1012.6693
```
Regards,
Kacper

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.