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

hashicorp.terraform extension not working // wrong platform chosen when installing from open-vsx #13558

Closed
Tracked by #13192
jfaltermeier opened this issue Apr 3, 2024 · 4 comments · Fixed by #13825
Labels
bug bugs found in the application vsx-registry Issues related to Open VSX Registry Integration
Milestone

Comments

@jfaltermeier
Copy link
Contributor

Bug Description:

I have a project with this recommendation in .vscode/extensions.json

{
    "recommendations": [
        "hashicorp.terraform"
    ]
}

The extension can be installed as expected, however it then fails when it tries to launch the language server.

ksnip_20240403-125512

I can see in the logs that the wrong platform is downloaded (darwin-arm64 instead of linux-x64):

2024-04-03T10:52:35.275Z root INFO [hashicorp.terraform]: resolved to 'hashicorp.terraform-2.29.5'
2024-04-03T10:52:35.276Z root INFO [hashicorp.terraform-2.29.5]: trying to download from "https://open-vsx.org/api/hashicorp/terraform/darwin-arm64/2.29.5/file/hashicorp.terraform-2.29.5@darwin-arm64.vsix"... to path /home/johannes/.theia/tmp/vscode-download
2024-04-03T10:52:36.755Z root INFO [hashicorp.terraform-2.29.5]: downloaded to /home/johannes/.theia/tmp/vscode-download/hashicorp.terraform-2.29.5@darwin-arm64.vsix"

I don't know if Theia detects the wrong platform or if there is a misconfiguration on open-vsx that leads to the wrong platform.

Steps to Reproduce:

  1. Install hashicorp.terraform
  2. After installation it should try to launch the server which will fail

Additional Information

  • Operating System: Ubuntu 22.04
  • Theia Version: 1.48.2
@jfaltermeier jfaltermeier mentioned this issue Apr 3, 2024
55 tasks
@msujew
Copy link
Member

msujew commented Apr 3, 2024

I don't know if Theia detects the wrong platform or if there is a misconfiguration on open-vsx that leads to the wrong platform.

FYI, I don't think that Theia respects the current platform at all - it just chooses the first download link it can find on open-vsx for the respective version of a plugin and tries to install that. See also here:

if (version) {
console.log(`[${id}]: trying to resolve version ${version}...`);
const { extensions } = await client.query({ extensionId: id.id, extensionVersion: version, includeAllVersions: true });
extension = extensions[0];
} else {
console.log(`[${id}]: trying to resolve latest version...`);
const { extensions } = await client.query({ extensionId: id.id, includeAllVersions: true });
extension = this.vsxApiFilter.getLatestCompatibleExtension(extensions);
}

It should use the targetPlatform parameter available here, but it doesn't.

@msujew msujew added bug bugs found in the application vsx-registry Issues related to Open VSX Registry Integration labels Apr 3, 2024
@JonasHelming
Copy link
Contributor

@xai Do you have an idea how to fix this?

@msujew
Copy link
Member

msujew commented Jun 13, 2024

@JonasHelming @xai I have a WIP branch that is supposed to address this. I'll get back to this in the coming days.

@msujew
Copy link
Member

msujew commented Jun 18, 2024

@JonasHelming see #13825

@jfaltermeier jfaltermeier added this to the 1.51.0 milestone Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application vsx-registry Issues related to Open VSX Registry Integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants