Skip to content

Commit

Permalink
Remove indirect build dependency on go-license-detector. (#457) (#459)
Browse files Browse the repository at this point in the history
* Remove indirect build dependency on go-license-detector.
The 'go tidy' command in go1.16.5 stripped the hash from go.sum breaking the dependencies-report script.
Explictly install the [email protected] script and invoke directly.

* Fix paths for schema generator and license as well.

* Properly version URL for schema-generate.

(cherry picked from commit 6f636f7)

Co-authored-by: Sean Cunningham <[email protected]>
  • Loading branch information
mergify[bot] and Sean Cunningham authored Jun 15, 2021
1 parent 6af3e35 commit 74c4038
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 43 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ LDFLAGS=-w -s -X main.Version=${VERSION} -X main.Commit=${COMMIT}
CMD_COLOR_ON=\033[32m\xE2\x9c\x93
CMD_COLOR_OFF=\033[0m

# Directory to dump build tools into
GOBIN=$(shell go env GOPATH)/bin/

.PHONY: help
help: ## - Show help message
@printf "${CMD_COLOR_ON} usage: make [target]\n\n${CMD_COLOR_OFF}"
Expand All @@ -42,9 +45,9 @@ clean: ## - Clean up build artifacts
.PHONY: generate
generate: ## - Generate schema models
@printf "${CMD_COLOR_ON} Installing module for go generate\n${CMD_COLOR_OFF}"
go install github.com/aleksmaus/generate/...
env GOBIN=${GOBIN} go install github.com/aleksmaus/generate/cmd/schema-generate@latest
@printf "${CMD_COLOR_ON} Running go generate\n${CMD_COLOR_OFF}"
go generate ./...
env PATH=${GOBIN}:${PATH} go generate ./...

.PHONY: check
check: ## - Run all checks
Expand All @@ -56,8 +59,8 @@ check: ## - Run all checks

.PHONY: check-headers
check-headers: ## - Check copyright headers
@go install github.com/elastic/go-licenser
@go-licenser -license Elastic
@env GOBIN=${GOBIN} go install github.com/elastic/go-licenser@latest
@env PATH=${GOBIN}:${PATH} go-licenser -license Elastic

.PHONY: check-go
check-go: ## - Run go fmt, go vet, go mod tidy
Expand All @@ -70,7 +73,8 @@ notice: ## - Generates the NOTICE.txt file.
@echo "Generating NOTICE.txt"
@go mod tidy
@go mod download all
go list -m -json all | go run go.elastic.co/go-licence-detector \
@env GOBIN=${GOBIN} go install go.elastic.co/go-licence-detector@latest
go list -m -json all | env PATH=${GOBIN}:${PATH} go-licence-detector \
-includeIndirect \
-rules dev-tools/notice/rules.json \
-overrides dev-tools/notice/overrides.json \
Expand Down
31 changes: 0 additions & 31 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,6 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/aleksmaus/generate
Version: v0.0.0-20210326194607-c630e07a2742
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/aleksmaus/[email protected]/LICENSE.txt:

MIT License

Copyright (c) 2017 Adrian Hesketh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/dgraph-io/ristretto
Version: v0.1.0
Expand Down
4 changes: 3 additions & 1 deletion dev-tools/dependencies-report
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ done

go mod tidy
go mod download
go list -m -json all $@ | go run go.elastic.co/go-licence-detector \
GOPATH=`go env GOPATH`
env GOBIN=$GOPATH/bin/ go install go.elastic.co/[email protected]
go list -m -json all $@ | $GOPATH/bin/go-licence-detector \
-includeIndirect \
-rules "$SRCPATH/notice/rules.json" \
-overrides "$SRCPATH/notice/overrides.json" \
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.16

require (
github.com/Pallinder/go-randomdata v1.2.0
github.com/aleksmaus/generate v0.0.0-20210326194607-c630e07a2742
github.com/dgraph-io/ristretto v0.1.0
github.com/elastic/beats/v7 v7.11.1
github.com/elastic/elastic-agent-client/v7 v7.0.0-20200709172729-d43b7ad5833a
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/aleksmaus/generate v0.0.0-20210326194607-c630e07a2742 h1:lDBhj+4eBCS9tNiJLXrNbvwO5xwkn2/kjvy+tO+PWlI=
github.com/aleksmaus/generate v0.0.0-20210326194607-c630e07a2742/go.mod h1:lvlu2Ij1bLmxB8RUWyw5IQ4/JcLX60eYhLiBmvImnhk=
github.com/andrewkroh/goja v0.0.0-20190128172624-dd2ac4456e20 h1:7rj9qZ63knnVo2ZeepYHvHuRdG76f3tRUTdIQDzRBeI=
github.com/andrewkroh/goja v0.0.0-20190128172624-dd2ac4456e20/go.mod h1:cI59GRkC2FRaFYtgbYEqMlgnnfvAwXzjojyZKXwklNg=
github.com/andrewkroh/sys v0.0.0-20151128191922-287798fe3e43 h1:WFwa9pqou0Nb4DdfBOyaBTH0GqLE74Qwdf61E7ITHwQ=
Expand Down
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import (
"fmt"
"os"

// Needed for the generator not to be nuked by go tidy. Fails make check otherwise.
_ "github.com/aleksmaus/generate"

"github.com/elastic/fleet-server/v7/cmd/fleet"
)

Expand Down

0 comments on commit 74c4038

Please sign in to comment.