GoogleCloudPlatform / healthcare-data-harmonization-dataflow

Apache License 2.0
35 stars 24 forks source link

Error when building jar #6

Closed nobmizue-jcloudce closed 3 years ago

nobmizue-jcloudce commented 3 years ago

I faced an error when running "./gradlew shadowJar" like below.

Debian10

gradle 6.7.1

java 1.8.0_272

protoc 3.12.3

$ ./gradlew shadowJar ....... ....... go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/parser in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language v0.0.0-00010101000000-000000000000 go: found github.com/antlr/antlr4/runtime/Go/antlr in github.com/antlr/antlr4 v0.0.0-20201129091037-eafcc9369e99 go: found github.com/google/uuid in github.com/google/uuid v1.1.2

github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/errors

../errors/proto.go:105:23: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ValueSource ../errors/proto.go:119:14: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ProjectorDefinition

github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/transpiler

../../mapping_language/transpiler/env.go:40:13: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".FieldMapping ../../mapping_language/transpiler/stacks.go:23:20: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ValueSource ../../mapping_language/transpiler/transpiler.go:30:20: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ProjectorDefinition

Task :buildDeps FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 16s 1 actionable task: 1 executed

lastomato commented 3 years ago

Can you use the latest version (3.14.0) of protoc and try again? I am going to update the readme to list the recommended versions of the dependencies in the mean time.

nobmizue commented 3 years ago

I got the same "undefined" error messages with protoc 3.14.0.

$ protoc --version libprotoc 3.14.0

$ ./gradlew shadowJar ........ ........ ../errors/proto.go:105:23: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ValueSource ../errors/proto.go:119:14: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ProjectorDefinition ../../mapping_language/transpiler/env.go:40:13: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".FieldMapping ../../mapping_language/transpiler/stacks.go:23:20: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ValueSource ../../mapping_language/transpiler/transpiler.go:30:20: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ProjectorDefinition

lastomato commented 3 years ago

Oops, sorry I overlooked your previous error message.

Do you mind paste the full error message? I suspect the protos failed to build, specifically, can you check if you have GOPATH set?

go env GOPATH

This variable is needed for the script to find the golang proto compiler. Please see https://github.com/golang/go/wiki/SettingGOPATH if the variable is not set.

nobmizue-jcloudce commented 3 years ago

GOPATH is set to $HOME/go. Here is the versions, commands and full messages.

$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 8.3.0 (Debian 8.3.0-6)

$ export GOPATH=$HOME/go

$ go version go version go1.15.5 linux/amd64

$ protoc --version libprotoc 3.14.0

$ gradle -version

Gradle 6.7.1

Build time: 2020-11-16 17:09:24 UTC Revision: 2972ff02f3210d2ceed2f1ea880f026acfbab5c0

Kotlin: 1.3.72 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020 JVM: 1.8.0_272 (Debian 25.272-b10) OS: Linux 4.19.0-12-cloud-amd64 amd64

$ git clone https://github.com/GoogleCloudPlatform/healthcare-data-harmonization-dataflow.git $ cd healthcare-data-harmonization-dataflow

$ gradle wrapper BUILD SUCCESSFUL in 1s 1 actionable task: 1 up-to-date

$ ./gradlew shadowJar

