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

Something to suggest about guide #529

Closed
zizaihuan opened this issue Jul 25, 2021 · 2 comments · Fixed by #610
Closed

Something to suggest about guide #529

zizaihuan opened this issue Jul 25, 2021 · 2 comments · Fixed by #610
Assignees

Comments

@zizaihuan
Copy link

zizaihuan commented Jul 25, 2021

  1. tip that "we should use protoc_plugin"
    image
    In https://pub.dev/packages/protobuf, there are five urls, but not one is https://pub.dev/packages/protoc_plugin.
    Add some words link to https://pub.dev/packages/protoc_plugin, first, please. So we can find that we should use protoc_plugin quickly and then we will use "dart pub global activate protoc_plugin".

  2. it's hard to find the path of "the dart executable"
    image

I am happy when I have confirm that both the dart executable and bin/protoc-gen-dart are in the path, however, when I use
protoc --cpp_out=./cpp --dart_out=./dart try.proto
it tips that these is not "pub" command.
Then I guess if it means the "dart pub" or "flutter pub"?
So I add these path to system path, in flutter\bin\cache\dart-sdk\bin.
image
There is a dart.exe and pub.bat, and it works.

So now I know that "the dart executable" is not what I think first in flutter\bin, but the one "dart.exe" in flutter\bin\cache\dart-sdk\bin.
image

So I suggest it's better to tip that add flutter\bin\cache\dart-sdk\bin to path, which is hard to find.

Thanks.

@osa1 osa1 self-assigned this Apr 11, 2022
@osa1
Copy link
Member

osa1 commented Apr 11, 2022

Thanks for reporting this @zizaihuan. I started working on this project recently and I also found instructions for protoc_plugin a bit confusing. I will try to improve the README.

I am happy when I have confirm that both the dart executable and bin/protoc-gen-dart are in the path, however, when I use
protoc --cpp_out=./cpp --dart_out=./dart try.proto
it tips that these is not "pub" command.

Could you show us the full error? This can happen in two cases:

  1. You're using an old version of protoc_plugin that uses pub instead of dart pub.
  2. You're using an old version of Dart that doesn't have the dart pub command and you're expected to use just pub.

Since you needed to create a pub.bat file to work around the issue, the problem you're facing must be (2) and you should update your Dart installation.

So I suggest it's better to tip that add flutter\bin\cache\dart-sdk\bin to path, which is hard to find.

This is related to Dart or Flutter installation instructions. I suggest filing this as an issue to Dart or Flutter issue tracker if the instructions for installing Dart or Flutter is not clear.

osa1 added a commit to osa1/protobuf.dart that referenced this issue Apr 13, 2022
- Fix typos

- Shorten some long lines in markdown files using footnote-style
  markdown links

- Use `#` header syntax instead of a mix of `#` and underscores: it's
  unclear whether `---` is smaller than `##` or not. Using `#` for all
  headers is also more consistent and makes it easier to read in
  markdown format (rather than in rendered).

- Add syntax highlighting to Dart and proto code examples.

- Split "How to build and use" section into "How to build" and "How to
  use" sections.

- Move `dart pub activate` method up and make it the recommended way of
  installing the plugin.

- Describe how to build standalone native executables for the plugin.

- Addresses google#576:
  - For each installation method clarify whether they generate a Dart
    script or standalone native executable.

- Addresses: google#529:

  - Mention that latest version of Dart may be needed. Older versions
    don't have `dart pub` command and can cause errors when following
    installation instructions.

  - Link to protoc_plugin pub.dev page in protobuf README.

  - Link to Dart installation instructions in protoc_plugin README.

Fixes google#576
Fixes google#529
@osa1 osa1 mentioned this issue Apr 13, 2022
@osa1
Copy link
Member

osa1 commented Apr 13, 2022

@zizaihuan I tried to address some of your points in #610. If you could give feedback that would be appreciated.

@osa1 osa1 closed this as completed in #610 Apr 20, 2022
osa1 added a commit that referenced this issue Apr 20, 2022
- Fix typos

- Shorten some long lines in markdown files using footnote-style
  markdown links

- Use `#` header syntax instead of a mix of `#` and underscores: it's
  unclear whether `---` is smaller than `##` or not. Using `#` for all
  headers is also more consistent and makes it easier to read in
  markdown format (rather than in rendered).

- Add syntax highlighting to Dart and proto code examples.

- Split "How to build and use" section into "How to build" and "How to
  use" sections.

- Move `dart pub activate` method up and make it the recommended way of
  installing the plugin.

- Describe how to build standalone native executables for the plugin.

- Addresses #576:
  - For each installation method clarify whether they generate a Dart
    script or standalone native executable.

- Addresses: #529:

  - Mention that latest version of Dart may be needed. Older versions
    don't have `dart pub` command and can cause errors when following
    installation instructions.

  - Link to protoc_plugin pub.dev page in protobuf README.

  - Link to Dart installation instructions in protoc_plugin README.

Fixes #576
Fixes #529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants