Skip to content
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

fix hack/lib/golang.sh for bash 4.3 #77910

Merged
merged 1 commit into from
May 16, 2019
Merged

Conversation

adisky
Copy link
Contributor

@adisky adisky commented May 15, 2019

What type of PR is this?

/kind bug

What this PR does / why we need it:
This PR fixes compatibiltiy issue with bash version 4.3 for script hack/lib/golang.sh, to solve the scope issue of readonly variables in both version 4.3 and 4.4, required variables are declared using declare -g

Which issue(s) this PR fixes:

Fixes #77521

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 15, 2019
@k8s-ci-robot k8s-ci-robot requested review from ixdy and vishh May 15, 2019 08:19
@adisky adisky changed the title [WIP] fix unbound array variable [WIP] fix hack/lib/golang.sh for bash 4.3 May 15, 2019
@adisky
Copy link
Contributor Author

adisky commented May 15, 2019

/test pull-kubernetes-e2e-gce

@adisky
Copy link
Contributor Author

adisky commented May 15, 2019

/test pull-kubernetes-integration

@dims
Copy link
Member

dims commented May 15, 2019

w00t interesting! thanks for taking this on @adisky

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels May 15, 2019
@adisky adisky changed the title [WIP] fix hack/lib/golang.sh for bash 4.3 fix hack/lib/golang.sh for bash 4.3 May 15, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2019
@adisky
Copy link
Contributor Author

adisky commented May 15, 2019

@dims Tried fixing the scope resolution problem for readonly variable for bash version 4.3, tested the above changes on bash 4.4, trying to get it tested on 4.3

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 15, 2019
@adisky
Copy link
Contributor Author

adisky commented May 15, 2019

cc @cjschaef @aojea

@aojea
Copy link
Member

aojea commented May 15, 2019

Thanks @adisky , it's working for me now

@adisky
Copy link
Contributor Author

adisky commented May 15, 2019

/sig release

@k8s-ci-robot k8s-ci-robot added sig/release Categorizes an issue or PR as relevant to SIG Release. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 15, 2019
@adisky
Copy link
Contributor Author

adisky commented May 15, 2019

/assign @cblecker @spiffxp @dims

@spiffxp
Copy link
Member

spiffxp commented May 15, 2019

/priority critical-urgent
/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 15, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adisky, spiffxp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tpepper
Copy link
Member

tpepper commented May 17, 2019

This has broken MacOS build:

/Users/tpepper/src/github.com/kubernetes/kubernetes/hack/lib/golang.sh: line 166: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
!!! [0517 10:55:19] Call tree:
!!! [0517 10:55:19]  1: /Users/tpepper/src/github.com/kubernetes/kubernetes/hack/lib/init.sh:55 source(...)
!!! [0517 10:55:19]  2: build/../build/common.sh:37 source(...)
!!! [0517 10:55:19]  3: build/release.sh:29 source(...)
make: *** [quick-release] Error 1

@aojea
Copy link
Member

aojea commented May 17, 2019

This discussion seems related https://discuss.kubernetes.io/t/help-wanted-role-build-and-shell-cleanup/6064/10 , is it failing with the default bash version on Mac? version 3?

k8s-ci-robot added a commit that referenced this pull request May 19, 2019
#77910-#77985-#78048-#78059-upstream-release-1.14

Automated cherry pick of #77362: Don't use mapfile as it isn't bash 3 compatible #77910: fix unbound array variable #77985: fix unbound variable release.sh #78048: Don't use declare -g in build #78059: Check KUBE_SERVER_PLATFORMS existence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-none Denotes a PR that doesn't merit a release note. sig/release Categorizes an issue or PR as relevant to SIG Release. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build/release.sh (hack/lib/golang.sh) requires minimum bash v4.4
7 participants