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

fix: check for installed serve-d version + improve get.serve-d #40

Merged
merged 14 commits into from
Feb 25, 2021

Conversation

aminya
Copy link
Member

@aminya aminya commented Feb 24, 2021

No description provided.

src/get-serve-d.ts Outdated Show resolved Hide resolved
src/get-serve-d.ts Outdated Show resolved Hide resolved
import decompressTarxz from "decompress-tarxz"

// function to download serve-d binaries from GitHub
export async function getServeD() {
Copy link
Member

Choose a reason for hiding this comment

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

I think nightly & pre-release support would match the vscode extension well

/* repo */ "serve-d",
/* download folder */ distFolder,
/* filter release */ undefined,
/* filter asset */ (asset) => asset.name.indexOf(platform) >= 0,
Copy link
Member

@WebFreak001 WebFreak001 Feb 24, 2021

Choose a reason for hiding this comment

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

this test should probably be a little more exact (at least also include the architecture)

you might want to copy the function from https://github.com/Pure-D/code-d/blob/master/src/installer.ts#L261 (first argument is release name / release version)

Copy link
Member Author

@aminya aminya Feb 24, 2021

Choose a reason for hiding this comment

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

But do you build for other architectures? If you don't, there is no need to add code for it.

Copy link
Member

Choose a reason for hiding this comment

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

I don't build for other architectures yet, but vscode is supported on ARM, so if there is an ARM user (e.g. coders on cheap linux ARM laptops or raspberry pi) they don't download a release that is unsupported anyway.

It probably makes sense to move all the release downloading & manual compilation into an NPM package which can be used by all JS based extensions.

Copy link
Member Author

@aminya aminya left a comment

Choose a reason for hiding this comment

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

Windows installation fails because tarxz runs node-gyp and this requires Visual Studio Installation.

I think it would be easier to bundle serve-d with the package

@WebFreak001
Copy link
Member

on windows the releases are zips, there is no need for tarxz.

In code-d I use AdmZip to unzip these releases. For .tar.xz I invoke tar as command (assuming posix compliant system)

@aminya
Copy link
Member Author

aminya commented Feb 24, 2021

"@terascope/fetch-github-release" itself supports extracting zip. The decompress plugin is only needed for tarxz. I wish the assets were consistent, and they all used zip.

@WebFreak001
Copy link
Member

the releases are currently more or less following what is usually used on each platform, I believe that makes the most sense for end users manually downloading releases.

The code in code-d for extracting tar.xz & tar.gz is fairly simple, would it be a solution to use that code instead of the decompress plugin? https://github.com/Pure-D/code-d/blob/master/src/installer.ts#L441-L462

@aminya
Copy link
Member Author

aminya commented Feb 24, 2021

How do you check if serve-d is up to date?

@aminya
Copy link
Member Author

aminya commented Feb 24, 2021

I feel like this approach is just more complex for no reason (e.g. all these manual downloading, decompressing, checking for versions, etc).

The better solution is to make an npm package for serve-d, so it can be easily installed as a dependency.

For now, I am going to bundle serve-d exe as part of the package.

@aminya aminya marked this pull request as ready for review February 25, 2021 04:20
@aminya aminya changed the title fix: Install serve-d on demand fix: check for installed serve-d version + improve get.serve-d Feb 25, 2021
@aminya aminya mentioned this pull request Feb 25, 2021
@aminya aminya merged commit 50f9a0a into main Feb 25, 2021
@aminya aminya deleted the install-served branch February 25, 2021 04:32
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.

None yet

2 participants