aws / aws/session-manager-plugin

Makefile build failure

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
320
Forks
97
PR merge metrics
No merged PRs in 30d

Description

It appears the makefile or some dependency management in the build process calls a deprecated call within go, its using go get rather than go install or go mod tidy (to download go packages) in Tools/src/checkstyle.sh

```
Try update 'goimports'
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
Run 'goimports'
```

```sh
#!/usr/bin/env bash
echo "Run checkstyle script"

# run gofmt
echo "Run 'gofmt'"
unformatted=$(gofmt -l `pwd`/src/)
if [[ -n $unformatted ]]; then
echo >&2 "Error: Found files not formatted by gofmt"
for fi in $unformatted; do
echo >&2 $fi
done
echo "Please run 'gofmt -w' for files listed."
exit 1
fi

# run goimports
echo "Try update 'goimports'"
GOPATH=`pwd`/Tools go get golang.org/x/tools/cmd/goimports # go mod tidy or go install

echo "Run 'goimports'"
unformatted=$(Tools/bin/goimports -l `pwd`/src/)
if [[ -n $unformatted ]]; then
echo >&2 "Error: Found files not formatted by goimports"
for f in $unformatted; do
echo >&2 $f
done
echo "Please run 'goimports -w' for files listed."
exit 1
fi

echo "Run 'go vet'"
ln -s `pwd` `pwd`/vendor/src/github.com/aws/session-manager-plugin
go vet ./src/...
```

-------
Edit:

Also appears the dependency tools/cmd/goimports does not seem to exist any longer (after changing the line identified above on my system):
```
Try update 'goimports'
cannot find package "golang.org/x/tools/cmd/goimports" in any of:
/usr/lib/go-1.24/src/golang.org/x/tools/cmd/goimports (from $GOROOT)
/home/kali/src/session-manager-plugin-1.2.707.0/Tools/src/golang.org/x/tools/cmd/goimports (from $GOPATH)
Run 'goimports'
/home/kali/src/session-manager-plugin-1.2.707.0/Tools/src/checkstyle.sh: line 21: Tools/bin/goimports: No such file or directory
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.