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

Support new bundle format #43

Merged
merged 3 commits into from
Feb 5, 2021
Merged

Support new bundle format #43

merged 3 commits into from
Feb 5, 2021

Conversation

alanpearce
Copy link
Contributor

@alanpearce alanpearce commented Jan 18, 2021

It seems that Codota have changed the download format for TabNine binaries. They are now distributed in zip files. source

These commits enable versions distributed in this format to be downloaded and installed correctly.

It assumes the user has unzip in their path. This might not be true on certain platforms, but upstream's downloader makes the same assumption.

@alanpearce alanpearce changed the title Support new bundle format WIP: Support new bundle format Jan 18, 2021
@alanpearce alanpearce changed the title WIP: Support new bundle format Support new bundle format Jan 18, 2021
@TommyX12
Copy link
Owner

TommyX12 commented Jan 18, 2021

Thanks for the PR. I noticed that the unzip assumption would make it difficult for Windows to obtain the binary. Seems like other backends (e.g. Vim, Sublime, VSCode) simply bundled the binaries within the plugin repo (the dl_binaries.sh isn't for the user to run). I remember when I tried to do the same, MELPA disliked having third party binaries contained within the plugin.
Is there a more universal way of unzipping zip files, or could we add a check for unzip in the path and notify the user when it's not available? Although seems like a cleaner solution can be achieved if Codota can help out.

@TommyX12 TommyX12 mentioned this pull request Jan 18, 2021
@alanpearce
Copy link
Contributor Author

alanpearce commented Jan 18, 2021

There is archive-zip-extract, but that only extracts a single file specified by the second parameter.

I found a dired function that might make things more cross-platform, but I don't have a Windows machine set up, unfortunately. However, if dired-do-compress (default Z) unzips the contents of $FILE.zip to $FILE\, then this should work fine (the commit relies on the dired's behaviour of creating a directory with the basename of the archive as the root of the extracted files)

@TommyX12
Copy link
Owner

TommyX12 commented Feb 5, 2021

Did a small test on Windows, seems like the dired method does work; however, I think that dired still uses unzip under the hood, so not sure if that's truly cross-platform. Seems like there's no better way to deal with this for now as long as MELPA doesn't allow binary bundling and TabNine keep using zip as its binary format. Thanks for the PR.

@TommyX12 TommyX12 merged commit 9c13ef5 into TommyX12:master Feb 5, 2021
@alanpearce alanpearce deleted the feat/support-bundles branch February 5, 2021 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants