-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[WIP] Require extensions to request downloads #12703
Conversation
hey @someone13574, thanks for making a start on this! @mikayla-maki and I were talking through how this should work and we think this approach puts too much friction in the way for users. Given that they just decided to install the Zig extension, we don't want to give them another "are you sure you want the Zig extension to work?" prompt. It also seems most likely that you either want us to manage binaries or you don't. We'd like to do this so that:
|
(we're not planning to work on this immediately, so if you wanted to take this on; that would be appreciated!) |
How open would you be to integrating package managers to this as well? One approach would be a env variable containing a search command, which runs whatever command that distro uses for their "provides" command, and then extracts the package name. Then another env variable could say for the format the command. So instead of saying you need in the path, it would say you need it in path and can install it with xyz. The other way would be putting the logic in rust, but then it needs to live in your repo instead of wherever the package is built from. |
I think it'd be nice to be as helpful as possible. Although I think a few end users will enable this setting, I imagine the primary use-case is distributors. I think it'd be fine to use a static string for this for a v1 (like the ZED_UPDATE_EXPLANATION), but I'd be open to having some amount of custom logic. Maybe the v1 notification ends up looking something like:
There's some tension here with rustup/pyenv/nvm/etc. which are used to manage development environments that require multiple versions to be installed simultaneously; so while it might be handy for packagers provide a "click here to install" button that spawns a task in the terminal, I want to be mindful that we're not guiding people down a path that won't actually solve their problem. |
@ConradIrwin How about this for an api? (Many breaking changes, but that would be made up for by being a lot simpler for extensions to use). Essentially it would replace the github methods and the download method with one over-arching It would standardize/enforce how binaries are gotten and cut down the amount of boilerplate each extension needs to implement. |
My gut sense is that it'd be better to have a slightly larger API surface that is easier to understand and debug, but I don't really know what extensions need or are using right now. @maxdeviant or @mrnugget do you have any input on the above? |
(also, worth a read through: #12418; seems like it's even less clear what we should do than I thought :D). |
I wrote down quite a few usecases here: Recommend reading at least the original issue. Also related: #7894 -- if we lean more on Input on @someone13574's diagram:
|
@ConradIrwin / @mikayla-maki WDYT about supporting mirrors for binaries in addition to requiring permission / disabling their download? Both Similarly, while I totally understand why you wouldn't want to inherit the global |
Closes #12589
This a WIP PR which will make extensions require user input before downloading binaries; with the aim of making Zed a bit more friendly for the security conscious. It still requires a fair bit of work to get working well though.
Current status:
Also not sure about the best way to handle when declines occur without changing the api. Currently it just gives an Err which causes the lsp to attempt a restart.
Release Notes: