Skip to content

rebar.lock reports the app name instead of the Hex package name for renamed packages #175

Done

Description

@andrew

In a rebar.lock entry of the form {<<"app">>,{pkg,<<"package">>,<<"version">>},Level}, the app and package names differ when rebar.config declares a dependency as {jiffy, "1.1.1", {pkg, jiffy_fork}}, which installs the Hex package jiffy_fork under the application name jiffy. rebarPkgRegex in internal/rebar/rebar.go has a capture group for the first name only, so this entry:

{<<"jiffy">>,{pkg,<<"jiffy_fork">>,<<"1.1.1">>},0}

is returned by Parse as jiffy at 1.1.1 with the PURL pkg:hex/jiffy@1.1.1, while the installed Hex package is jiffy_fork. The rebar.config parser in #174 returns pkg:hex/jiffy_fork for the same dependency, so the manifest and lockfile of one project would produce two different PURLs for it.

Capturing the name inside {pkg, ...} and using it for Name fixes this and changes the Name and PURL that callers receive for renamed packages; the lockfile test needs a renamed entry. rebar3 keys the pkg_hash and pkg_hash_ext sections by the app name (expand_locks in apps/rebar/src/rebar_config.erl), so the integrity lookup in rebarPackageHashes needs the first capture as its key.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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