Skip to content

How do I build a component that uses proto-lens-protoc? #241

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

Closed
lally opened this issue Sep 13, 2019 · 5 comments
Closed

How do I build a component that uses proto-lens-protoc? #241

lally opened this issue Sep 13, 2019 · 5 comments
Labels

Comments

@lally
Copy link

lally commented Sep 13, 2019

Hi, this is a post-to-the-right-project move of input-output-hk/stack2nix#170 -- I had a stack project that used proto-lens-protoc, and there are both haskell packages and top-level nix packages for this.

I frankly don't care if the solution is hacky, but what's the simplest (to do now, to keep working later) method of getting my proto's sorted for my package? The custom setup used /just/ generates haskell from the .proto files. So any invocation of the protoc compiler that results in the files being in a place that's accessible (and not in my src/ directory, where version control's an issue) for compilation is fine by me.

@timbess
Copy link

timbess commented Sep 17, 2020

I'm also interested in this. It seems to pull down proto-lens-protoc but fails to build because protoc is not in the PATH. Is there a way I can override the buildInputs for proto-lens-protoc to include pkgs.protobuf?

@michaelpj
Copy link
Collaborator

If your setup doesn't declare that it needs the exectuable in question (which is the case for proto-lens-protoc), then you need to get the executable onto the path for every place where the setup runs, i.e. the configure phase for each component.

You can do this by setting build-tools for each component (sadly there isn't a way to set it for all components at the moment). Here's an example of me doing this in order to get a suitable agda in scope for a custom setup that uses it to generate Haskell sources.

A package-level build-tools option would probably be helpful for cases like this.

@timbess
Copy link

timbess commented Sep 18, 2020

@michaelpj Thanks! That's a great fleshed out example of a more complex build. Would be awesome to see an example like that in the docs.

@michaelpj
Copy link
Collaborator

For sure, we could document this better (although I'm reluctant to add more big examples until we fix #518).

@stale
Copy link

stale bot commented Sep 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 28, 2022
@stale stale bot closed this as completed Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants