libprotoc.so.9: cannot open shared object file: in IntelliJ - gradle

I'm trying to get protocol buffer working with intelliJ and gradle. However, I'm running into this error:
Execution failed for task ':generateProto'.
protoc: stdout: . stderr: protoc: error while loading shared libraries: libprotoc.so.9: cannot open shared object file: No such file or directory
I've seen this post: Protobuf cannot find shared libraries that explains the situation. But my question is that everything runs perfect on terminal as shown below:
yuefengzhao#zyf-ubuntu:~$ which protoc /usr/local/bin/protoc
yuefengzhao#zyf-ubuntu:~$ protoc --version libprotoc 2.6.1
But it's just not working at all on intelliJ. I'm not sure if intelliJ is configured so that protoc is pointing to eleswhere rather than what's set up in terminal.
scrrenshot of build.gradle and error message
Also, it's one of the requirements that I have to use protobuf v2.6.1
I've spent many hours trying and failing, looking for tons of solutions online but still couldn't wrap my head around.
Any help would be appreciated!

After debugging all night, I figured it's path to protoc that causing the problem. In my system terminal, protoc points to /usr/local/bin as expected when I do which protoc. But IntelliJ somehow gets a different path, pointing to /yuefeng/bin which is under /home.
The solutions is to start IntelliJ from system terminal instead of GUI (I'm using ToolBox) - a suggestion from IntelliJ support team.
I guess this is just a glitch from IntelliJ.

Related

No version set for command go

I attempted to check the version of my go executable with go version on an Ubuntu machine, however I got the following error:
No version set for command go
Consider adding one of the following versions in your config file at
golang 1.16.8
golang 1.17.1
How do I resolve this? I have no prior experience with config file, I searched on google but I found nothing which could solve this issue.
That seems to be an error message from asdf-vm/asdf, a tool which manages multiple runtime versions with a single CLI tool, extendable via plugins.
You can see that error message in asdf-vm/asdf issue 838.
The config file should be in $HOME/.tool-versions
To resolve this, as in this example:
asdf plugin add go
asdf install go latest

Istanbul-tools installation error: github.com/ethereum/go-ethereum/crypto/bn256/cloudflare.gfpMul: relocation target runtime.support_bmi2 not defined

I am trying to install Istanbul-tools to run an IBFT ethereum network as shown in this tutorial here https://medium.com/getamis/istanbul-bft-ibft-c2758b7fe6ff
I am installing istanbul-tools via their makefile using
go build -v -o ./build/bin/istanbul ./cmd/istanbul
After fixing some initial issues, as the code base hasn't been updated in a year, I then received the following error:
github.com/ethereum/go-ethereum/crypto/bn256/cloudflare.gfpMul: relocation target runtime.support_bmi2 not defined
I also cannot find the Cloudflare file in any location in the go-ethereum folder. Can someone point me in the right direction? Cheers!
I had this exact issue, the issue has to do with your Ethereum/Istanbul Versions. You either need to make sure everything is upgraded all the way, or downgrade Go. I downgraded my go version to 1.10.3 and it worked.
Can you be provide more details on the specific Cloudflare file you are looking for? There is a folder for Cloudflare within crypto/bn256 (full path is go-ethereum(or project name)/crypto/bn256/cloudflare) in the Main Ethereum project, I would check there for Istanbul.

GO API installation fails "evq/chromaticity"

I am trying to install chromaticity on my own machine for testing, and no matter what i do i will always hit the error seen in this picture installation error
I dont know why it happened i tried searching but i found nothing online. my question is does anyone know why it happens? or can point me to the right direction? i have checked the folders and yes there are no GO files in there but i dont see why that is a problem
The api could be found here: https://github.com/evq/chromaticity
This is not an issue (as in bug) on the project, rather an issue due to lack of documentation on how to build the project itself.
If you look at the Makefile file on the root directory, you'll notice that static/static.go is a generated file as part of the build process. Such file is usually not committed to the repo so you'll need to build it yourself. To do so, you'll need to have go-bindata installed.
Here's what you need to do in order to build the project successfully:
Get the go-bindata package
go get -u github.com/jteeuwen/go-bindata/...
Get the project
go get github.com/evq/chromaticity
Go the project root directory
cd [...the chromaticity project root..]
Run make to generate the static/static.go file
make
Build/ install the project
go install
Update:
Noticed from your screenshot that you're using Windows, in that case you may need to workaround the issue of running Makefile in Windows. See here for possible solution: How to run a makefile in Windows?
I've run into the same issue when trying to "get" and then install this project. I looked into the code and there is no trace of Asset() function in github.com/evq/chromaticity/static. Moreover git history does not show any .go files in static/ directory. Personally, I would create issue in the project and/or look for different repo containing desired functionality.

bazel build gives "Argument list too long" error

Trying to build go application using bazel. It fails due to multiple packages and source files present within the application.
OS: Mac OS (High Sierra)
Bazel version : 0.11.1 (homebrew)
Go rules: 0.11.0
Defined local_repository in WORKSPACE to get external dependencies
Running following command
bazel build //go-app
leads to error
Action failed to execute: java.io.IOException: Cannot run program
"/usr/bin/sandbox-exec" (in directory
"/TEMP_DIR/PATH"):
error=7, Argument list too long
Target //go-app:go-app failed to build
I came across https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file and thought it would fix my issue. Could anyone point me in the direction of how and where to implement this in my BUILD file and make it work? Thanks.
I think it's not in your BUILD file but rather in rules_go.
I'd recommend opening them an issue since AFAIK this is something the rule implementation needs to support.
For example in rules_scala we write the arguments to a file and then pass that file to the worker exactly like how you mention above.
https://github.com/bazelbuild/rules_scala/blob/master/scala/private/rule_impls.bzl#L274

Failure installing Go dependency

I have installed Go on my server using the golang repo for CentOS 6.4. The paths are set correctly and I can run go version. When I try to download the package below I receive this error. Any help is appreciated
go get github.com/fiorix/freegeoip
# github.com/fiorix/freegeoip
cannot create <nil>/go.o: No such file or directory
googling that error I came across a thread that suggests that this is a bug with detecting a missing TMPDIR environment variable, for compiling the source during go get.
run export TMPDIR=/tmp and it should work.
See here:
https://groups.google.com/forum/#!topic/golang-dev/LnxmgwB0r3Q

Resources