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

Missing pubspec.lock error when attempting generation with pub workspaces enabled #2281

Closed
cabaucom376 opened this issue Sep 8, 2024 · 2 comments · Fixed by #2289
Closed
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc bug Something isn't working

Comments

@cabaucom376
Copy link

Describe the bug

I just realized that when utilizing the new pub workspaces feature for mono-repos, flutter_rust_bridge fails as there is no longer a pubspec.lock.

Steps to reproduce

I have my generated code in a separate "rust" package:

# pubspec.yaml

name: # ...
description: # ...
version: 0.1.0
publish_to: 'none'
environment:
  sdk: ">=3.6.0-149.3.beta <4.0.0"

workspace:
  # ...
  - packages/rust

dependencies:
  flutter:
    sdk: flutter
  # ...
  rust:
    path: packages/rust

# ...
# packages/rust/pubspec.yaml

name: rust
version: 1.0.0
publish_to: 'none'
environment:
 sdk: ">=3.6.0-149.3.beta <4.0.0"

resolution: workspace

dependencies:
 flutter:
   sdk: flutter
 flutter_rust_bridge: 2.3.0
 prizm_rust:
   path: ../../rust_builder

dev_dependencies:
 build_runner: ^2.4.12

Logs

Error: missing pubspec.lock in .../app/flutter/packages/rust

Expected behavior

Run generation

Generated binding code

No response

OS

macOS

Version of flutter_rust_bridge_codegen

2.3.0

Flutter info

No response

Version of clang++

No response

Additional context

No response

@cabaucom376 cabaucom376 added the bug Something isn't working label Sep 8, 2024
@fzyzcjy
Copy link
Owner

fzyzcjy commented Sep 8, 2024

Firstly, do you mean dart-lang/sdk#53875? Looks like the feature is not stablized yet.

Secondly, I guess the fix would not be very hard: We just firstly find out the pubspec.lock location, and after that everything is the same. Feel free to PR! Alternatively, I will work on it but when it stablizes, since if it is not stablized, things can change, and at the same time only a small portion of users will use it. If you want to use it now, a quick workaround may be to PR, such that when pubspec.lock does not exist, we warn user (and skip sanity checks) instead of error.

But if other people are facing this issue, feel free to comment below! If many people are using this before it stablizes, I can prioritize it.

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Sep 8, 2024
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants