bacon icon indicating copy to clipboard operation
bacon copied to clipboard

Count "failed to run custom build command" as error?

Open nc7s opened this issue 9 months ago • 5 comments

When debugging a project, I opened bacon alongside my editor as usual. bacon said:

[ripasso] [check] [1 warning]

but then I found out that one of the dependencies failed to build.rs:

error: failed to run custom build command for `libgpg-error-sys v0.6.2`

Caused by:
  process didn't exit successfully: `/home/i/works/debcargo-conf/build/ripasso/target/debug/build/libgpg-error-sys-9b3670d237bb0344/build-script-build` (exit status: 1)
  --- stdout
(.. omitted)
  --- stderr
  Error: PkgConfig(
  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags gpg-error 'gpg-error >= 1.12'

  The system library `gpg-error` required by crate `libgpg-error-sys` was not found.
(.. omitted)
  )

IMHO it would be helpful if such situations could be detected and counted as an error.

nc7s avatar Mar 04 '25 10:03 nc7s

To make it easier to handle that problem, can you build and share a simple reproduction case ?

Canop avatar Mar 04 '25 10:03 Canop

Basically building any project that depends on some -sys crate, that is, a C/C++ shared library, without first installing such a library.

A minimal reproducer is an empty cargo new project depending on gpg-error.

nc7s avatar Mar 04 '25 10:03 nc7s

Uh, this "reproducer" actually correctly showed "Command error code: 101".

My case was ripasso, which requires a clone but works to demonstrate the problem.

nc7s avatar Mar 04 '25 10:03 nc7s

There's probably more to do to reproduce:

Image

Canop avatar Mar 06 '25 15:03 Canop

Hmm, this seems to happen fairly intermittently, and the problem actually lies in cargo, which occasionally returns with status code 0 even when there are errors. Should be directed to cargo. It'd still be nice if bacon could handle this, but probably not worth it.

bacon:

screenshot of one bacon check run where build.rs failed to run but bacon did not turn red

cargo:

screenshot of one cargo check run with a status code of 0, even though there are errors

nc7s avatar Mar 06 '25 16:03 nc7s