Skip to content
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

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

Open
owl-from-hogvarts opened this issue Apr 5, 2024 · 1 comment
Labels
A-crate-dependencies Area: [dependencies] of any kind A-local-registry-source Area: local registry sources (vendoring) C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@owl-from-hogvarts
Copy link

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

@owl-from-hogvarts owl-from-hogvarts added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Apr 5, 2024
@epage
Copy link
Contributor

epage commented Apr 5, 2024

Another potential way of dealing with this is the base paths proposal.

Renaming this to focus on the problem and not the solution.

@epage epage changed the title Add locally developed package to local registry Develop against local-only packages without ../../ or absolute paths in dependencies Apr 5, 2024
@epage epage added A-crate-dependencies Area: [dependencies] of any kind A-local-registry-source Area: local registry sources (vendoring) labels Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-crate-dependencies Area: [dependencies] of any kind A-local-registry-source Area: local registry sources (vendoring) C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants