Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

check offline/insiders VSIX#5341

Merged
elahehrashedi merged 15 commits into
mastermicrosoft/vscode-cpptools:masterfrom
elrashed/5119_3microsoft/vscode-cpptools:elrashed/5119_3Copy head branch name to clipboard
Apr 28, 2020
Merged

check offline/insiders VSIX#5341
elahehrashedi merged 15 commits into
mastermicrosoft/vscode-cpptools:masterfrom
elrashed/5119_3microsoft/vscode-cpptools:elrashed/5119_3Copy head branch name to clipboard

Conversation

@elahehrashedi

Copy link
Copy Markdown
Contributor

Add check to ensure offline/insiders VSIX is installed on the correct platform
add Github download link to the correct platform
bugfix: #5119

@elahehrashedi elahehrashedi requested a review from a team April 21, 2020 22:50
Comment thread Extension/src/common.ts Outdated
const files: string[] = await readDir(path_to_check);
installedPlatform = "win32";
if (files !== undefined) {
(files).forEach((element: string) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you are relying on checking to see which mono runtime we have installed to figure out the installed platform. Is that the best way to do this? Is the uname method not working? Also, once you have the installedPlatform set, you should exit instead of looping through all the files in the folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the bug to do with the language service or with the debugger?

@bobbrow bobbrow Apr 22, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not related to debugger. uname works, but we're trying to determine which "offline vsix" was installed and if it matches the OS is was installed on. We need to look at something in the extension's files to determine this. I think another alternative would be to embed a simple text file in the extension as part of our build process. We already inject lock.txt when we build offline vsix'es. We could potentially add content to lock.txt (currently it's empty) and just read it to see if it matches the OS. If lock.txt is empty (like for online vsix), we wouldn't do the check.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a bug on both. If a user decides to download the wrong offline installer it wont execute on their machine.

uname will determine the current machine but does not determine the offline vsix.

I am not a fan of this solution since its assuming the debugger will always use a mono runtime with specific extensions to determine the offline package type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just check the LLVM/clang-format or clang-format.exe or clang-format.darwin.

@elahehrashedi elahehrashedi Apr 23, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A possible solution for the future is to add a dummy file in the VSIX folder that indicates the VSIX platform's info. For now, a unified solution for win/mac/linux32/linux64 is to check this folder. We can replace this with the name of the dummy file later on.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wouldn't need to add a new dummy file. We could just add contents to install.lock and you can read the file. But since we don't support 32-bit linux anymore, we can just look at clang-format as was discussed earlier today..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new approach, we check the LLVM/bin folder.
image

Comment thread Extension/src/githubAPI.ts Outdated
Comment thread Extension/src/common.ts Outdated
Comment thread Extension/src/platform.ts Outdated
Comment thread Extension/src/githubAPI.ts Outdated
@WardenGnaw

Copy link
Copy Markdown
Member

The original issue mentions:

[This] results in an error that the native binary is missing. (Which is correct, as a different filename is used on each platform)

Can we not catch where the file not found exception happens and then show the user the correct download dialog?

Comment thread Extension/src/platform.ts Outdated
@elahehrashedi elahehrashedi merged commit 4216aa4 into master Apr 28, 2020
@elahehrashedi elahehrashedi deleted the elrashed/5119_3 branch April 28, 2020 20:08
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.