Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

undocumented go deps when building with MKDOCS=1 and build should fail properly #27

Closed
JoKoT3 opened this issue Jul 26, 2018 · 2 comments

Comments

@JoKoT3
Copy link

JoKoT3 commented Jul 26, 2018

Describe the bug
MKDOCS=1 build.sh linux 1.8.0 fail because of unmet dependencies

To Reproduce
Steps to reproduce the behavior:

  1. Not having the following dependencies in your GOPATH
    github.com/cpuguy83/go-md2man/md2man
    gopkg.in/yaml.v2
  2. Run the command 'MKDOCS=1 build.sh linux 1.8.0'
  3. See error:
+ env GOOS=linux GOARCH=386 go build --tags docs -o dbdeployer-1.8.0-docs.linux .
../../spf13/cobra/doc/man_docs.go:26:2: cannot find package "github.com/cpuguy83/go-md2man/md2man" in any of:
	/usr/lib/go/src/github.com/cpuguy83/go-md2man/md2man (from $GOROOT)
	/home/john/go/src/github.com/cpuguy83/go-md2man/md2man (from $GOPATH)
tar: dbdeployer-1.8.0-docs.linux: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

+ env GOOS=linux GOARCH=386 go build --tags docs -o dbdeployer-1.8.0-docs.linux .
../../spf13/cobra/doc/yaml_docs.go:26:2: cannot find package "gopkg.in/yaml.v2" in any of:
	/usr/lib/go/src/gopkg.in/yaml.v2 (from $GOROOT)
	/home/john/go/src/gopkg.in/yaml.v2 (from $GOPATH)

Expected behavior

  1. docs should state
    github.com/cpuguy83/go-md2man/md2man
    and
    gopkg.in/yaml.v2
    Although they seems to be dependencies of the cobra lib, and not dbdeployer

  2. build should properly fail

Environment:

  • OS: Arch Linux
  • dbdeployer version 1.8.0
  • tarball full name: NA
  • tarball origin: NA

Additional context
My GO SRC only contained:
spf13/cobra
jteeuwen/go-bindata
datacharmer/dbdeployer
before trying to build

@datacharmer
Copy link
Owner

Thanks for reporting this issue.
The build script should add the docs package when compiling with MKDOCS.
I will fix it when I am back from travel.

@datacharmer
Copy link
Owner

Fixed in latest commit.
Now, when building with MKDOCS and spf13/cobra/docs was not in path, an appropriate message suggests which 'go get' command would solve the problem. No build is attempted before the dependencies are correct.

datacharmer pushed a commit that referenced this issue Aug 6, 2018
* Better fixes Issue #6 and Issue #27
* Now dependencies are handled directly from the vendor folder.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants