[ 
https://issues.apache.org/jira/browse/THRIFT-5451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17394930#comment-17394930
 ] 

Yuxuan Wang edited comment on THRIFT-5451 at 8/6/21, 6:12 PM:
--------------------------------------------------------------

Another option is to build a docker image to run the compiler, as nowadays 
docker is on most platforms.

We built [https://github.com/reddit/thrift-compiler] which can be used as a 
drop-in replacement to the thrift binary (with the caveat that it cannot access 
directories outside of the current directory):
{code:java}
#!/bin/sh

# thrift-docker.sh

DEFAULT_DOCKER_TAG="0.14.2"
DOCKER_TAG=${THRIFT_VERSION:-${DEFAULT_DOCKER_TAG}}
DOCKER_REPO=ghcr.io/reddit/thrift-compiler
docker run -v ${PWD}:/data/ --user "$(id -u):$(id -g)" 
${DOCKER_REPO}:${DOCKER_TAG} "$@"
{code}
I'm not saying thrift project should provide this officially (that's up to 
debate), but for any company/organization need to distribute the binary this 
could be an option.

(Before going the docker image route we also tried to build the binary to 
distribute across the company before. The notarization requirement on Mac is 
something really annoying, and we decided that the docker image is just so much 
less headache.)


was (Author: fishywang):
Another option is to build a docker image to run the compiler, as nowadays 
docker is on most platforms.

We built [https://github.com/reddit/thrift-compiler] which can be used as a 
drop-in replacement to the thrift binary (with the caveat that it cannot access 
directories outside of the current directory):
{code:java}
#!/bin/sh

# thrift-docker.sh

DEFAULT_DOCKER_TAG="0.14.2"
DOCKER_TAG=${THRIFT_VERSION:-${DEFAULT_DOCKER_TAG}}
DOCKER_REPO=ghcr.io/reddit/thrift-compiler
docker run -v ${PWD}:/data/ --user "$(id -u):$(id -g)" 
${DOCKER_REPO}:${DOCKER_TAG} "$@"
{code}
I'm not saying thrift project should provide this officially (that's up to 
debate), but for any company/organization need to distribute the binary this 
could be an option.

> Thrift compiler binary distributions
> ------------------------------------
>
>                 Key: THRIFT-5451
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5451
>             Project: Thrift
>          Issue Type: Wish
>          Components: Build Process
>         Environment: Mac OS "Big Sur" which ships with bison 2.3.
>            Reporter: Benjamin Marwell
>            Priority: Minor
>
> Hi everyone,
> Windows distributions are available due to 
> https://issues.apache.org/jira/browse/THRIFT-871.
> It would be great to have a compiler for more platforms, e.g.
>  * Linux x64
>  * Mac x64
>  * Mac arm64
>  * possibly others (Linux s390x, Linux ppc64le, AIX ppc64)
> Rationale:
>  * I was unable to build it on Mac, because xcode ships with bison 2.3, but 
> Thrift requires bison 2.5. setting YACC=/usr/bin/yacc did not work, configure 
> was still using bison.
>  * the maven plugin could be extended to download binary distributions. The 
> protobuf-maven-plugin and the frontend-maven-plugin do the same things. This 
> is a common scheme for maven plugins, because usually all prerequisites are 
> handled by maven plugins.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to