-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change go version detection logic #10101
Conversation
# This library holds golang related utility functions. | ||
|
||
# Ensure the go tool exists and is a viable version. | ||
os::golang::verify_go_version() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to use the following func formatting:
function name() {
}
readonly -f name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain: the formatting is for consistency, the readonly is for scripts that call other scripts where both source hack/lib/init.sh
for the first, not really... technically copying the config is wrong because the new one shares a map of session tickets, guarded by a copy of a mutex, but that's only used by servers, and this is for a client. also, go makes the same copy. for the second, we should be using |
With @stevekuznetsov comments addressed, ptal once again. |
# os::golang::verify_go_version ensure the go tool exists and is a viable version. | ||
function os::golang::verify_go_version() { | ||
if ! which go &>/dev/null; then | ||
os::log::info "Can't find 'go' in PATH, please fix and retry." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my fault in the previous comment, but these should be os::log::error
since they mean something failed.
@stevekuznetsov updated |
os::log::info "Origin requires go version 1.6." | ||
os::log::info "Please install Go version 1.6 or use PERMISSIVE_GO=y to bypass this check." | ||
return 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make this look like:
if [[ "${go_version[2]}" != "go1.6" ]]; then
os::log::info "Detected go version: ${go_version[*]}."
if [[ -z "${PERMISSIVE_GO:-}" ]]; then
os::log::error "Please install Go version 1.6 or use PERMISSIVE_GO=y to bypass this check."
return 1
else
os::log::warn "Detected golang version doesn't match preferred Go version for Origin."
os::log::warn "This version mismatch could lead to differences in execution between this run and the Origin CI systems."
return 0
fi
fi
262fe76
to
25929a6
Compare
@stevekuznetsov comments addressed. |
Bash LGTM |
@stevekuznetsov what's your plan to deal with the tip version of go we use in travis? |
I'd have to ask @smarterclayton what, exactly, we gain by running a tip build on Travis first. We could just pass the permissive flag in to Travis. |
We do it to flag early go build problems coming from upstream.
|
Ok, then letting it be permissive should be fine, we can catch updates for On Jul 30, 2016 6:30 PM, "Clayton Coleman" [email protected] wrote:
|
@stevekuznetsov for travis part and |
[test] |
re[test] |
@liggitt, Steve suggested we go with ignoring certain errors and that's the final solution. @stevekuznetsov ptal |
To expand on this, the reason was that there is no sane way to have a |
|
||
DIR_BLACKLIST='./hack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soltysh we don't want to remove this part of hack/verify-govet.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why, I haven't see us using it?
@stevekuznetsov updated except for the removed chunk, I don't see why we need it if it's of no use, unless I'm missing something? |
ptal |
Reverted back the block @stevekuznetsov was asking for and added a two more ignores to the generated clientset, which will require a bit more of work to have them pass govet. |
LGTM on a green [test] -- maybe we should open issues for those lock copies that are our fault |
Evaluated for origin test up to 0ffa6e6 |
Issue created #10357. |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7790/) |
Tests are green. [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7790/) (Image: devenv-rhel7_4806) |
Evaluated for origin merge up to 0ffa6e6 |
Since some of us are already using go 1.7 we're missing certain verification mechanism out of the box. I've changed the logic to check only minimal go version. @stevekuznetsov ptal this part
Unfortunately, govet still complains about:
@deads2k @liggitt any ideas how to fix those?