Task :buildDeps Cloning latest mapping engine code... Cloning into '/home/nobmizue_jcloudce_com/beam/whistle/healthcare-data-harmonization-dataflow/build/tmp/build_deps'... Building mapping engine... go: found google.golang.org/protobuf/cmd/protoc-gen-go in google.golang.org/protobuf v1.25.0 google/protobuf/any.proto: File not found. proto/mapping.proto:5:1: Import "google/protobuf/any.proto" was not found or had errors. proto/mapping.proto: "google.protobuf.Any" is not defined. proto/http.proto:5:1: Import "proto/mapping.proto" was not found or had errors. proto/http.proto:52:3: "ValueSource" is not defined. proto/http.proto:55:3: "ValueSource" is not defined. proto/harmonization.proto:5:1: Import "proto/http.proto" was not found or had errors. proto/harmonization.proto:6:1: Import "proto/mapping.proto" was not found or had errors. proto/harmonization.proto:17:5: "MappingConfig" is not defined. proto/harmonization.proto:38:3: "Location" is not defined. proto/harmonization.proto:47:12: "Location" is not defined. proto/harmonization.proto:62:3: "Location" is not defined. google/protobuf/any.proto: File not found. proto/mapping.proto:5:1: Import "google/protobuf/any.proto" was not found or had errors. proto/mapping.proto: "google.protobuf.Any" is not defined. google/protobuf/any.proto: File not found. proto/mapping.proto:5:1: Import "google/protobuf/any.proto" was not found or had errors. proto/mapping.proto: "google.protobuf.Any" is not defined. proto/http.proto:5:1: Import "proto/mapping.proto" was not found or had errors. proto/http.proto:52:3: "ValueSource" is not defined. proto/http.proto:55:3: "ValueSource" is not defined. google/protobuf/any.proto: File not found. proto/mapping.proto:5:1: Import "google/protobuf/any.proto" was not found or had errors. proto/mapping.proto: "google.protobuf.Any" is not defined. proto/http.proto:5:1: Import "proto/mapping.proto" was not found or had errors. proto/http.proto:52:3: "ValueSource" is not defined. proto/http.proto:55:3: "ValueSource" is not defined. proto/harmonization.proto:5:1: Import "proto/http.proto" was not found or had errors. proto/harmonization.proto:6:1: Import "proto/mapping.proto" was not found or had errors. proto/harmonization.proto:17:5: "MappingConfig" is not defined. proto/harmonization.proto:38:3: "Location" is not defined. proto/harmonization.proto:47:12: "Location" is not defined. proto/harmonization.proto:62:3: "Location" is not defined. proto/library.proto:5:1: Import "proto/harmonization.proto" was not found or had errors. proto/library.proto:6:1: Import "proto/http.proto" was not found or had errors. proto/library.proto:7:1: Import "proto/mapping.proto" was not found or had errors. proto/library.proto:17:12: "ProjectorDefinition" is not defined. proto/library.proto:20:12: "ServerDefinition" is not defined. proto/library.proto:24:12: "CloudFunction" is not defined. proto/library.proto:29:12: "HttpFetchQuery" is not defined. proto/library.proto:41:3: "MappingType" is not defined. proto/library.proto:44:3: "Location" is not defined. proto/data_harmonization.proto:5:1: Import "proto/harmonization.proto" was not found or had errors. proto/data_harmonization.proto:6:1: Import "proto/library.proto" was not found or had errors. proto/data_harmonization.proto:7:1: Import "proto/mapping.proto" was not found or had errors. proto/data_harmonization.proto:17:12: "LibraryConfig" is not defined. proto/data_harmonization.proto:22:3: "CodeHarmonizationConfig" is not defined. proto/data_harmonization.proto:25:3: "UnitHarmonizationConfig" is not defined. proto/data_harmonization.proto:28:3: "StructureMappingConfig" is not defined. google/protobuf/any.proto: File not found. proto/mapping.proto:5:1: Import "google/protobuf/any.proto" was not found or had errors. proto/mapping.proto: "google.protobuf.Any" is not defined. proto/http.proto:5:1: Import "proto/mapping.proto" was not found or had errors. proto/http.proto:52:3: "ValueSource" is not defined. proto/harmonization.proto:5:1: Import "proto/http.proto" was not found or had errors. proto/harmonization.proto:6:1: Import "proto/mapping.proto" was not found or had errors. proto/harmonization.proto:17:5: "MappingConfig" is not defined. proto/harmonization.proto:38:3: "Location" is not defined. proto/harmonization.proto:47:12: "Location" is not defined. proto/harmonization.proto:62:3: "Location" is not defined. proto/library.proto:5:1: Import "proto/harmonization.proto" was not found or had errors. proto/library.proto:6:1: Import "proto/http.proto" was not found or had errors. proto/library.proto:7:1: Import "proto/mapping.proto" was not found or had errors. proto/library.proto:17:12: "ProjectorDefinition" is not defined. proto/library.proto:20:12: "ServerDefinition" is not defined. proto/library.proto:24:12: "CloudFunction" is not defined. proto/library.proto:29:12: "HttpFetchQuery" is not defined. proto/library.proto:41:3: "MappingType" is not defined. proto/library.proto:44:3: "Location" is not defined. Downloading ANTLR 4.7.1 to ./.antlr/antlr.jar % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2187k 100 2187k 0 0 3034k 0 --:--:-- --:--:-- --:--:-- 3034k Entering /home/nobmizue_jcloudce_com/beam/whistle/healthcare-data-harmonization-dataflow/build/tmp/build_deps/mapping_engine/transform go: finding module for package google.golang.org/protobuf/encoding/prototext go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/auth in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/cloudfunction in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/errors in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/fetch in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/harmonization/harmonizecode in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/harmonization/harmonizeunit in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/mapping in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/postprocess in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/projector in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/types in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/types/register_all in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/util/gcsutil in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/util v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/util/jsonutil in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/util v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/transpiler in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/transpiler v0.0.0-00010101000000-000000000000 go: found google.golang.org/protobuf/encoding/prototext in google.golang.org/protobuf v1.25.0 go: finding module for package github.com/google/uuid go: finding module for package github.com/antlr/antlr4/runtime/Go/antlr go: finding module for package bitbucket.org/creachadair/stringset go: found bitbucket.org/creachadair/stringset in bitbucket.org/creachadair/stringset v0.0.9 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/errors in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/parser in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language v0.0.0-00010101000000-000000000000 go: found github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/parser in github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language v0.0.0-00010101000000-000000000000 go: found github.com/antlr/antlr4/runtime/Go/antlr in github.com/antlr/antlr4 v0.0.0-20201129091037-eafcc9369e99 go: found github.com/google/uuid in github.com/google/uuid v1.1.2

github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/errors

../errors/proto.go:105:23: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ValueSource ../errors/proto.go:119:14: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ProjectorDefinition

github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_language/transpiler

../../mapping_language/transpiler/env.go:40:13: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".FieldMapping ../../mapping_language/transpiler/stacks.go:23:20: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ValueSource ../../mapping_language/transpiler/transpiler.go:30:20: undefined: "github.com/GoogleCloudPlatform/healthcare-data-harmonization/mapping_engine/proto".ProjectorDefinition

Task :buildDeps FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 10s 1 actionable task: 1 executed

lastomato commented 3 years ago

I suspect that the default protos are not present in the default include path. Can you check by doing:

ls -l /usr/local/include

If nothing is there, do you mind running the following the command:

PROTOC_ZIP=protoc-3.14.0.-linux-x86_64.zip
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
nobmizue commented 3 years ago

As you pointed out, I set the appropriate permission under include and it succeeded. Thank you!

lastomato commented 3 years ago

No problem, glad it worked!