-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
Using a dedicated package for tools.go prevents callers who import hcshim from adding the tools to their package's dependencies, while still allowing us to track and vendor them.t p Signed-off-by: Hamza El-Saawy <[email protected]> (cherry picked from commit 95c6047) Signed-off-by: Kirtana Ashok <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Tools | ||
|
||
This package contains imports to various tools used (eg, via `//go:generate`) within the hcsshim repo, | ||
allowing them to be versioned and ensuring their dependencies match what the shim use | ||
(specifically for auto-generated protobuf code). | ||
|
||
Calls to `go run <cmd/import/path>` (or `//go:generate go run <cmd/import/path>`) for go executables | ||
included here will use the version specified in `go.mod` and build the executable from vendored code. | ||
|
||
Using a dedicate package prevents callers who import `github.com/Microsoft/hcsshim` from including these | ||
tools in their dependencies. | ||
|
||
Based on golang [guidance]. | ||
|
||
## Adding Dependencies | ||
|
||
To add a new dependency, add a `_ "cmd/import/path"` to `tools.go`, and then tidy and vendor the repo. | ||
|
||
In general executables used in auto-generating code (eg, `protobuild`, `protoc-gen-go-*`, and co.), or testing | ||
(eg, `gotestsum`, `benchstat`) should be included here. | ||
|
||
[guidance]: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
//go:build tools | ||
|
||
package hcsshim | ||
package tools | ||
|
||
import ( | ||
// for go generate directives | ||
|
||
// generate Win32 API code | ||
_ "github.com/Microsoft/go-winio/tools/mkwinsyscall" | ||
|
||
// create syso files for manifesting | ||
_ "github.com/josephspurrier/goversioninfo/cmd/goversioninfo" | ||
|
||
// mock gRPC client and servers | ||
_ "github.com/golang/mock/mockgen" | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.