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

error in build-resources/opaque-types should be visible #766

Open
milyin opened this issue Oct 15, 2024 · 1 comment
Open

error in build-resources/opaque-types should be visible #766

milyin opened this issue Oct 15, 2024 · 1 comment
Labels
internal Changes not included in the changelog

Comments

@milyin
Copy link
Contributor

milyin commented Oct 15, 2024

When subproject build-resources/opaque-types fails to build, it's not reported by build.rs
To reproduce go to build-resources/opaque-types/src/lib.rs, add any syntax error, and run "cargo check" in the main project.

The output is:

error: failed to run custom build command for `zenoh-c v1.0.0-dev (/Users/milyin/ZS1/zenoh-c)`

Caused by:
  process didn't exit successfully: `/Users/milyin/ZS1/zenoh-c/target/debug/build/zenoh-c-b8630e9718da3ac4/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at build.rs:1433:28:
  no sigatures found for building generic z_loan_mut
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This doesn't point to real cause of error.
If error was introduced not directly into "build-resources/opaque-types/src/lib.rs" but somehow indirectly, it's hard to find the problem for one who is not aware of this "build-resources/opaque-types" component

@milyin milyin added the internal Changes not included in the changelog label Oct 15, 2024
@DenisBiryukov91
Copy link
Contributor

Actually in this case it does point to the error in build.rs - so it is sort of ok. The issue is if you have some syntax errors - given that cbingen is launched before actual build - you will get very difficult to read error information from cbindgen side instead of rustc - this can be achieved by first make a dry-run ignoring build.rs; the resulting binaries would still be cached by cargo of future reuse - so it should not affect the build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Changes not included in the changelog
Projects
None yet
Development

No branches or pull requests

2 participants