bigtop-select 打包缺 control 文件报错修复deb
问题定位
当我们在 Ubuntu 上对 bigtop-select 进行源码编译时,会遇到一些和官方默认环境不同的问题。 目前 bigtop 官方 deb 打包链路没有完全适配 Ubuntu,会直接暴露如下典型报错:
# 现象复现
编译命令如下:
gradle bigtop-select-pkg \
-PparentDir=/usr/bigtop \
-Dbuildwithdeps=true \
-PpkgSuffix -d
1
2
3
4
2
3
4
实际日志输出:
root@ubuntu22:/opt/modules/bigtop# gradle bigtop-select-pkg \
> -PparentDir=/usr/bigtop \
> -Dbuildwithdeps=true \
> -PpkgSuffix
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :bigtop-select-sdeb FAILED
FAILURE: Build failed with an exception.
* Where:
Script '/opt/modules/bigtop/packages.gradle' line: 525
* What went wrong:
Execution failed for task ':bigtop-select-sdeb'.
> java.io.FileNotFoundException: /opt/modules/bigtop/build/bigtop-select/deb/bigtop-select-3.2.0/debian/control (No such file or directory)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 16s
4 actionable tasks: 4 executed
root@ubuntu22:/opt/modules/bigtop#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 问题定位
- gradle 在 deb 打包时,必须保证 debian 目录下有 control 文件(debian 制包元数据核心文件)。
- 如果缺失就会出现如上的 FileNotFoundException,打包无法继续。
# 解决方法
提示
如何补齐 debian/control 及相关打包文件?具体步骤可参考这里: 解读-bigtop-select支持deb