Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

running make fails to build the project from a fresh clone #71

Open
jhjaggars opened this issue Aug 18, 2017 · 7 comments
Open

running make fails to build the project from a fresh clone #71

jhjaggars opened this issue Aug 18, 2017 · 7 comments
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@jhjaggars
Copy link

When I run make after a fresh clone of the project I receive this error:

┌[dali]  image-inspector/ (master $=)
└> make
hack/build-go.sh
cmd/image-inspector.go:10:2: cannot find package "github.com/openshift/image-inspector/pkg/api" in any of:
        /usr/lib/golang/src/github.com/openshift/image-inspector/pkg/api (from $GOROOT)
        /src/github.com/openshift/image-inspector/pkg/api (from $GOPATH)
cmd/image-inspector.go:11:2: cannot find package "github.com/openshift/image-inspector/pkg/cmd" in any of:
        /usr/lib/golang/src/github.com/openshift/image-inspector/pkg/cmd (from $GOROOT)
        /src/github.com/openshift/image-inspector/pkg/cmd (from $GOPATH)
cmd/image-inspector.go:12:2: cannot find package "github.com/openshift/image-inspector/pkg/inspector" in any of:
        /usr/lib/golang/src/github.com/openshift/image-inspector/pkg/inspector (from $GOROOT)
        /src/github.com/openshift/image-inspector/pkg/inspector (from $GOPATH)
!!! Error in hack/../hack/common.sh:83
        'go install "cmd/image-inspector.go"' exited with status 1
Call stack:
        1: hack/../hack/common.sh:83 ii::build::build_binaries(...)
        2: hack/build-go.sh:15 main(...)
Exiting with status 1
!!! Error in hack/../hack/common.sh:72
        '( ii::build::setup_env; local platform="local"; export GOBIN="${II_OUTPUT_BINPATH}/${platform}"; mkdir -p "${II_OUTPUT_BINPATH}/${platform}"; go install "cmd/image-inspector.go" )' exited with status 1
Call stack:
        1: hack/../hack/common.sh:72 ii::build::build_binaries(...)
        2: hack/build-go.sh:15 main(...)
Exiting with status 1
make: *** [Makefile:17: all] Error 1

If I comment out the resetting of $GOHOME in hack/common.sh:67 and symlink the working dir into my own $GOPATH the build works.

I feel like I'm missing a step beyond just clone then make.

@ilackarms
Copy link

worked for me:

○ → docker run -ti --rm golang:1.7.3
root@beea612be533:/go# cd src/
root@beea612be533:/go/src# mkdir -p github.com/openshift
root@beea612be533:/go/src# cd github.com/openshift/
root@beea612be533:/go/src/github.com/openshift# git clone https://github.com/openshift/image-inspector
Cloning into 'image-inspector'...
remote: Counting objects: 1929, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 1929 (delta 1), reused 0 (delta 0), pack-reused 1925
Receiving objects: 100% (1929/1929), 1.95 MiB | 415.00 KiB/s, done.
Resolving deltas: 100% (609/609), done.
Checking connectivity... done.
root@beea612be533:/go/src/github.com/openshift/image-inspector# make
hack/build-go.sh
hack/build-go.sh took 2 seconds
root@beea612be533:/go/src/github.com/openshift/image-inspector# ./_output/local/bin/local/image-inspector
2017/08/21 08:20:10 Error: docker image to inspect must be specified

@simon3z
Copy link

simon3z commented Aug 23, 2017

@jhjaggars have you resolved this? Can we close this issue?

@lphiri
Copy link

lphiri commented Aug 28, 2017

The issue is that the README doesn't explicitly tell you that you need to copy/clone your source to a location expected by the hack script, and makes it sounds like all you need to do is run "make". This may be obvious to someone familiar with the hack script, but not to a newcomer.

On Fedora, I had to either:
Either, run " sudo ln -s ~/code/image-inspector/ /usr/lib/golang/src/github.com/openshift/image-inspector" prior to running make

Or mount my image-inspector checkout in the golang image:
docker run -ti --rm -v ~/image-inspector/:/go/src/github.com/openshift/image-inspector:Z golang:1.7.3
Then run make in src/github.com/openshift/image-inspector/

@simon3z
Copy link

simon3z commented Aug 28, 2017

Anyone, any suggestion on how to improve the build mechanism or the documentation?

@ilackarms
Copy link

i think it should work as long as image-inspector is cloned to the correct place in your GOPATH

perhaps we should change the instruction to tell users to go get -d github.com/openshift/image-inspector instead of cloning the repo

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 13, 2020
@cben
Copy link

cben commented Aug 16, 2020

/lifecycle frozen

@openshift-ci-robot openshift-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

7 participants