Skip to content

Conversation

@mtrmac
Copy link
Contributor

@mtrmac mtrmac commented Mar 27, 2025

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 27, 2025

[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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2025
@github-actions github-actions bot added machine and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 27, 2025
@mtrmac mtrmac changed the title Don't depend on github.com/crc-org/vfkit Don't depend on github.com/crc-org/vfkit/pkg/rest Mar 27, 2025
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

@baude PTAL would you have any concerns with that?
I have not tried to look up the history of this but the diff makes we very much in favour, the code seems trivial to maintain on our side.

return nil, fmt.Errorf("invalid unix uri: socket path length exceeds macOS limits")
}
return []string{"--restful-uri", fmt.Sprintf("unix://%s", uri.Path)}, nil
case "TCP", "HTTP":
Copy link
Member

Choose a reason for hiding this comment

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

AFAIK podman always seem to use an http API socket so this could be simplified even further.

(I might need to check why we use a tcp socket at all, unix seems much better suited for local IPC)

Copy link
Contributor Author

@mtrmac mtrmac Mar 27, 2025

Choose a reason for hiding this comment

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

Yes, I see things like mc.AppleHypervisor.Vfkit.Endpoint = localhostURI + ":" + strconv.Itoa(randPort), but that’s a few layers away from the call site.

I’m all in favor of simplifying further, but I’ll leave that to Podman experts.

@mtrmac
Copy link
Contributor Author

mtrmac commented Mar 27, 2025

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

@mtrmac
Copy link
Contributor Author

mtrmac commented Mar 27, 2025

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

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.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2025
@baude
Copy link
Member

baude commented Mar 27, 2025

wfm

@mtrmac
Copy link
Contributor Author

mtrmac commented Mar 27, 2025

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 mtrmac marked this pull request as draft March 27, 2025 18:51
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 27, 2025
@Luap99
Copy link
Member

Luap99 commented Mar 27, 2025

@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.

@mtrmac
Copy link
Contributor Author

mtrmac commented Mar 31, 2025

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

@mtrmac
Copy link
Contributor Author

mtrmac commented Mar 31, 2025

Thanks @Luap99 !

@mtrmac mtrmac closed this Mar 31, 2025
@mtrmac mtrmac deleted the no-vfkit branch March 31, 2025 15:56
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jun 30, 2025
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants