rules_dart icon indicating copy to clipboard operation
rules_dart copied to clipboard

Dart proto dependencies via overlays

Open SpencerC opened this issue 3 years ago • 2 comments

  • Rebased dart_proto_library branch onto master.
  • Fixed broken syntax.
  • Added protobuf deps using new_git_repositorys and overlaid BUILD files.

Relevant commits: d1bce8d47ddb40039676356a6539fee5b05c8046, a3ba942b3e9605323af12b59dd59947d4703de44

@cbracken what do you think of this approach? It seems that everything else works aside from the rule to generate the protoc-gen-dart plugin. Any thoughts on how to resolve this package conundrum?

bazel build @dart_protobuf_protoc_plugin//:protoc_gen_dart --host_cpu="darwin" =>

ERROR: /private/var/tmp/_bazel_spencerconnaughton/0287db8c866287f62cb08f62d03173f4/external/dart_protobuf_protoc_plugin/BUILD.bazel:12:15: Building Dart VM snapshot <rule context for @dart_protobuf_protoc_plugin//:protoc_gen_dart> failed: (Exit 254): dart failed: error executing command external/dart_darwin_x86_64/dart-sdk/bin/dart '--packages=bazel-out/darwin_arm64-fastbuild/bin/external/dart_protobuf_protoc_plugin/protoc_gen_dart.build/protoc_gen_dart.packages' ... (remaining 2 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/darwin_arm64-fastbuild/bin/external/dart_protobuf_protoc_plugin/protoc_gen_dart.build/protoc_gen_dart.packages: Error: Problem in packages configuration file: Missing package name
Error: Couldn't resolve the package 'protoc_plugin' in 'package:protoc_plugin/protoc.dart'.
bazel-out/darwin_arm64-fastbuild/bin/external/dart_protobuf_protoc_plugin/dart_protobuf_protoc_plugin/bin/protoc_plugin.dart:10:8: Error: Not found: 'package:protoc_plugin/protoc.dart'
import 'package:protoc_plugin/protoc.dart';
       ^
bazel-out/darwin_arm64-fastbuild/bin/external/dart_protobuf_protoc_plugin/dart_protobuf_protoc_plugin/bin/protoc_plugin.dart:13:3: Error: Method not found: 'CodeGenerator'.
  CodeGenerator(stdin, stdout).generate();
  ^^^^^^^^^^^^^
Target @dart_protobuf_protoc_plugin//:protoc_gen_dart failed to build

SpencerC avatar Jan 07 '22 21:01 SpencerC

Looking forward for this one 🚀

loeffel-io avatar Dec 07 '22 21:12 loeffel-io

Bump

SpencerC avatar Jan 05 '23 03:01 SpencerC