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

Using the type option results in non-deterministic ordering of file dependencies #3506

Closed
haines opened this issue Dec 2, 2024 · 2 comments · Fixed by #3507
Closed

Using the type option results in non-deterministic ordering of file dependencies #3506

haines opened this issue Dec 2, 2024 · 2 comments · Fixed by #3507
Labels
Bug Something isn't working

Comments

@haines
Copy link

haines commented Dec 2, 2024

GitHub repository with your minimal reproducible example (do not leave this field blank or fill out this field with "github.com/bufbuild/buf" or we will automatically close your issue, see the instructions above!)

https://github.com/haines/buf-dependency-order

Commands

# Run `buf build protos --type hub.playground.v1.CerbosService --output descriptors.yaml` until a diff is found
./repro

Output

diff --git a/descriptors.yaml b/descriptors.yaml
index a9cc4a1..c13d2dd 100644
--- a/descriptors.yaml
+++ b/descriptors.yaml
@@ -54551,8 +54551,8 @@ file:
       - buf/validate/validate.proto
       - cerbos/request/v1/request.proto
       - cerbos/response/v1/response.proto
-      - protoc-gen-openapiv2/options/annotations.proto
       - google/api/field_behavior.proto
+      - protoc-gen-openapiv2/options/annotations.proto
     messageType:
       - name: CheckResourcesRequest
         field:

Expected Output

The file's dependency list should be in a deterministic order, so that no diff is produced. This is the case if the --type option is omitted.

Anything else?

Initially reported as bufbuild/protobuf-es#1030

@doriable
Copy link
Member

doriable commented Dec 3, 2024

A fix has been merged, it will be available with the next release!

@haines
Copy link
Author

haines commented Dec 3, 2024

Awesome, thanks @doriable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants