podman icon indicating copy to clipboard operation
podman copied to clipboard

Don't depend on github.com/crc-org/vfkit/pkg/rest

Open mtrmac opened this issue 7 months ago • 6 comments
trafficstars

Warning: Completely untested, and it would have been better authored as a commit just copying the code, + a set of refactors. I’ll happily close this, and leave full credit to, anyone who wants to do this properly.

Via github.com/gin-gonic/gin , this depends on several large encoding / decoding packages, including a JIT compiler. Maintaining <60 lines of code ourselves seems well worth it.

Note that this dependency chain only exists on darwin.

Impact: 927 files changed, 103 insertions(+), 505542 deletions(-) dropping

github.com/bytedance/sonic
github.com/bytedance/sonic/loader
github.com/cloudwego/base64x
github.com/cloudwego/iasm
github.com/gabriel-vasile/mimetype
github.com/gin-contrib/sse
github.com/gin-gonic/gin
github.com/go-playground/locales
github.com/go-playground/universal-translator
github.com/go-playground/validator/v10
github.com/goccy/go-json
github.com/klauspost/cpuid/v2
github.com/leodido/go-urn
github.com/pelletier/go-toml/v2
github.com/twitchyliquid64/golang-asm
github.com/ugorji/go/codec
golang.org/x/arch

Cc: @Luap99

Does this PR introduce a user-facing change?

None

mtrmac avatar Mar 27 '25 18:03 mtrmac

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtrmac

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Mar 27 '25 18:03 openshift-ci[bot]

Note that make-and-check-size reports exactly 0 size delta on Linux.

mtrmac avatar Mar 27 '25 18:03 mtrmac

… and another view is that this removes 21.75 % of total lines in vendor.

mtrmac avatar Mar 27 '25 18:03 mtrmac

wfm

baude avatar Mar 27 '25 18:03 baude

contrib/cirrus/pr-should-include-tests is a fair comment here, or, as a review notes above, maybe we don’t need all that parsing anyway.

@Luap99 I think I’ll leave this as a prototype for now, and I’ll let you finish / replace this as part of the larger size-reducing work.

mtrmac avatar Mar 27 '25 18:03 mtrmac

@Luap99 I think I’ll leave this as a prototype for now, and I’ll let you finish / replace this as part of the larger size-reducing work.

Sure, works for me.

Luap99 avatar Mar 27 '25 18:03 Luap99

Note to self: #25720 is a superset, this should be closed after that merges.

mtrmac avatar Mar 31 '25 14:03 mtrmac

Thanks @Luap99 !

mtrmac avatar Mar 31 '25 15:03 mtrmac