Skip to content

Commit

Permalink
deps: update oapi-codegen to v2 (scionproto#4432)
Browse files Browse the repository at this point in the history
The oapi-codegen libraries went through a reorganization; the
repositories for the oapi-codegen build tool was separated from the
runtime libraries.
In our normal code dependencies, the oapi-codegen build tool no longer
shows up. Import it in a dummy .go file as an easy way to ensure that we
have all the appropriate dependencies (via the `go.mod`/`go_deps.bzl`) .
This leaves some clutter in the `go.mod` file which is not aesthetically
pleasing, but is not a real issue due to dependency graph 
pruning.
The alternative solution would have been to manage the dependencies of
the `rules_openapi` bazel rules explicitly in a `rules_openapi_dependencies` 
macro. This turns out to be rather cumbersome, and can lead to
unexpected or even invalid dependency version combinations, because
`rules_go` does not have a way to separate the dependencies of the build
tools from the dependencies of the code.

Aside; fix `cfg = "exec"` for the oapi-codegen buildtool so that this
tool is built for the environment of the builder, not the target
platform.
  • Loading branch information
matzf authored and juagargi committed Mar 8, 2024
1 parent d711165 commit 0f78c34
Show file tree
Hide file tree
Showing 42 changed files with 1,741 additions and 1,008 deletions.
3 changes: 1 addition & 2 deletions control/mgmtapi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ go_library(
"//private/mgmtapi/segments/api:go_default_library",
"//private/storage:go_default_library",
"//private/storage/beacon:go_default_library",
"@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep
"@com_github_getkin_kin_openapi//openapi3:go_default_library", # keep
"@com_github_go_chi_chi_v5//:go_default_library", # keep
"@com_github_pkg_errors//:go_default_library", # keep
"@com_github_oapi_codegen_runtime//:go_default_library", # keep
"@org_golang_google_protobuf//proto:go_default_library",
],
)
Expand Down
Loading

0 comments on commit 0f78c34

Please sign in to comment.