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

feat(blueprint-metadata): nicer errors #621

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

Serial-ATA
Copy link
Contributor

This only adds error messages for some cases. Many others are still just panics.

This also fixes the issue of missing metadata producing an empty BlueprintMetadata and allowing the crate to continue building. It's now a hard error.

Removing the metadata from incredible-squaring yields:

warning: incredible-squaring-blueprint@0.1.1: Failed to generate blueprint metadata: Blueprint metadata not found in the Cargo.toml
error: failed to run custom build command for `incredible-squaring-blueprint v0.1.1 (<path>/blueprints/incredible-squaring)`

Caused by:
  process didn't exit successfully: `<path>/target/debug/build/incredible-squaring-blueprint-a1eaf06037a611fc/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/lib.rs
  cargo:rerun-if-changed=src/main.rs
  Adding test fetcher since none exists
  cargo:warning=Failed to generate blueprint metadata: Blueprint metadata not found in the Cargo.toml

  --- stderr
  Reading JSON from <path>/blueprints/incredible-squaring/target/blueprint/doc/incredible_squaring_blueprint.json
  [INFO] Extracted 1 job definitions
  [WARN] No gadget metadata found in the Cargo.toml.
  [WARN] For more information, see: <TODO>
  [ERROR]: No blueprint metadata found in the Cargo.toml.
  [ERROR]: For more information, see: <TODO>

Notice the new cargo warning message up top and the log levels in stderr. Still isn't that pretty, but it's the best that can be done AFAIK.

@Serial-ATA Serial-ATA added the feature ➕ Tasks that are functional additions or enhancements label Jan 28, 2025
@Serial-ATA Serial-ATA force-pushed the serial/metadata-errors branch from 1656883 to 6046c8e Compare January 28, 2025 21:46
@Serial-ATA Serial-ATA merged commit 765b3e5 into main Jan 28, 2025
28 of 29 checks passed
@Serial-ATA Serial-ATA deleted the serial/metadata-errors branch January 28, 2025 22:28
This was referenced Jan 28, 2025
@webb-spider webb-spider bot mentioned this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ➕ Tasks that are functional additions or enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants