[GH-ISSUE #114] [Bug] Protobuf generation for FFI not working properly on linux #56

Closed
opened 2026-03-23 20:31:06 +00:00 by mirror · 2 comments
Owner

Originally created by @irfanbacker on GitHub (Dec 2, 2021).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/114

Describe the bug
While building Appflowy on linux, doing the optional protobuf generation will not generate the proper output. The repository already has some tracked protobuf files with which the app works as of now (ie., without generating the protobuf and using already existing ones ). Developers who want to work on rust in Appflowy will not be able to build the app after making changes

To Reproduce
Follow the steps mentioned here including the optional protobuf generation step (step 9).

Logs
When trying to build appflowy rust sdk after protobuf generation, the following errors occur:

error[E0308]: mismatched types
--> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/doc/revision.rs:60:41
|
60 | #[derive(PartialEq, Eq, Clone, Default, ProtoBuf)]
| ^^^^^^^^
| |
| expected enum entities::doc::revision::RevType, found enum model::revision::RevType
| expected due to the type of this binding
|
= note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
--> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/doc/revision.rs:60:41
|
60 | #[derive(PartialEq, Eq, Clone, Default, ProtoBuf)]
| ^^^^^^^^
| |
| expected enum model::revision::RevType, found enum entities::doc::revision::RevType
| expected due to the type of this binding
|
= note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
--> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/ws/ws.rs:31:10
|
31 | #[derive(ProtoBuf, Default, Debug, Clone)]
| ^^^^^^^^
| |
| expected enum entities::ws::ws::WsDataType, found enum model::ws::WsDataType
| expected due to the type of this binding
|
= note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
--> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/ws/ws.rs:31:10
|
31 | #[derive(ProtoBuf, Default, Debug, Clone)]
| ^^^^^^^^
| |
| expected enum model::ws::WsDataType, found enum entities::ws::ws::WsDataType
| expected due to the type of this binding
|
= note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try rustc --explain E0308.
error: could not compile flowy-document-infra due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.


Expected behavior
Protobuf generation should generate proper output, more or less very similar to the already tracked generated files.

Desktop (please complete the following information):

  • OS: popOS 21.04
Originally created by @irfanbacker on GitHub (Dec 2, 2021). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/114 **Describe the bug** While building Appflowy on linux, doing the optional protobuf generation will not generate the proper output. The repository already has some tracked protobuf files with which the app works as of now (ie., without generating the protobuf and using already existing ones ). Developers who want to work on rust in Appflowy will not be able to build the app after making changes **To Reproduce** Follow the steps mentioned [here](https://github.com/AppFlowy-IO/appflowy/blob/main/doc/BUILD_ON_LINUX.md) including the optional protobuf generation step (step 9). **Logs** When trying to build appflowy rust sdk after protobuf generation, the following errors occur: ``` error[E0308]: mismatched types --> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/doc/revision.rs:60:41 | 60 | #[derive(PartialEq, Eq, Clone, Default, ProtoBuf)] | ^^^^^^^^ | | | expected enum entities::doc::revision::RevType, found enum model::revision::RevType | expected due to the type of this binding | = note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/doc/revision.rs:60:41 | 60 | #[derive(PartialEq, Eq, Clone, Default, ProtoBuf)] | ^^^^^^^^ | | | expected enum model::revision::RevType, found enum entities::doc::revision::RevType | expected due to the type of this binding | = note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/ws/ws.rs:31:10 | 31 | #[derive(ProtoBuf, Default, Debug, Clone)] | ^^^^^^^^ | | | expected enum entities::ws::ws::WsDataType, found enum model::ws::WsDataType | expected due to the type of this binding | = note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> /home/ubuntu/workspace/github/appflowy/shared-lib/flowy-document-infra/src/entities/ws/ws.rs:31:10 | 31 | #[derive(ProtoBuf, Default, Debug, Clone)] | ^^^^^^^^ | | | expected enum model::ws::WsDataType, found enum entities::ws::ws::WsDataType | expected due to the type of this binding | = note: this error originates in the derive macro ProtoBuf (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try rustc --explain E0308. error: could not compile flowy-document-infra due to 4 previous errors warning: build failed, waiting for other jobs to finish... error: build failed [cargo-make] ERROR - Error while executing command, exit code: 101 [cargo-make] WARN - Build Failed. ``` **Expected behavior** Protobuf generation should generate proper output, more or less very similar to the already tracked generated files. **Desktop (please complete the following information):** - OS: popOS 21.04
mirror 2026-03-23 20:31:06 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@irfanbacker commented on GitHub (Dec 2, 2021):

The screenshot below shows the changes (tracked by git) that will take place after the protobuf generation step
protobuf

The changes in every file other than derive_cache.rs are indentation and comment changes. So, the problem can be narrowed down to this file shown above.

<!-- gh-comment-id:984452507 --> @irfanbacker commented on GitHub (Dec 2, 2021): The screenshot below shows the changes (tracked by git) that will take place after the protobuf generation step ![protobuf](https://user-images.githubusercontent.com/42970959/144395128-c59a1246-eabf-41a9-8b4b-dfe1dcf9356c.png) The changes in every file other than derive_cache.rs are indentation and comment changes. So, the problem can be narrowed down to this file shown above.
Author
Owner

@irfanbacker commented on GitHub (Dec 6, 2021):

Commit 63082418be seems to have fixed this. No issues now.

<!-- gh-comment-id:986856395 --> @irfanbacker commented on GitHub (Dec 6, 2021): Commit 63082418be70930f96cfdfc03d3318aa5580c2f7 seems to have fixed this. No issues now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#56
No description provided.