Closed autarch closed 6 years ago
I should note that the actual binaries end up in $TMPDIR/gometalinter-2.0.5-linux-amd64
.
@autarch Oh thanks for the report. I use gometalinter a lot and didn't know they used goreleaser.
I'll check it out.
n
Issue is with the wrap_in_directory
directive which is 'new' and godownloader doesn't understand it (it's probably not actually new, but new to me)
on it @autarch
archive:
format: tar.gz
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
name_template: '{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- COPYING
- README*
gometalinter is an especially great example since it also bundles in all the linters with separate build stanza (see #28)
also, I went to school at U of MN @autarch
should be fixed... let us know
$ ./samples/godownloader-gometalinter.sh
alecthomas/gometalinter info checking GitHub for latest tag
alecthomas/gometalinter info found version: 2.0.5 for v2.0.5/darwin/amd64
alecthomas/gometalinter info installed as ./bin/gometalinter
alecthomas/gometalinter info installed as ./bin/gocyclo
alecthomas/gometalinter info installed as ./bin/nakedret
alecthomas/gometalinter info installed as ./bin/misspell
alecthomas/gometalinter info installed as ./bin/govet
alecthomas/gometalinter info installed as ./bin/gas
alecthomas/gometalinter info installed as ./bin/golint
alecthomas/gometalinter info installed as ./bin/ineffassign
alecthomas/gometalinter info installed as ./bin/goconst
alecthomas/gometalinter info installed as ./bin/errcheck
alecthomas/gometalinter info installed as ./bin/maligned
alecthomas/gometalinter info installed as ./bin/unconvert
alecthomas/gometalinter info installed as ./bin/dupl
alecthomas/gometalinter info installed as ./bin/structcheck
alecthomas/gometalinter info installed as ./bin/varcheck
alecthomas/gometalinter info installed as ./bin/safesql
alecthomas/gometalinter info installed as ./bin/deadcode
alecthomas/gometalinter info installed as ./bin/lll
alecthomas/gometalinter info installed as ./bin/goimports
alecthomas/gometalinter info installed as ./bin/gotype
alecthomas/gometalinter info installed as ./bin/gosimple
alecthomas/gometalinter info installed as ./bin/megacheck
alecthomas/gometalinter info installed as ./bin/staticcheck
alecthomas/gometalinter info installed as ./bin/unused
alecthomas/gometalinter info installed as ./bin/interfacer
alecthomas/gometalinter info installed as ./bin/unparam
also, I went to school at U of MN
@client9 - me too, that's why I live here in Mpls.
This still doesn't seem to be working ...
$> install-gometalinter.sh -d
alecthomas/gometalinter info checking GitHub for latest tag
alecthomas/gometalinter debug http_download https://github.com/alecthomas/gometalinter/releases/latest
alecthomas/gometalinter info found version: 2.0.5 for v2.0.5/linux/amd64
alecthomas/gometalinter debug http_download https://github.com/alecthomas/gometalinter/releases/download/v2.0.5/gometalinter-2.0.5-linux-amd64.tar.gz
$> ls -l /tmp/tmp.R0XI3hXWjR/
total 0
So now it's failing to download the tarball because the directory into which it tries to download does not exist, but that's not what it should do anyway. It should download into the newly created tmpdir, then untar it, then install from the dir created by the tarball. Here's an edited execute
that works for me:
execute() {
TMPDIR=$(mktmpdir)
TARBALLDIR="${TMPDIR}/${NAME}"
http_download "${TMPDIR}/${TARBALL}" "${TARBALL_URL}"
http_download "${TMPDIR}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${TMPDIR}/${TARBALL}" "${TMPDIR}/${CHECKSUM}"
(cd "${TMPDIR}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "gometalinter" "gocyclo" "nakedret" "misspell" "govet" "gas" "golint" "ineffassign" "goconst" "errcheck" "maligned" "unconvert" "dupl" "structcheck" "varcheck" "safesql" "deadcode" "lll" "goimports" "gotype" "gosimple" "megacheck" "staticcheck" "unused" "interfacer" "unparam" ; do
if [ "$OS" = "windows" ]; then
binexe="${binexe}.exe"
fi
install "${TARBALLDIR}/${binexe}" "${BINDIR}/"
log_info "installed ${BINDIR}/${binexe}"
done
}
Oh I think this might be due to a slight out of date version of godownloader (sorry no versions on this yet.. that's coming very soon).
can you re-install or re-build (make sure you do a 'make install' not just 'make build')
and/or use
thanks!
n
I installed the latest godownloader with go get -u
. The shell file you link has the exact problem I describe. It untars the tarball inside a directory named after the tarball, creating yet another subdirectory with that same name, which it then ignores.
ok thanks for your patience @autarch
Looks like the problem was with my tmpdir which all sorts of half-downloaded gometalinter files masking the problem
Should be fixed now, and now RM the tarball dir before the un-tarring to prevent this type of thing from happening again.
Yes, this now appears to be fixed.
The problem is that that after untarring the downloaded tarball in
$TMPDIR
, it assumes that$TMPDIR
contains the binaries. But in this case$TMPDIR
contains this: