如何从 VSCode 的源代码(Code - OSS)创建 .deb 文件

问题描述 投票:0回答:1

在构建 Code - OSS for linux 后创建

.deb
文件时出现错误

我按照官方 vscode 存储库中的如何贡献指南中的所有步骤进行操作。

这一步完成得很好(大约需要 42 分钟)

$ npm run gulp vscode-linux-x64

但是当我尝试创建

.deb
文件以便使用
轻松安装时
$ npm run gulp vscode-linux-x64-build-deb

我得到这个输出(错误),但我不知道为什么会发生。任何帮助将不胜感激!

> [email protected] gulp
> node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js vscode-linux-x64-build-deb

[22:09:08] Using gulpfile /workspaces/vscode/gulpfile.js
[22:09:08] Starting 'vscode-linux-x64-build-deb'...
[22:09:08] 'vscode-linux-x64-build-deb' errored after 6.99 ms
[22:09:08] Error: spawn /bin/sh ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
visual-studio-code
1个回答
0
投票

解决方案

首先,

npm run gulp vscode-linux-x64-prepare-deb

那么,

npm run gulp vscode-linux-x64-build-deb

注意

我没能找到官方的wiki,但我从

build/gulpfile.vscode.linux.js
中的以下定义猜测并测试它是否有效。

BUILD_TARGETS.forEach(({ arch }) => {
    const debArch = getDebPackageArch(arch);
    const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
    gulp.task(prepareDebTask);
    const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, buildDebPackage(arch));
    gulp.task(buildDebTask);

    const rpmArch = getRpmPackageArch(arch);
    const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
    gulp.task(prepareRpmTask);
    const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, buildRpmPackage(arch));
    gulp.task(buildRpmTask);

    const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
    gulp.task(prepareSnapTask);
    const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
    gulp.task(buildSnapTask);
});
© www.soinside.com 2019 - 2024. All rights reserved.