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.
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
Unlocked deps #393
base: main
Are you sure you want to change the base?
Unlocked deps #393
Changes from 1 commit
3ea9ec6
0b4ea58
31547a0
01f76d1
0ae3a33
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intended to support
foo:bar
here exactly? Or is a/interface
required as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that, when
/interface
is absent, the expectation could be that a registry is used to resolvens:package
to a component and the interface is the exports of that component (which have no name).More hypothetically, if we get unnamed interfaces/worlds in WIT,
/interface
could also be absent without relying on a registry by using a nested package of the form:WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But perhaps this is a good opportunity to make clear that the optional
/interface
is possible as well, and maybe talk a bit about in which cases toolchains would create anunlocked-dep
with and without an interface projection? If we wanted to scope it in, folks could specify an interface when they add a dep and tools could only grab interfaces they need from the registry. And also thelock
orbundle
command could shake out unused interfaces in cases as well. May be more than we want for the initial discussion, but I was thinking that folks may find it confusing to only see a componentfoo:bar
when they're accustomed to depending on interfaces at the moment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fundamentally, an
unlocked-dep
(in the componentimportname
) names a component via package name and so, for a simple illustrative example like this, I think makes sense to similarly start withunlocked-dep
naming a package. (Yes, it's different that regular interface imports, but being different is the point.) The/interface
only shows up after inlining registry contents and is only necessary due to current expressive limitations of WIT; ideally it wouldn't ever be necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this spec out the
interface { ... }
change as well in that case? That's not currently implemented or sketched out here, so I think that should be included too if that's the intention. (also could this update the ebnf forunlocked-dep
in worlds too?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be up for that; it would simplify things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great I should be able to add some of these updates soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an alternative to adding unnamed interfaces/worlds (which open up another set of design questions), we could instead add a bit of also-useful syntax that allows the WIT to capture precisely how the range query was resolved:
This
= <pkgname>
right-hand-side of theimport dependency
is necessary for advanced cases where the WIT needs to nest multiple versions of the same package such that the<pkgnamequery>
alone would be ambiguous. Importantly for our purposes here, though, none of the name/version info in the= <pkgname>
shows up in the import so our worldw
above just contains(import "unlocked-dep=<gh:sqlite@{>=1.0.0}>" (instance ...))
(no/exports
, no1.1.1
), and we didn't need anonymous interfaces to achieve that.