lostluck commented on a change in pull request #16961: URL: https://github.com/apache/beam/pull/16961#discussion_r830400648
########## File path: sdks/go/scripts/genmodel.sh ########## @@ -0,0 +1,81 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -e + +if [[ -z "$(which protoc)" ]]; then + echo "protoc not found on path" + exit 1 +fi + +SCRIPT_DIR="$( realpath "$( dirname "${BASH_SOURCE[0]}" )" )" +if [[ -z $SCRIPT_DIR ]]; then + echo "unable to resolve path to script" + exit 1 +fi + +PROJECT_ROOT="$(realpath "$(dirname $SCRIPT_DIR)/../..")" +if [[ -z "$PROJECT_ROOT" ]]; then + echo "unable to resolve path to project root" + exit 1 +fi + +if [[ -z "$(which go)" ]]; then + echo "go runtime missing" + exit 1 +fi + +if [[ -z "$GOPATH" ]]; then + export GOPATH="$(go env GOPATH)" Review comment: Thanks for making the attempt. I'm ambivalent about what appears in the commentary in the generated files, but I'm uncertain of how much the GRPC side relies on a specific proto-gen-go version to be installed. Let's punt on that for now, and stick to the hard coding in the scripts you had before. We can always revisit it in a more tightly scoped PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
