Unable to change GO version in PhotonOS - go

I have deployed PhotonOS using directions from photon and VIC configuration, while running command docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.6 make all
an Error appears:
Please install go1.7 (found: go version go1.6.3 linux/amd64)
Makefile:152: recipe for target 'goversion' failed
make: *** [goversion] Error 1
`
to solve it I have tried to update
go1.6.3 to go1.7 using solution - changeing go version manually
after steps go version is showing go1.4.2, but the previous error still complains on go version 1.6.3.
Also, I have tried to install "gvm" using bash < <(curl -s -S -L https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) , whenever I try to call gvm install go1.7 it brings
-bash: gvm: command not found
whenever I retry running gvm-installer it says
ERROR: Already installed!
Any help is highly appreciated!!

use :
docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.7 make all
command instead, that will work on PhotonOS

Related

Build kustomize 3.2.0 on Windows

Can someone suggest how to install 3.2.0 version of kustomize on Windows, please?
I need specifically v3.2.0 on Windows. I am following this tutorial.
Source code: https://github.com/kubernetes-sigs/kustomize/releases/tag/v3.2.0
I downloaded the zip file and installed Go. However when I run go install . inside that kustomize folder i get: no Go files in path/kustomize/..
Also tried step by step aforementioned tutorial but same error..
EDIT: Trying to install via https://github.com/kubernetes-sigs/kustomize/blob/master/hack/install_kustomize.sh ./install_kustomize.sh 3.2.0 I get: Version v3.2.0 does not exist.
When I try ./install_kustomize.sh 3.2.1 I get:
tar (child): ./kustomize_v*_windows_amd64.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Env: Windows 10, executing in GIT Bash
You'll need to run go install ./cmd/kustomize/.
That is where the main.go is you want built.
This will install the executable in your %GOBIN%.
You might want to use go build -o kustomize.exe ./cmd/kustomize/ instead to get the executable in your current working directory.

Cannot install gotk3, getting GdkMonitor error

I tried to use gotk3 for creating desktop application. I follow the instruction in gotk3 wiki and this installing-on-linux wiki to install it. But then I get this error while executing go get -v:
gcc errors for preamble:
In file included from ../../gotk3/gotk3/gdk/gdk_since_3_22.go:23:0:
./gdk_since_3_22.go.h:22:8: error: unknown type name 'GdkMonitor'
static GdkMonitor *
^
I've tried to delete the gotk3 directory, and then trying to go get -v again, but still, it didn't work.
I also checked the GTK version that installed in my Ubuntu 16.04 using apt-cache policy libgtk2.0-0 libgtk-3-0 | grep Installed. And it shows this:
Installed: 2.24.30-1ubuntu1.16.04.2
Installed: 3.18.9-1ubuntu3.3
What did I do wrong? Thanks
GdkMonitor was introduced in GTK+ 3.22. Your version is 3.18.
go get -tags gtk_3_18 github.com/gotk3/gotk3/gtk at the very beginning of building (see here NOTE section) should fix things

Error while running make command using Fabric 1.0.6 after all the 15 steps

I am installing fabric in a custom path $HOME//gopath/src/github.com/hyperledger/fabric using the make command but after installing all the 15 steps, I am getting the following error
Step 15/15 : LABEL org.hyperledger.fabric.version=1.0.2 org.hyperledger.fabric.base.version=0.3.2
---> Running in ed05a67810db
Removing intermediate container ed05a67810db
---> 99b4b0b28957
Successfully built 99b4b0b28957
Successfully tagged hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-javaenv hyperledger/fabric-javaenv:x86_64-1.0.2
build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.2 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.2 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger" github.com/hyperledger/fabric/peer
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -Wl,--no-as-needed
Makefile:227: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1
Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a9
go version go1.9.4 linux/amd64
OS : Ubuntu 16.04
I have set the following path also
$ mkdir $HOME/gopath
$ export GOPATH=$HOME/gopath
$ export GOROOT=$HOME/go
$ export PATH=$PATH:$GOROOT/bin
Jira Link: https://jira.hyperledger.org/browse/FAB-2218 which I have already done
It is a known issue in go 1.9.4:
https://github.com/golang/go/issues/23739
While go people are fixing it, you can manually whitelist the flags before starting make:
$ export CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed'
$ make
Alternatively you can just downgrade to go 1.9.3
as far as I know you don't need to build the fabric itself.
You just need to have sources in the gopath, as your chaincode will need this, when you are building your chaincode for the blockchain itself.
In addition you will probably also need to install the fabric-ca for your chaincode to build successfully, if you use the certificate-stuff.
This is sufficient to check if you installed fabric correctly:
cd $GOPATH/src/github.com/hyperledger/fabric
make unit-test
Keep going if this works.
I found this confusing at first as well ;)
I'd assume you switch to golang 1.9.4 or greater hence I belive this actually related to following issue, to solve it you need to update vendor dependencies:
govendor fetch github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
Next continue to build binaries and run tests.

Golang: Error while make test: signal: killed

I am getting this error while running make test on a Golang project:
signal: killed
FAIL <package name>
make: *** [test] Error 1
The same code was running perfectly fine until yesterday.
Note: I tried doing make test on other branches also but same result.
UPDATE on 04/27/2017:
The new Go1.8.1 (released 2017/04/07) fixed this issue. Please download and install the latest version.
OLD ANSWER:
Mainly the reason was that Command Line Tool 8.3 is not compatible.
According to the solutions from https://github.com/golang/go/issues/19734:
Remove /Library/Developer/CommandLineTools first, download and install Command Line Tool 8.2 from https://developer.apple.com/download/more/?name=Xcode
OR
use -ldflags -s option for compilation or run
Thanks a lot #JimB
I uninstalled the Xcode and it runs fine now. Weird !

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo)
Error -60005 occurred while executing script with privileges.
So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer 3.0.0.app/Contents/MacOS
I try this command: (with sudo)
sudo ./Cocos2D\ Installer\ 3.0.0
It works but I got log with some errors:
[1m>>> Installing Cocos2D-v3.0.0 files (B[m
[1m>>> Installing Cocos2D-v3.0.0 templates (B[m
[4m[1mCocos2D Template Installer (Cocos2D-v3.0.0)(B[m
Error: [31m✖︎(B[m Script cannot be executed as root.
In order for it to work properly, please execute the script again without 'sudo'.
If you want to know more about how to use this script execute '/Users/viethung/Downloads/Cocos2D-v3.0.0/install.sh --help'.
[1m>>> Building/Installing Cocos2D-v3.0.0 documentation, this may take a minute.... (B[m
appledoc version: 2.2 (build 963)
Generation step 4/5 failed: GBDocSetInstallGenerator failed generating output, aborting!
Documentation set was installed, but couldn't reload documentation within Xcode.
Xcode got an error: No documentation set present at specified path.
[1m>>> Cocos2D-v3.0.0 installation complete! (B[m
Are there any way is better than this way?
I have same problem.
I think you installed old cocos2d-iphone and it caused this problem.
You should remove old cocos2d-iphone first. I removed:
~/Library/Developer/Xcode/cocos2d v3.x
And install again. It works for me.
Hope it works for you :)

Resources