vscode-utils: Set the sourceRoot attribute on vscode extensions

Some extensions contain directories other than `extension` (e.g.,
`package`, if the extension has a digital signature). The unpacker phase
fails if a .vsix file contains more than one directory at the archive's
root and the `sourceRoot` attribute is unset.
This commit is contained in:
Francis Gagné 2024-02-18 03:31:29 -05:00
parent 55499d861f
commit 8f384467cc
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ let
inherit configurePhase buildPhase dontPatchELF dontStrip;
# Some .vsix files contain other directories (e.g., `package`) that we don't use.
# If other directories are present but `sourceRoot` is unset, the unpacker phase fails.
sourceRoot = "extension";
installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}";
nativeBuildInputs = [ unzip ] ++ nativeBuildInputs;