-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Support updating an extension to more specific target platform version #141696
Comments
Irrespective of MP validation, VS Code should not allow installing |
When you said you noticed different target platform property in |
@sandy081 This is with the C/C++ Extension. We also include the name of the platform in the VSIX name, so in this case I was expecting As we publish (updates for) each of our platform-specific VSIX's (with separate command lines), there is a window of time in which the marketplace is "validating" each one, during which time VS Code appears to download and install (upgrade to) an incorrect VSIX, undoubtedly because it incorrectly identifies an update (for another platform) while the updated VSIX for the appropriate platform was still in "Validating" state. Not sure how much more info I can give. To reproduce the issue, it's necessary to publish a new version of multiple platform-specific VSIXs (of equal versions) to the marketplace and reload VS Code while some VSIX's are still indicated as "Validating" on the marketplace web site. This reproduces auto-update to an incorrect VSIX each time that we do this. |
@Colengms I am bit confused because, even though MP provides
|
Hi @sandy081. I've repro'ed this multiple times. Once we publish our next version, I can possibly repro it again by upgrading (reloading the window) right after we publish, but it's a matter of getting the timing right (or wrong). I can assure you that there is an issue here. At no point did I attempt to install an arm64 VSIX on this x64 machine. As I mentioned, that incorrect We have added an error message that will be displayed to users when the wrong VSIX gets installed. I suspect we will get confirmation of this issue from users (if their timing is unfortunate) - possibly a small number of users each time we release an update. We will route those users to this issue for further investigation. |
On my x64 Windows PC, running VS Code Insidesr 1.65.0, I repro'ed and had the following URL associated with the download: Copied 'as fetch' from the Network tabfetch("https://az764295.vo.msecnd.net/extensions/marketplace.json", { "referrer": "", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" }); ; fetch("https://ms-vscode.gallerycdn.vsassets.io/extensions/ms-vscode/cpptools/1.9.1/1645748050823/Microsoft.VisualStudio.Code.Manifest?targetPlatform=win32-ia32", { "headers": { "accept": "*/*", "accept-language": "en-US", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "x-market-client-id": "VSCode 1.65.0-insider", "x-market-user-id": "6e1f7a87-d4bd-433d-8877-5978ce101a77" }, "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" }); ; fetch("https://ms-vscode.gallerycdn.vsassets.io/extensions/ms-vscode/cpptools/1.9.1/1645748050823/Microsoft.VisualStudio.Code.Manifest?targetPlatform=win32-ia32", { "headers": { "accept": "*/*", "accept-language": "en-US", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "x-market-client-id": "VSCode 1.65.0-insider", "x-market-user-id": "6e1f7a87-d4bd-433d-8877-5978ce101a77" }, "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "OPTIONS" }); ; fetch("https://ms-vscode.gallery.vsassets.io/_apis/public/gallery/publisher/ms-vscode/extension/cpptools/1.9.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage?redirect=true&targetPlatform=win32-ia32&update=true", { "headers": { "accept": "*/*", "accept-language": "en-US", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "x-market-client-id": "VSCode 1.65.0-insider", "x-market-user-id": "6e1f7a87-d4bd-433d-8877-5978ce101a77" }, "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" }); ; fetch("https://ms-vscode.gallery.vsassets.io/_apis/public/gallery/publisher/ms-vscode/extension/cpptools/1.9.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage?redirect=true&targetPlatform=win32-ia32&update=true", { "headers": { "accept": "*/*", "accept-language": "en-US", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "x-market-client-id": "VSCode 1.65.0-insider", "x-market-user-id": "6e1f7a87-d4bd-433d-8877-5978ce101a77" }, "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "OPTIONS" }); ; fetch("https://ms-vscode.gallerycdn.vsassets.io/extensions/ms-vscode/cpptools/1.9.1/1645748050823/Microsoft.VisualStudio.Services.VSIXPackage", { "headers": { "accept": "*/*", "accept-language": "en-US", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "x-market-client-id": "VSCode 1.65.0-insider", "x-market-user-id": "6e1f7a87-d4bd-433d-8877-5978ce101a77" }, "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" }); ; fetch("https://ms-vscode.gallerycdn.vsassets.io/extensions/ms-vscode/cpptools/1.9.1/1645748050823/Microsoft.VisualStudio.Services.VSIXPackage", { "headers": { "accept": "*/*", "accept-language": "en-US", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "x-market-client-id": "VSCode 1.65.0-insider", "x-market-user-id": "6e1f7a87-d4bd-433d-8877-5978ce101a77" }, "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "OPTIONS" }); ; fetch("https://az764295.vo.msecnd.net/extensions/marketplace.json", { "referrer": "", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" }); ; fetch("https://az764295.vo.msecnd.net/extensions/marketplace.json", { "referrer": "", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" }); ; fetch("https://az764295.vo.msecnd.net/extensions/marketplace.json", { "referrer": "", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET" });The cached VSIX was titled: In this case, I was expecting our x64 build, not the x86 one (although it was compatible, in this case, as x86 runs on x64). I repro'ed a similar issue on an ARM64 Windows PC. It downloaded the same x86 VSIX instead of the ARM64 one. I suspect our x86 VSIX completed 'validation' prior to the other VSIX's, |
I reproed the bug on Windows arm64 (latest Insiders, 1.65.0). CachedExtensionsVSIX has ms-vscode.cpptools-1.9.1-win32-ia32, url is "https://ms-vscode.gallerycdn.vsassets.io/extensions/ms-vscode/cpptools/1.9.1/1645748050823/Microsoft.VisualStudio.Code.Manifest?targetPlatform=win32-ia32". The expected result is win32-arm64. (Windows x64 didn't repro for me, i.e. it was correct) |
@Colengms and @sean-mcmanus Thanks for sharing the information. It seems VS Code is installing
This can be totally possible and I have to say VS Code is doing right thing here. As @Colengms said MP is returning available target platforms as soon as they are available. @joaomoreno @prashantvc @SaiKanth007 @isidorn I think we discussed this concern and I do not remember the outcome or recommendation we ended upon. To summarise, C++ extension is publishing platform specific extension for each target using CI (I suppose). It seems
@Colengms One thing which is not clear for me is following scenario
Meanwhile we discuss about first problem, can you please confirm if you are seeing the second problem and if so please share the logs as I requested. Thanks |
@sandy081 I think it would hard for the MP to figure out how long to wait until to make them all available at once. Is the only corner case |
We didn't repro the arm64 on x64 bug this time. We can change our release pipeline to publish in order arm64 -> x64 -> x86 to see if that fixes it. |
@sandy081 @isidorn I think it would be fairly straightforward for you to create a repro of this without our assistance (so we do not have to tie the investigation of this issue with the releases of the C/C++ extension). I believe it's entirely coincidental that the win32-ia32 build completed validation first this time around and deployed to mismatching platforms. When we previously released, it was the win32-arm64 build that was deployed to my x64 machine, which is clearly incompatible. I don't understand how it could not be an issue that platform-specific (emphasis on specific) VSIXs are deployed to platforms that do not specifically match the VSIX. It would seem implicit these should match exactly, regardless of whether or not the VSIX happens to also be compatible (to a potentially lesser extent) with the target system. IMHO, the correct behavior here would be for VS Code to not update the extension on any platform/architecture using any VSIX that was not an exact match for that system. If a more recent version is seen, but there is no match for the current platform/architecture, don't update (yet). |
@Colengms I'm guessing some extensions may not build an "exact" match vsix, but it seems like VS Code could check the current version's platform to determine that (i.e. if the current version is arm64 don't update to x64). |
The documentaton here states:
And goes on to define 'platforms' as os/architecture pairs. If it is not an issue when compatible but mismatching versions of VSIXs are installed, could someone point me to how that compatibility is determined? We need similar logic for displaying an error (or warning) when the VSIX does not match or is incompatible. x64 emulation on arm64 is available only on (a certain minimum version of) Windows 11, and not Windows 10. Currently, I'm using On macOS, x64 can be emulated on arm64 only if the emulation components are installed. Do you do a check for x64 emulation in order to allow x64 builds to deploy on arm64 macOS? Whether or not x64 or x86 is supported on Linux is complicated, due to arbitrary combinations of 32 and 64 bits userlands and kernels. Have you devised a check for this such that x86 VSIXs can be deployed to x64 Linux systems? Intentionally supporting non-matching but compatible VSIX auto-updating is actually rather complex on all OSes. IMHO, it would seem a lot less problematic to require that platform-specific VSIX's match platforms exactly (as the documentation implies). Or, perhaps allow multiple platforms to be specified in the same VSIX. |
@Colengms I understand your concerns and it seems we are a bit off sync here. It might be because I did not mention fallbacks clearly. Sorry about that. VS Code has fallback mechanisms for only following platforms.
If VS Code does not detect a specific VSIX for win32-x64 and win32-arm64 platforms it fallback to win32-ia32 vsix. I could not repro the scenario that VS Code is installing win32-arm64 vsix on win32-x64 platform. Hence asked for more information from c++ extension as you are able to reproduce it. @sean-mcmanus 's proposal to update extension only if it matches the existing platform seems to be reasonable but might cause inconsistencies - supporting fallback while installing and not while updating. Imagine an extension going forward will only have fallback vsix then VS Code will not update that extension. Instead how about VS Code updates to specific target platform VSIX (even from fallback platform on same version) when available? How about following action items:
|
That seems fine to me...we can try it out for our next release in a day or so. |
@isidorn Can you please update the platform specific extension publishing docs about this? |
@sandy081 sure, I will update the docs. I do not want to make the docs too complex, so I will try to summarise this in one-two sentences. Thanks for tackling this. |
Covered via microsoft/vscode-docs@77e247e |
We just published 1.8.1 (prerelease) of the C/C++ extension to the marketplace. I watched my local VS Code instance pick up the updated version, which promptly failed to execute properly. I noticed the following within it's
.vsixmanifest
:This was on x64 Windows 11, yet the ARM64 VSIX was installed.
I actually encountered what was undoubtedly the same issue the last time we published, but was unable to reproduce it. It looks like the marketplace is updating clients to mismatching platform-specific VSIX's if the matching VSIX has not yet completed 'validation'. This issue only occurs for a brief window of time after we publish our VSIX's. But, I believe any user encountering this issue will need to delete the extension from their system (as Uninstall and reinstalling will reuse the cached extension folder).
Version: 1.63.2 (user setup)
Commit: 899d46d
Date: 2021-12-15T09:40:02.816Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22000
The text was updated successfully, but these errors were encountered: