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

cabal new-build doesn't pass .proto files between deps in the same project #354

Open
judah opened this issue Oct 21, 2019 · 0 comments
Open

Comments

@judah
Copy link
Collaborator

judah commented Oct 21, 2019

Suppose package A depends on package B, both have codegen of proto files, and A's proto files depend on B's. We currently don't require A to also specify B's .proto files explicitly in extra-source-files. Instead, when proto-lens-setup installs B, it copies B's .proto files into the final "data" location, under the proto-lens-imports subdirectory. Then, when proto-lens-setup installs A, it looks for those files and passes the subdirectory when it calls protoc.

Unfortunately, this only works with stack or cabal install V1, and not cabal new-build when both packages are in the same cabal.project. new-build doesn't call the "copy" phase that we're using:
haskell/cabal#5933
Instead, it points at the source file data-dirs.

Ideally, we should figure out an alternative way for two packages to pass each other .proto files. It's annoying though that we have three ways to cover: stack, cabal V1 and cabal V2.

judah added a commit that referenced this issue Oct 22, 2019
- Make all the .cabal files explicitly declare
  `build-tool-depends: proto-lens-protoc:proto-lens-protoc`.
  Also bump hpack to support that syntax.
- Use `generated-exposed-modules` and `generated-other-modules`
  consistently.

For now, Travis just has a single case (8.6.5).  Switching
completely is be blocked on #354 (including .protos from deps).
judah added a commit that referenced this issue Oct 22, 2019
- Make all the .cabal files explicitly declare
  `build-tool-depends: proto-lens-protoc:proto-lens-protoc`.
  Also bump hpack to support that syntax.
- Use `generated-exposed-modules` and `generated-other-modules`
  consistently.

For now, Travis just has a single case (8.6.5).  Switching
completely is be blocked on #354 (including .protos from deps).
judah added a commit that referenced this issue Oct 22, 2019
- Make all the .cabal files explicitly declare
  `build-tool-depends: proto-lens-protoc:proto-lens-protoc`.
  Also bump hpack to support that syntax.
- Use `generated-exposed-modules` and `generated-other-modules`
  consistently.

For now, Travis just has a single case (8.6.5).  Switching
completely is be blocked on #354 (including .protos from deps).
judah added a commit that referenced this issue Oct 22, 2019
- Make all the .cabal files explicitly declare
  `build-tool-depends: proto-lens-protoc:proto-lens-protoc`.
  Also bump hpack to support that syntax.
- Use `generated-exposed-modules` and `generated-other-modules`
  consistently.

For now, Travis just has a single case (8.6.5).  Switching
completely is be blocked on #354 (including .protos from deps).
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

1 participant