Skip to content

Develop against local-only packages without ../../ or absolute paths in dependencies #13708

@owl-from-hogvarts

Description

@owl-from-hogvarts

Problem

I am developing set of library crates for personal use. I want to reuse them in several projects of mine. I do not want to publish the libraries or final projects anywhere to the internet or any even private servers as they are for my personal use only (university tasks).
I don't like to specify path dependencies as paths may look like: ../../../library-crates/project. So path dependencies are not an option for me!

Workspaces and other stuff is discussed in linked stackoverflow question

Proposed Solution

Allow adding locally developed unpublished crates to local-registry (that is source of type directory and local-registry) .

The approach is similar to maven which allows to mvn install package to local repository and later reuse it as regular dependency in other project without specifying obscure paths.

Npm supports similar workflow:

npm link --global # links package to global registry
npm link --global my-personal-library # links package from global registry to dependencies of another project

Notes

In context of this issue local means located on exact same machine, served ideally through filesystem. Some kind of daemon is also acceptable

Link to relevant stackoverflow question: https://stackoverflow.com/questions/78279201/how-to-add-local-package-to-local-registry-in-cargo

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crate-dependenciesArea: [dependencies] of any kindA-local-registry-sourceArea: local registry sources (vendoring)C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions