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

[Bug]: catalyst_key_derivation package from pub.dev fails to build on all targets #1471

Open
2 tasks done
ilap opened this issue Jan 6, 2025 · 2 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@ilap
Copy link
Contributor

ilap commented Jan 6, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Build Fails on all targets when using the catalyst_key_derivation package from pub.dev

Expected Behavior

catalyst_key_derivation package builds successfully on all targets

Project

Flutter/Dart packages

What operating system are you seeing the problem on?

macOS, iOS, Android

What browsers are you seeing the problem on?

Not Applicable

Relevant log output

Compiling catalyst_key_derivation v0.1.0 (......./catalyst-voices/catalyst_voices/packages/libs/catalyst_key_derivation/rust)
error[E0583]: file not found for module `frb_generated`
  --> src/lib.rs:20:1
   |
20 | mod frb_generated;
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: to create the module `frb_generated`, create file "src/frb_generated.rs" or "src/frb_generated/mod.rs"
   = note: if there is a `mod frb_generated` elsewhere in the crate already, import it with `use crate::...` instead

error[E0432]: unresolved import `crate::frb_generated::FLUTTER_RUST_BRIDGE_HANDLER`
  --> src/api/key_derivation/mod.rs:14:5
   |
14 | use crate::frb_generated::FLUTTER_RUST_BRIDGE_HANDLER;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `FLUTTER_RUST_BRIDGE_HANDLER` in `frb_generated`

Some errors have detailed explanations: E0432, E0583.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `catalyst_key_derivation` (lib) due to 2 previous errors

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ilap ilap added the bug Something isn't working label Jan 6, 2025
@ilap ilap changed the title [Bug]: catalyst_key_derivation package from [pub.dev](https://pub.dev) fails to build on all targets [Bug]: catalyst_key_derivation package from pub.dev fails to build on all targets Jan 6, 2025
@ilap
Copy link
Contributor Author

ilap commented Jan 7, 2025

Hey @dtscalac,

Here's a very simple example to reproduce the issue:

flutter create -t app --platforms ios,android,macos test_catalyst
flutter pub add catalyst_cardano_serialization
flutter build macos # apk, ipa etc.

The easiest fix could be to include something like the following example in the build pipeline for publishing:

cd catalyst_key_derivation
cargo install just cargo-expand
flutter_rust_bridge_codegen generate

The error message is the following:

flutter build macos

...
INFO: Precompiled binaries are disabled
INFO: Building catalyst_key_derivation for aarch64-apple-darwin
SEVERE: ================================================================================
SEVERE: Cargokit BuildTool failed with error:
SEVERE: --------------------------------------------------------------------------------
SEVERE: External Command: rustup "run" "stable" "cargo" "build" "--manifest-path" "/Users/ilap/.pub-cache/hosted/pub.dev/catalyst_key_derivation-0.1.1+1/rust/Cargo.toml" "-p" "catalyst_key_derivation" "--release" "--target" "aarch64-apple-darwin" "--target-dir" "/Users/ilap/Projects/tmp/test_catalyst/build/macos/Build/Intermediates.noindex/Pods.build/Release/catalyst_key_derivation.build"
SEVERE: Returned Exit Code: 101
SEVERE: --------------------------------------------------------------------------------
SEVERE: STDOUT:
SEVERE: --------------------------------------------------------------------------------
SEVERE: STDERR:
SEVERE: Compiling catalyst_key_derivation v0.1.0 (/Users/ilap/.pub-cache/hosted/pub.dev/catalyst_key_derivation-0.1.1+1/rust)
SEVERE: error[E0583]: file not found for module `frb_generated`
SEVERE:   --> src/lib.rs:20:1
SEVERE:    |
SEVERE: 20 | mod frb_generated;
SEVERE:    | ^^^^^^^^^^^^^^^^^^
SEVERE:    |
SEVERE:    = help: to create the module `frb_generated`, create file "src/frb_generated.rs" or "src/frb_generated/mod.rs"
SEVERE:
SEVERE: error[E0432]: unresolved import `crate::frb_generated::FLUTTER_RUST_BRIDGE_HANDLER`
SEVERE:   --> src/api/key_derivation/mod.rs:14:5
SEVERE:    |
SEVERE: 14 | use crate::frb_generated::FLUTTER_RUST_BRIDGE_HANDLER;
SEVERE:    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `FLUTTER_RUST_BRIDGE_HANDLER` in `frb_generated`
SEVERE:
SEVERE: Some errors have detailed explanations: E0432, E0583.
SEVERE: For more information about an error, try `rustc --explain E0432`.
SEVERE: error: could not compile `catalyst_key_derivation` (lib) due to 2 previous errors
SEVERE: --------------------------------------------------------------------------------
SEVERE: #0      runCommand (package:build_tool/src/util.dart:121:5)
SEVERE: #1      RustBuilder.build (package:build_tool/src/builder.dart:142:5)
SEVERE: <asynchronous suspension>
SEVERE: #2      ArtifactProvider.getArtifacts (package:build_tool/src/artifacts_provider.dart:71:25)
SEVERE: <asynchronous suspension>
SEVERE: #3      BuildPod.build (package:build_tool/src/build_pod.dart:34:23)
SEVERE: <asynchronous suspension>
SEVERE: #4      BuildPodCommand.runBuildCommand (package:build_tool/src/build_tool.dart:51:5)
SEVERE: <asynchronous suspension>
SEVERE: #5      BuildCommand.run (package:build_tool/src/build_tool.dart:37:5)
SEVERE: <asynchronous suspension>
SEVERE: #6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
SEVERE: <asynchronous suspension>
SEVERE: #7      runMain (package:build_tool/src/build_tool.dart:251:5)
SEVERE: <asynchronous suspension>
SEVERE: --------------------------------------------------------------------------------
SEVERE: BuildTool arguments: [build-pod, ../rust, catalyst_key_derivation]
SEVERE: ================================================================================
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

Building macOS application...
Build process failed

@dtscalac
Copy link
Contributor

dtscalac commented Jan 8, 2025

@ilap thank you, will have a look into it.

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
Status: New
Development

No branches or pull requests

2 participants