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

make gen-check failed #19

Closed
gy95 opened this issue Jun 22, 2022 · 2 comments · Fixed by #20
Closed

make gen-check failed #19

gy95 opened this issue Jun 22, 2022 · 2 comments · Fixed by #20
Labels

Comments

@gy95
Copy link
Member

gy95 commented Jun 22, 2022

What happened:
make gen-check failed

# make gen-check 
go mod tidy -compat=1.17
go clean -testcache
go clean -cache
rm -rf out/linux-amd64
rm -rf out/prom
go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
go install -a github.com/brancz/gojsontoyaml@latest
go install -a github.com/google/go-jsonnet/cmd/jsonnet@latest
rm -rf manifests/profiles/prom/
mkdir -p manifests/profiles/prom/
mkdir -p out/prom
cp manifests/jsonnet/kube-prometheus.jsonnet out/prom
hack/gen-prom.sh out/prom v0.10.0 kube-prometheus.jsonnet
begin to generate prom manifests
path: out/prom
version: v0.10.0
jsonnet file: kube-prometheus.jsonnet
~/go/src/github.com/kurator-dev/kurator/out/prom ~/go/src/github.com/kurator-dev/kurator
hack/gen-prom.sh: line 13: jb: command not found
Makefile:65: recipe for target 'gen-prom' failed
make: *** [gen-prom] Error 127

Solutions:
we should export PATH=$PATH:$GOPATH/bin after we install jb

kurator/Makefile

Lines 57 to 61 in 33fef92

.PHONY: install-tools
install-tools:
go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
go install -a github.com/brancz/gojsontoyaml@latest
go install -a github.com/google/go-jsonnet/cmd/jsonnet@latest

or we can use the function defined in util.sh

kurator/hack/util.sh

Lines 13 to 20 in 33fef92

function util::install_tools() {
local package="$1"
local version="$2"
echo "go install ${package}@${version}"
GO111MODULE=on go install "${package}"@"${version}"
GOPATH=$(go env GOPATH | awk -F ':' '{print $1}')
export PATH=$PATH:$GOPATH/bin
}

but i don't know how to run functions of shell script in Makefile

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kurator version:
  • Others:
@gy95 gy95 added the kind/bug label Jun 22, 2022
@hzxuzhonghu
Copy link
Member

good catch @gy95

we donot need to expose install-tools, which is now used by gen-prom

I am thinking we can move the install into hack/gen-prom.sh

@gy95
Copy link
Member Author

gy95 commented Jun 22, 2022

That's a good way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants