-
Notifications
You must be signed in to change notification settings - Fork 82
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
Run a binary server #316
Run a binary server #316
Conversation
Notes on testing this PR:
|
needs to handle download errors. I had the wrong name on the server and absolutely nothing was reported in vscode. http server reported: the extension created an empty binary under [vscode-xml]/server, so then it didn't retry to download the proper binary the next time |
9c1cc6e
to
10667a1
Compare
8eff7af
to
2bd0840
Compare
I can't rebase it cleanly against master |
Testing with the server downloaded from https://github.com/datho7561/lemminx/actions/runs/279271890, OSX is not happy about it and will repeatedly show the same error message 5 times in less than 3 min, if you press cancel every time. New challenge: how to notarize the app so that macOS shuts the fuck up? |
da3d998
to
66227fe
Compare
That's odd. I rebased, but for some reason it still says its in conflict here. |
8f8af65
to
9b0c127
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored some of the code I wrote because it was a mess. It should now work without Java. Some other changes I made:
- It will try to use the binary if no Java is installed
- It will give a warning if there are LemMinX extensions but no Java installed
- It will always use the Java server if it there are LemMinX extensions and Java is set up
61b5f34
to
1b1e808
Compare
1b1e808
to
d8c8903
Compare
d8c8903
to
2fdb3c4
Compare
f7f3cc5
to
20a509e
Compare
I personally don't think we should add a setting to silence this warning. Maybe we could add an entry to the internal documentation that explains why the binary is not trusted, and how to generate the hash file for the binary if its trusted. Then we could link from the warning to the documentation with a button. |
6a533ef
to
5a6c534
Compare
I believe things should be as easy/streamlined as possible, and consistent across Red Hat extensions. vscode-java does store trusted checksums, to avoid nagging users: https://github.com/redhat-developer/vscode-java/blob/15dae347c8b0f3badf0273f3bfc4bb4b1c22935d/src/settings.ts#L209-L240 |
Okay. I will implement this. |
one important part of the vscode-java implem, is the setting is stored at the global level, to avoid malicious actors allowing shas of malicious binaries in the workspace settings.json |
5a6c534
to
fa823fe
Compare
Should be added now. |
fa823fe
to
3cff4af
Compare
3cff4af
to
e1ce62a
Compare
The pipeline will not work until the new parameter |
Download a binary lemminx, check its integrity, then run it. Includes: * Setting to specify a binary, `xml.server.binary.path` * Setting to specify args for the binary, `xml.server.binary.args` Defaults to java server in cases such as: * The binary can't be downloaded * The file containing the expected hash of the binary is missing * The hash of the binary doesn't match the expected hash * Binary specified in setting can't be located and the above three fail Signed-off-by: David Thompson <[email protected]>
e1ce62a
to
6792bf7
Compare
If the user has no Java installed, run a binary version of LemMinX. There is a setting
xml.server.preferBinary
, which, when set to true, causes the binary LemMinX to be used even if Java is installed. If LemMinX extensions (lemminx-maven, etc.) are present, Java is present, and thexml.server.preferBinary
preference is enabled, the Java version will be run anyways. If LemMinX extensions are present and no Java is detected, a warning is displayed saying that the extensions can't be used.The binary server is downloaded when it is needed by the extension, instead of being packaged into the extension. This reduces the size of the extension and total download size for the user. The extension packages the SHA256 hash of the server binaries in order to verify their integrity. The extension falls back to the Java server if the binary server download or integrity check fail.
Additionally, this PR contains modifications to the existing Jenkins pipeline so that the correct download link for the binary server is packaged into the
package.json
, and the hashes for the binary server are packaged into./server/*.sha256
. There is also a new pipeline file that can be used to build the LemMinX binary under Windows, macOS, and RHEL 8 for the x64_86 architecture.This PR is a rebase of PR 256 with additional features.