Skip to content

x/pkgsite: detect cgo (feature request) #73375

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

Open
firelizzard18 opened this issue Apr 14, 2025 · 4 comments
Open

x/pkgsite: detect cgo (feature request) #73375

firelizzard18 opened this issue Apr 14, 2025 · 4 comments
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Milestone

Comments

@firelizzard18
Copy link
Contributor

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/kolesa-team/go-webp/webp

What is your user agent?

N/A

Screenshot

No response

What did you do?

I'm trying to find native Go packages for various things, for example webp encoding.

What did you see happen?

I have to open up the package page and if it doesn't have a readme I have to open up the repo and manually check for CGo.

What did you expect to see?

If a package contains import "C" I would like to see an indicator on the package site and in search results.

@gopherbot gopherbot added this to the Unreleased milestone Apr 14, 2025
@seankhliao
Copy link
Member

Should it flag something that also provides a purego #23172 variant?
Or cgo without import C as in https://github.com/ebitengine/purego

@gabyhelp gabyhelp added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Apr 14, 2025
@firelizzard18
Copy link
Contributor Author

I would like this proposal/request to be specifically about detecting import "C". That is simple to detect (since pkgsite is already parsing files to get the AST for rendering documentation), a meaningful signal to provide, and unambiguous in terms of what the signal means and what it value it provides.

Most of the time "it doesn't require a C toolchain to compile" is good enough for me, because usually I'm concerned about cross-compiling to the big 3 OSes and x86/ARM. Today I'm working on something that needs to compile to WASM and run in a browser, so ebitengine/purego obviously won't work. But that does not reduce the utility of having a signal for "this package imports C" because at the very least it significantly reduces the number of packages I need to look through.

As far as "should pkgsite add other signals?", I would like that to be a separate proposal/request/discussion to keep this one focused. It seems to me that additional signals could be valuable but which signals should be provided and what value they provide is much less clear to me and I think that needs further discussion on it's own issue.

@seankhliao
Copy link
Member

see also #39195

@adonovan
Copy link
Member

@jba

@prattmic prattmic added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

6 participants