-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
plugins: add flag to 'download:plugins' script #7123
Conversation
dev-packages/cli/src/theia.ts
Outdated
handler: () => downloadPlugins() | ||
describe: 'Download defined external plugins.', | ||
builder: { | ||
'preserveVsix': { |
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.
maybe better unpack
which is false by default?
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 think we discussed that perhaps we wanted the preservation of the .vsix
file as to be the one which requires the flag to be turned on (requires an application to actually request such a feature), since most clients would it expect it to unpack?
The only client I know as of now that'd want to preserve is the theia-electron
AppImage.
cc @marcdumais-work
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.
Ah, that’s fine I just wanted to have shorter option name ) but it is also not so important
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 agree :) I updated the flag so it is shorter.
I use -packed
or -p
to control the behavior when downloading plugins.
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.
The only client I know as of now that'd want to preserve is the
theia-electron
AppImage.
Not only AppImage but potentially all OS-specific packagings for Electron to be safe (.deb, .rpm, .msi, .exe, .dmg, ...).
TL;DR: we noticed that the Java Language Support for Visual Studio Code by Red Hat extension writes to the extension's directory at runtime. This fails if the extension is unpacked in such a way that the Electron app user does not have write access to it, which happens when installing a packaged Electron app (except maybe if packages as simple .tar or .zip and extracted by end-user).
We are not sure if other VS Code extensions may also be also writing to their directory at runtime, so to be safe I would keep Electron-bundled extensions packed in .vsix
format.
(note: I did not see this behavior on writing in one's own folder at runtime for built-in extensions)
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've not tried, but code-wise it looks good. I would name option differently but it is mater of taste. Please merge if it works.
75cae27
to
df48698
Compare
Fixes #7122 Adds the following flag to the `download:plugins` script to control the behavior of how plugins should be packed/unpacked by default. The default is `false` and it means that plugins should not be preserved as `.vsix` and instead should be unpacked. If `packed` is set to `true` then plugins are successfully packed (kept as `.vsix`). Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
df48698
to
3492d89
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.
LGTM - I tested on Gitpod, validating that both packed and unpacked plugins work in the example browser application.
Thank you @akosyakov @marcdumais-work ! |
What it does
Fixes #7122
The following pull-request adds a flag to the
download:plugins
script in order to control whether or not downloaded plugins should be packed or unpacked.The default behavior is to unpack plugins (if no flag is provided), else an application may choose to specify whether or not to pack or unpack plugins using the
-packed (-p)
flag.How to test
Call the
download:plugins
the following way:yarn theia download:plugins
.vsix
)yarn theia download:plugins -p=false
.vsix
)yarn theia download:plugins -p=true
not unpack (not
.vsix
)One can also specify the full name as such:
Review checklist
Reminder for reviewers
Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com