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

Files are being generated however cannot find the generated proto #11

Open
Leylan24 opened this issue Nov 16, 2022 · 1 comment
Open

Comments

@Leylan24
Copy link

Leylan24 commented Nov 16, 2022

I run the builder, it generates succesfully however I get the following error:

[SEVERE] protoc_builder on lib/proto/service.proto:

FileSystemException: Cannot open file, path = 'lib/lib/config/protos/service.pb.dart' (OS Error: The system cannot find the path specified.
, errno = 3)
[INFO] 28.5s elapsed, 301/317 actions completed.
[INFO] Running build completed, took 29.1s

looking at the hiearchy I can see the generated files exist.
image

This is my build.yaml:

targets:
  $default:
    builders:
      drift_dev:
        options:
          generate_connect_constructor: false
# generate_values_in_copy_with (defaults to true): Generates a Value<T?> instead of T?
# for nullable columns in copyWith. This allows to set columns back to null (by using Value(null)).
# Passing null was ignored before, making it impossible to set columns to null.
          generate_values_in_copy_with : false
      protoc_builder:
        options:
          # The version of the Protobuf compiler to use.
          protobuf_version: "3.19.1" # Make sure to use quotation marks.
          # The version of the Dart protoc_plugin package to use.
          protoc_plugin_version: "20.0.0" # Make sure to use quotation marks.
          # Include paths given to the Protobuf compiler during compilation.
          proto_paths:
            - "lib/proto/"
          # The root directory for generated Dart output files.
          out_dir: "lib/config/protos"

If I change my build.yaml where out_dir: "./config/protos" then no files get generated.

@BenVercammen
Copy link
Contributor

Did you manage to solve this? A big red flag I notice is the double "lib" in lib/lib/config/protos/service.pb.dart in the FileSystemException. The only difference with my config, is that you don't have a root_dir configured. My config looks like this:

          root_dir: "lib/proto/"
          proto_paths:
            - "lib/proto/"
          out_dir: "lib/src/gen"

So maybe that might do the trick for you?

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

No branches or pull requests

2 participants