nix-community / nix-vscode-extensions

Nix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
MIT License
169 stars 9 forks source link

Open VSX 404 error because of lowercased URL #57

Closed Jet132 closed 3 months ago

Jet132 commented 3 months ago

Currently on b2ca2718d4953bc2b41592d2a6b76e3d28236e69 and found that open-vsx.wakatime.vscode-wakatime errors out:

trying https://open-vsx.org/api/wakatime/vscode-wakatime/24.2.0/file/wakatime.vscode-wakatime-24.2.0.vsix
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--    0
curl: (22) The requested URL returned error: 404
error: cannot download vscode-wakatime-24.2.0.zip from any mirror

When compared with the correct link:

https://open-vsx.org/api/WakaTime/vscode-wakatime/24.2.0/file/WakaTime.vscode-wakatime-24.2.0.vsix

The difference is that the namespace WakaTime is not lowercased but retains its capitalization. Probably the same is also true for the extension ID, but in this case it's all lowercase.

As a quick workaround, vscode-marketplace.wakatime.vscode-wakatime works fine.

999eagle commented 3 months ago

Same issue with open-vsx.editorconfig.editorconfig for which the correct URL is https://open-vsx.org/api/EditorConfig/EditorConfig/0.16.6/file/EditorConfig.EditorConfig-0.16.6.vsix. This also has both namespace and extension ID requiring "proper" capitalization. I'm currently working around this using nix store add-file to add the manually downloaded (and renamed) files to the nix store.

deemp commented 3 months ago

@Jet132, I now use original names and versions in data/cache/*.json files. This works for me

nix build github:nix-community/nix-vscode-extensions/c4c7f030776a8092de2f05e339f0cd9a68e40bd8#extensions.x86_64-linux.open-vsx.wakatime.vscode-wakatime
Jet132 commented 3 months ago

Thank you for the fix, works perfectly :+1: Also for the software in general

One sidenote: would have been nice if you had referenced this issue in the commit to make it easier to find

deemp commented 3 months ago

Fixed somewhere around ef51bab10c57c1bc0838cccab9210e89b7a6bcf9