Closed bergwolf closed 6 years ago
@raravena80 - I don't have any osx hardware - any thoughts?
@jodh-intel looks like we either need to do any of these:
brew install yq
or
go get gopkg.in/mikefarah/yq.v2
I suppose using brew might be a better option since it picks up a stable version. Is this in .ci/static-checks.sh
?
Thanks @raravena80 - I'll fix this on https://github.com/kata-containers/proxy/issues/95 then...
Hi @raravena80 - alas, that didn't work.
@raravena80, @egernst, @jcvenegas (or anyone else with mac hardware) - Any chance you could try running the static checks script on a proxy clone in a test osx environment?:
/cc @amshinde also has a Mac iirc. @jodh-intel - Santa is a Linux user, of course... ;-)
I get this error on my mac now
$ .ci/static-checks.sh
/Users/raravena/go/src/github.com/kata-containers/tests/.ci/static-checks.sh: line 24: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
(need to debug more)
I see what the problem may be in Travis. The executable from go get gopkg.in/mikefarah/yq.v2
is called yq.v2
and not yq
We can either do
cp $GOPATH/bin/yq.v2 $GOPATH/bin/yq
or
mv $GOPATH/bin/yq.v1 $GOPATH/bin/yq
In essence looks like gometalinter
hasn't been updated to use yq.v2
@jodh-intel I'll ask Santa to buy you a Mac 😄
ok. I ran it on my mac successfully, after renaming yq.v2
to yq
I had to modify the following lines in the tests repo.
$ git diff
diff --git a/.ci/static-checks.sh b/.ci/static-checks.sh
index 0c787f6..fc2f264 100755
--- a/.ci/static-checks.sh
+++ b/.ci/static-checks.sh
@@ -21,7 +21,7 @@ repo=""
master_branch="false"
force="false"
-typeset -A long_options
+#typeset -A long_options
long_options=(
[commits]="Check commits"
@@ -32,7 +32,7 @@ long_options=(
[help]="Display usage statement"
[licenses]="Check licenses"
[master]="Force checking of master branch"
- [repo:]="Specify GitHub URL of repo to use (github.com/user/repo)"
+ [repo]="Specify GitHub URL of repo to use (github.com/user/repo)"
[versions]="Check versions files"
)
For the typeset
line we probably have to make a condition that checks for darwin and ignore that line. For the [repo:]
line we can just remove the colon?
Hi @raravena80 - thanks for investigating!
Ah, yes, the typeset issue is due to osx providing an older version of bash - we worked around that in Travis by installing a newer version using brew
:
@chavafg - could you update the install_yq()
function based on @raravena80's findings?
@raravena80 @jodh-intel @chavafg - so, are we going to fix the yq
issue for the apple travis, or should we disable it for now? Having that fail the CI is a little blip right now, and if we are not going to fix it rsn, I vote we disable it for the minute.
@grahamwhaley - I don't have a MacBook I'm afraid - do you? I think @amshinde may have one?
Nope. So either we keep prodding it with changes and test it using the travis pass/fails, or we disable it if nobody can figure out what the issue is.
Let's see if @amshinde or @egernst can help out...
I don't have a Mac either, so can't help here :(
I tested it successfully, we would need to rename the binary from yq.v2
to yq
. We would also need to change static-checks.sh
to check if it's macos I'm cool if we want to disable the mac tests though. uname
would do it.
$ uname
Darwin
There are a couple of problems in install_yq():
https://${yq_pkg}/releases/download/${yq_version}/yq_darwin_${goarch}"
arch
command on my machine is returning i386
while go env GOARCH
returns amd64
. Go figure...
I'm constantly getting this on travis-ci osx build for kata-proxy. E.g., https://travis-ci.org/kata-containers/proxy/jobs/411225835
It seems osx does not have the required command?