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

Improve CI around docbuilds #1275

Open
2 tasks
aaronjeline opened this issue Oct 11, 2024 · 3 comments
Open
2 tasks

Improve CI around docbuilds #1275

aaronjeline opened this issue Oct 11, 2024 · 3 comments
Labels
internal-improvement Refactoring, minor performance improvement, or other changes that Cedar users may never notice

Comments

@aaronjeline
Copy link
Contributor

Describe the improvement you'd like to request

4.2.0 launch accidentally had a build error in our docs that CI didn't catch. It would be nice to catch this.

Describe alternatives you've considered

No response

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this internal improvement
  • ⚠️ This feature might incur a breaking change
@aaronjeline aaronjeline added the internal-improvement Refactoring, minor performance improvement, or other changes that Cedar users may never notice label Oct 11, 2024
@john-h-kastner-aws
Copy link
Contributor

john-h-kastner-aws commented Oct 11, 2024

Problematic line was here (still a problem on main at time of comment):

#[doc = include_str!("../../cedar-policy/experimental_warning.md")]

To detect this we would need to build the validator crate in an environment without the cedar-policy directory. I don't believe it would be enough to just cd into the validator crate and build docs from there.

@john-h-kastner-aws
Copy link
Contributor

Just found this PR to clippy rust-lang/rust-clippy#13638 that looks like it could resolve this issue

@john-h-kastner-aws
Copy link
Contributor

A similar issue reoccurred with this 4.3.0 release. This time it is due to protobuf schema trying to depend on schema located in other crates using a relative path.

[INFO] [stderr] error: failed to run custom build command for `cedar-policy-validator v4.3.0`
[INFO] [stderr] 
[INFO] [stderr] Caused by:
[INFO] [stderr]   process didn't exit successfully: `/opt/rustwide/target/debug/build/cedar-policy-validator-291fc8248da8e0f8/build-script-build` (exit status: 101)
[INFO] [stderr]   --- stderr
[INFO] [stderr] 
[INFO] [stderr]   thread 'main' panicked at /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/cedar-policy-validator-4.3.0/build.rs:44:10:
[INFO] [stderr]   failed to compile `.proto` schema files: Custom { kind: Other, error: "protoc failed: AST.proto: File not found.\nValidator.proto:20:1: Import \"AST.proto\" was not found or had errors.\nValidator.proto:29:5: \"cedar_policy_core.EntityType\" is not defined.\nValidator.proto:34:5: \"cedar_policy_core.EntityUid\" is not defined.\nValidator.proto:39:5: \"cedar_policy_core.EntityType\" is not defined.\nValidator.proto:40:14: \"cedar_policy_core.EntityType\" is not defined.\nValidator.proto: \"cedar_policy_core.Expr\" is not defined.\nValidator.proto:47:5: \"cedar_policy_core.EntityUid\" is not defined.\nValidator.proto:49:14: \"cedar_policy_core.EntityUid\" is not defined.\nValidator.proto:57:14: \"cedar_policy_core.EntityType\" is not defined.\nValidator.proto:58:14: \"cedar_policy_core.EntityType\" is not defined.\nValidator.proto:66:9: \"cedar_policy_core.Name\" is not defined.\nValidator.proto:96:9: \"cedar_policy_core.EntityType\" is not defined.\nValidator.proto:99:9: \"cedar_policy_core.EntityType\" is not defined.\n" }
[INFO] [stderr]   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[INFO] [stderr] warning: build failed, waiting for other jobs to finish...

Offending line is here

&["./protobuf_schema", "../cedar-policy-core/protobuf_schema"],

This effects actual builds with the protobufs feature rather than just doc builds. Depending on how we address this and the original issue the fix might be the same. This clippy PR I linked above would not address this variant of the issue unless the clippy code were changed to have a special case for protobuf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-improvement Refactoring, minor performance improvement, or other changes that Cedar users may never notice
Projects
None yet
Development

No branches or pull requests

2 participants