Skip to content

Name the fix in the "unknown ecosystem" error #53

Description

@andrew

FetchPackageFromPURL(ctx, "pkg:pypi/flask", c) returns

unknown ecosystem: pypi

when the caller has imported github.com/git-pkgs/registries but not github.com/git-pkgs/registries/all (or the specific ecosystem package). The ecosystem is supported; its init() just hasn't run.

Suggested change in internal/core/registry.go where the error is built:

unknown ecosystem "pypi" (0 registered; import _ "github.com/git-pkgs/registries/all" or the specific ecosystem package)

Including the count of registered ecosystems (len(registryFactories)) makes it clear whether nothing is registered vs. this one is genuinely unsupported.

Hit this in alpha-omega-security/hyrum where npm happened to work (something else registered it transitively) and pypi didn't, which made the failure look ecosystem-specific rather than an import-side-effect issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions