Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Can prototool take a FileDescriptorSet as input? #546

Open
andremarianiello opened this issue Mar 27, 2020 · 2 comments
Open

Can prototool take a FileDescriptorSet as input? #546

andremarianiello opened this issue Mar 27, 2020 · 2 comments
Labels
wishlist Potential enhancement in the future

Comments

@andremarianiello
Copy link

Is it possible to use a FileDescriptorSet as input for prototool? I have a FileDescriptorSet which I can use as input to protoc directly, but I like configuring stub generation with prototool, so it would be useful to me if prototool supported this.

@smaye81
Copy link
Contributor

smaye81 commented Mar 28, 2020

Prototool does not support descriptor_set_in currently. I can wishlist this issue, but I don't know if we will be implementing that any time soon as we've never really had a need for it.

@smaye81 smaye81 added the wishlist Potential enhancement in the future label Mar 28, 2020
@chrisstockton
Copy link

chrisstockton commented Sep 13, 2021

I've recently come across a similar problem that I was able to get working by adding a --descriptor_set_in flag and passing the value along to protoc

Here are the changes just to get break check to work: https://github.com/uber/prototool/compare/dev...chrisstockton:add_descriptor_set_in?expand=1

Unfortunately, I didn't commit all of the licenses updates separately, but the changes to actually pass in descriptor sets are in:

internal/cmd/flags.go
internal/cmd/templates.go
internal/exec/exec.go
internal/protoc/compiler.go
internal/settings/config_provider.go
internal/settings/settings.go

I wasn't able to use the makefile command to build and image because of this error:

 > [stage-1 3/5] RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories &&   apk add --update --no-cache bash curl git grpc=1.25.0-r1 protobuf=3.11.2-r1 &&   rm -rf /var/cache/apk/*:
#9 0.283 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
#9 0.888 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
#9 1.091 fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
#9 1.737 ERROR: unable to select packages:
#9 1.783   protobuf-3.15.7-r1:
#9 1.783     breaks: world[protobuf=3.11.2-r1]
#9 1.783     satisfies: grpc-1.36.4-r1[protobuf]
#9 1.783   grpc-1.36.4-r1:
#9 1.783     breaks: world[grpc=1.25.0-r1]
------
executor failed running [/bin/sh -c echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories &&   apk add --update --no-cache bash curl git grpc=${GRPC_VERSION}-${ALPINE_GRPC_VERSION_SUFFIX} protobuf=${PROTOBUF_VERSION}-${ALPINE_PROTOBUF_VERSION_SUFFIX} &&   rm -rf /var/cache/apk/*]: exit code: 2
make: *** [dockerbuild] Error 1

I ended up just replacing the binary in the current image published to docker.io.

I'd be happy to clean this up and make a proper PR if it's useful to anyone else, but would probably need a little help getting the build to work locally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wishlist Potential enhancement in the future
Projects
None yet
Development

No branches or pull requests

3 participants