feat: relative directory usage type#426
Open
andrius-puksta-sensmetry wants to merge 1 commit into
Open
Conversation
bf8a126 to
2efe572
Compare
This was referenced Jul 2, 2026
Merged
c4d77cd to
1b89d44
Compare
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com> WIP Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com> WIP Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
1b89d44 to
db00459
Compare
Collaborator
Why are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for referencing local directory paths as project dependencies, alongside the existing IRI/URL-based usages. It also refines the resolution API to carry richer context and adds an experimental CLI subcommand to expose the new capability.
New Directory usage type
A new variant
Directory { dir, publisher, name }is added toInterchangeProjectUsageG. It serialises as{"dir": "relative/path", "publisher": "...", "name": "..."}. It only supportslocal_srcprojects. KPARs will use another type. This is to keep resolution unambiguous. It allows avoiding resolution altogether for typed usages, although currently resolution is still done.ResolutionInforeplaces IRIsResolveReadnow takes aResolutionInfoinstead of an IRI.ResolutionInfowrapsInterchangeProjectUsageand an optionalbase_pathfor resolving relative filesystem paths. A customHashimplementation is included so thatpubgrubidentifies packages by identity (publisher + name) rather than version constraint, preventing the same package from appearing multiple times in the solution when it has different constraints/path in different dependents.experimentalCLI subcommand (sysand/src/cli.rs)Adds
sysand experimental add --dir <path>andsysand experimental remove <publisher> <name>:addcomputes a path relative to the current project, populates publisher/name from the dependency's.project.json, and creates aDirectoryusage.Currently no source overrides are supported by this command. It does not seem useful to support this at
addtime, considering that typed usages will support everything supported by source overrides, so these usages can be added directly instead of going through overrides.removeremoves a project by its publisher and name. This will work for all usage types that include a publisher and name, currently I plan for all typed usages to have this for consistency.Commands are separate from regular
add/removeto avoid breaking changes; also it's not clear how the UX will work for other usage types (addespecially), so this leaves room to experiment.