Skip to content

Create tools package to isolate dependencies#1840

Merged
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:tools-pkg
Jul 18, 2023
Merged

Create tools package to isolate dependencies#1840
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:tools-pkg

Conversation

@helsaawy
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

@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 <hamzaelsaawy@microsoft.com>
@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 <hamzaelsaawy@microsoft.com>
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 <hamzaelsaawy@microsoft.com>
Copy link
Copy Markdown

@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 <hamzaelsaawy@microsoft.com>
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 <hamzaelsaawy@microsoft.com>
(cherry picked from commit 95c6047)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
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 <hamzaelsaawy@microsoft.com>
(cherry picked from commit 95c6047)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
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 <hamzaelsaawy@microsoft.com>
(cherry picked from commit 95c6047)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
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