Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create tools package to isolate dependencies #1840

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

helsaawy
Copy link
Contributor

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.

@helsaawy helsaawy requested a review from a team as a code owner July 11, 2023 22:30
tools/tools.go Outdated
Comment on lines 3 to 14
// This package contains imports to various tools used (eg, via //go:generate) within this repo,
// allowing them to be versioned and ensuring their dependncies match what the shim use (specifically
// for auto-generated protobuf code).
// Having tools vendored allows `go run <cmd/import/path>` to work without needing to specify a version
// or download code.
//
// Using a dedicate package prevents callers who import github.com/Microsoft/hcsshim from including these
// in their dependencies.
//
// Based on golang [guidance].
//
// [guidance]: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we should break this out into a README and include more information about when to add new dependencies in here and how. Thoughts?

Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small request, but otherwise lgtm

@helsaawy helsaawy force-pushed the tools-pkg branch 2 times, most recently from 630842f to cd352b2 Compare July 18, 2023 14:58
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]>
@helsaawy helsaawy merged commit 95c6047 into microsoft:main Jul 18, 2023
@helsaawy helsaawy deleted the tools-pkg branch July 18, 2023 15:40
helsaawy added a commit to helsaawy/go-winio that referenced this pull request Jul 21, 2023
Use `./tools` to prevent callers of `go-winio` from needing to add tools
to their dependencies.

Similar to microsoft/hcsshim#1840

Signed-off-by: Hamza El-Saawy <[email protected]>
helsaawy added a commit to helsaawy/go-winio that referenced this pull request Jul 21, 2023
Use `./tools` to prevent callers of `go-winio` from needing to add tools
to their dependencies.

Similar to microsoft/hcsshim#1840

Signed-off-by: Hamza El-Saawy <[email protected]>
Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

helsaawy added a commit to microsoft/go-winio that referenced this pull request Jul 21, 2023
Use `./tools` to prevent callers of `go-winio` from needing to add tools
to their dependencies.

Similar to microsoft/hcsshim#1840

Signed-off-by: Hamza El-Saawy <[email protected]>
kiashok pushed a commit to kiashok/hcsshim that referenced this pull request Aug 16, 2023
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]>
kiashok pushed a commit to kiashok/hcsshim that referenced this pull request Oct 12, 2023
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]>
kiashok pushed a commit that referenced this pull request Oct 13, 2023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants