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

Implement platform-specific extensions #8152

Closed
7 of 8 tasks
Colengms opened this issue Sep 14, 2021 · 23 comments
Closed
7 of 8 tasks

Implement platform-specific extensions #8152

Colengms opened this issue Sep 14, 2021 · 23 comments
Assignees
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. internal Used to opt-out an issue from having GitHub actions applied to it Language Service
Projects

Comments

@Colengms
Copy link
Collaborator

Colengms commented Sep 14, 2021

  • Update minimum required VS Code version to 1.61
  • Replace "*" in package.json with actual events
  • Remove "*" activation logic (remove rewrite logic, merge activation and realActivation, remove TemporaryCommandRegistrar)
  • Remove code that downloads platform-binaries and checks install.lock
  • Remove 'runtime dependencies' from package.json
  • Update Offline release pipeline to add --target <platform> when packaging each vsix
  • Add manual intervention step after building vsix'es, before invoke vsce publish to publish each vsix
  • Remove Online release pipeline

Platform-Specific Extension Documentation

@Colengms Colengms added Language Service Feature Request installation internal Used to opt-out an issue from having GitHub actions applied to it labels Sep 14, 2021
@Colengms Colengms added this to the 1.7.0 milestone Sep 14, 2021
@Colengms Colengms self-assigned this Sep 14, 2021
@Colengms Colengms added this to Triage in 1.7.0 via automation Sep 14, 2021
@isidorn
Copy link

isidorn commented Sep 15, 2021

@Colengms thanks a lot for creating this
Refs: microsoft/vscode#23251

@Tyriar
Copy link
Member

Tyriar commented Oct 28, 2021

Replace "*" in package.json with actual events

Please also avoid using workspace contains if possible, as the extension is far too heavy to activate for projects that contain C++ but may not be the language being worked on.

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2021

@Tyriar, I'm confused. What other triggers would we activate on then? That is the most important one. Don't all language extensions activate on the presence of their language in the workspace folder? Why else would the facility exist?

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2021

Nevermind. I should have looked at our activationEvents first. We use:

        "onLanguage:c",
        "onLanguage:cpp",
        "onLanguage:cuda-cpp",

and workspaceContains is only used to look for our configuration file .vscode/c_cpp_properties.json

@Tyriar
Copy link
Member

Tyriar commented Oct 28, 2021

and workspaceContains is only used to look for our configuration file .vscode/c_cpp_properties.json

@bobbrow can that be deferred until a C++ file is opened instead?

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2021

Can you explain why? If they have this file, then it means the repo is specifically configured for C++ and our extension should load. Python and C# have a similar approach.

@Tyriar
Copy link
Member

Tyriar commented Oct 28, 2021

@bobbrow I suppose an explicit c_cpp_properties.json is fine since it's the file owned by the extension*, as long as it's not checking for *.cpp/h/etc.

An extreme example of where the latter would be damaging is the Chromium codebase which contains C++, Python, C#, JS, PowerShell, ... all these language extensions activating would be obnoxious, forcing the user to either live with a degraded experience (more UI, slower exthost, less available RAM/CPU, slower startup) or micromanage extension enablement. It's enough for the core already to deal with such a large amount of files.

* The extension doesn't create it automatically does it? I had problems in the past with the C++ extension changing files in the workspace without me doing anything.

@bobbrow
Copy link
Member

bobbrow commented Oct 28, 2021

@bobbrow I suppose an explicit c_cpp_properties.json is fine since it's the file owned by the extension*, as long as it's not checking for *.cpp/h/etc.

Yes that file is ours, and we don't do workspaceContains on file extensions.

* The extension doesn't create it automatically does it? I had problems in the past with the C++ extension changing files in the workspace without me doing anything.

We should only be creating or edit that file if someone explicitly invokes one of our C/C++: Edit Configurations commands*. We operate on a default configuration otherwise. If you notice it being added or edited automatically in some other case, that is most likely a bug and we would want to know about it. We received enough feedback in the early days to learn that once that file exists we shouldn't touch it without a really good reason. There are other extensions out there that will try to change our file, but we do not sanction it.

* Actually, the C/C++: Change Configuration Provider can edit the file too if it exists. If it doesn't, it changes a workspace setting instead. But again, this is a user-initiated action, not automatic.

An extreme example of where the latter would be damaging is the Chromium codebase which contains C++, Python, C#, JS, PowerShell, ... all these language extensions activating would be obnoxious, forcing the user to either live with a degraded experience (more UI, slower exthost, less available RAM/CPU, slower startup) or micromanage extension enablement. It's enough for the core already to deal with such a large amount of files.

I'm fairly certain that there is not a c_cpp_properties.json file checked in to the root of the Chromium repo, so if it exists I would have to assume it's because the cloner of the repo wanted it there.

@heartacker
Copy link

c# has add this implement, dotnet/vscode-csharp#4775 hope that we can earn it ASAP

@bobbrow
Copy link
Member

bobbrow commented Nov 19, 2021

Our next release (1.8.0) will have it.

@Colengms
Copy link
Collaborator Author

HI @isidorn , I noticed that vsce login doesn't accept a PAT directly. Is there a way to script login such that no user interaction is required (so we can automate that step - publishing 10 VSIX's) ?

@isidorn
Copy link

isidorn commented Dec 15, 2021

@Colengms great that you are automating this.
I suggest to follow the sample that @joaomoreno created here https://github.com/microsoft/vscode-platform-specific-sample/blob/main/.github/workflows/ci.yml

So yes, you can use the VSCE_PAT env variable. Example how Joao sets it.

@Colengms Colengms modified the milestones: On Deck, 1.8.0 Dec 15, 2021
@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 12, 2022
@Colengms Colengms moved this from In progress to Done in 1.8 Jan 12, 2022
@sean-mcmanus sean-mcmanus modified the milestones: 1.8.0, 1.8.0-insiders3 Jan 19, 2022
@isidorn
Copy link

isidorn commented Feb 2, 2022

👏 🎉 🚀

@puremourning
Copy link

After this change, is there any way to get the vscode-cpptools packages from a known URL ? the vscode marketplace doesn't (to my knowledge) allow direct downloads for offline use

@sean-mcmanus
Copy link
Collaborator

@puremourning The marketplace allows direct downloads, e.g. https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/cpptools//vspackage?targetPlatform=linux-x64

@puremourning
Copy link

Unfortunately, that's heavily rate-limited and frequency leads to HTTP 429 when this is automated in any way (e.g. in CI, or as part of other DAP client's installation tools):

ben@BenMBP2021 gadget_upgrade % ./download_and_checksum_gadget.py vscode-cpptools
Downloading https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/cpptools/1.9.7/vspackage?targetPlatform=l
inux-x84 to ./cpptools-linux.vsix
Failed - HTTP Error 429: , will retry in 1 seconds

@puremourning
Copy link

It seems that the marketplace has a CDN api of some sort, but it seems ... internal... https://github.com/actions/virtual-environments/pull/3244/files / https://github.com/microsoft/vscode/pull/16275/files.

To explain why this matters to me vimspector has an installer which grabs the vsix and uses the debug adapter out of it. It does this for a number of things and while a few of them are using the marketplace, these are not let's say high-volume, but almost all vimspector users install vscode-cpptools and I use it my CI, so it's likely to hit the 429 issue frequently.

@sean-mcmanus
Copy link
Collaborator

@puremourning We could potentially go back to our old practice of posting the vsix's on our GitHub Release's page. Do you know if those have the same issue or are you requesting the binaries be available via the fwlinks?

@puremourning
Copy link

GitHub releases work great! If you would be willing to add them as artefacts in the GitHub releases that would completely solve my issue!

@sean-mcmanus
Copy link
Collaborator

@puremourning Did you want that for pre-releases, which we stopped posting Release pages on GitHub, or the non-pre-release releases (i.e. 1.7.1, 1.8,4, 1.9.7)?

@puremourning
Copy link

I only grab release versions, so 1.9.7, etc. for me, there's no need to go earlier than 1.9.7 as I'm going to update to that now but if you can upload them for future 'release' versions that would be great.

@sean-mcmanus
Copy link
Collaborator

@puremourning Sure, we can start doing that. The 1.9.7 vsix's have been added: https://github.com/microsoft/vscode-cpptools/releases/tag/v1.9.7

@puremourning
Copy link

@sean-mcmanus thank you so much. You're an absolute hero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. internal Used to opt-out an issue from having GitHub actions applied to it Language Service
Projects
No open projects
1.8
Done
Development

No branches or pull requests

7 participants