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

Experimental protobuf feature does not build for version 4.3 #1435

Closed
3 tasks done
shaobo-he-aws opened this issue Jan 21, 2025 · 3 comments
Closed
3 tasks done

Experimental protobuf feature does not build for version 4.3 #1435

shaobo-he-aws opened this issue Jan 21, 2025 · 3 comments
Labels
bug Something isn't working. This is as high priority issue.

Comments

@shaobo-he-aws
Copy link
Contributor

shaobo-he-aws commented Jan 21, 2025

Before opening, please confirm:

Bug Category

Other

Describe the bug

dev-dsk-jkastner-1a-3309db3b % cargo install cedar-policy-cli --features experimental   
    Updating crates.io index
  Installing cedar-policy-cli v4.3.0
    Updating crates.io index
     Locking 192 packages to latest compatible versions
  Downloaded fixedbitset v0.5.7
  Downloaded petgraph v0.7.1
  Downloaded lalrpop v0.22.1
  Downloaded 3 crates (1007.9 KB) in 0.17s
   Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.14
   Compiling libc v0.2.169
...
...
...
error: failed to run custom build command for `cedar-policy-validator v4.3.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installHEzISK/release/build/cedar-policy-validator-fe48a43589877013/build-script-build` (exit status: 101)
  --- stdout
  processing file `src/cedar_schema/grammar.lalrpop`

  --- stderr
  thread 'main' panicked at /home/jkastner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cedar-policy-validator-4.3.0/build.rs:44:10:
  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" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cedar-policy-cli v4.3.0`, intermediate artifacts can be found at `/tmp/cargo-installHEzISK`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

(25-01-21 20:59:01) <101> [~]  

The root cause of this issue is the protobuf feature, which requires the build process to call protobuf to generate glue code. Furthermore, the current setup of schema path also forbids a successful build (see #1275 (comment) for details).

Expected behavior

CLI should be installed.

Reproduction steps

See issue description.

Code Snippet

// Put your code below this line.

Log output

// Put your output below this line

Additional configuration

No response

Operating System

No response

Additional information and screenshots

No response

@shaobo-he-aws shaobo-he-aws added bug Something isn't working. This is as high priority issue. pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. and removed pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. labels Jan 21, 2025
@shaobo-he-aws
Copy link
Contributor Author

shaobo-he-aws commented Jan 21, 2025

The workaround depends on if you want the protobuf feature.

If you don't, simply replace the argument of the --features flag to the features you want. For instance,

cargo install cedar-policy-cli \
  --features partial-eval,permissive-validate,partial-validate

If you do, you will have to build and install Cedar locally. Please make sure that you have protobuf installed. We recommend that you get the protobuf binary from GitHub release.

@john-h-kastner-aws john-h-kastner-aws changed the title Experimental feature does not automatically build for version 4.3 Experimental protobuf feature does not automatically build for version 4.3 Jan 27, 2025
@john-h-kastner-aws john-h-kastner-aws changed the title Experimental protobuf feature does not automatically build for version 4.3 Experimental protobuf feature does not build for version 4.3 Jan 27, 2025
@john-h-kastner-aws
Copy link
Contributor

This was fixed on main be #1452 and a few follow on PRs. These are cherry-picked to the 4.x release by #1478. Confirmation of fix will have to wait on releasing and checking the build

@cdisselkoen
Copy link
Contributor

Fixed in release 4.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. This is as high priority issue.
Projects
None yet
Development

No branches or pull requests

3 participants