Launchpad 构建配方:如何正确指定同一 PPA 中包的构建依赖项?

Launchpad 构建配方:如何正确指定同一 PPA 中包的构建依赖项?

我正在尝试使用以下命令在 Ubuntu 16.04 上构建 Code::Blocks IDE:

https://code.launchpad.net/~damien-moore/+recipe/codeblocks-16.01-release

它需要 libwxgtk2.8-dev,它不在 16.04 存储库中,但我已将其添加到此处的包中:

https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks-stable/+packages

但是当我构建时,我一直收到未满足的依赖项错误:

https://code.launchpad.net/~damien-moore/+archive/ubuntu/codeblocks-stable/+recipebuild/1126247

您可以在此处查看控制文件:

http://bazaar.launchpad.net/~damien-moore/+junk/codeblocks-16.01-release/view/head:/debian/control

知道我做错了什么吗?

答案1

在这种情况下,apt 给出的错误消息有点误导人:它实际上告诉您该libwxgtk2.8-dev软件包存在但无法卸载。您可以通过设置一个 apt 包含您的 PPA 的环境sources.list(此chdist工具在这里很有用,可以避免干扰您的正常环境或担心完全 chroot 或类似情况)并以交互方式深入研究来获得更好的诊断:

$ chdist create codeblocks
Now edit /home/cjwatson/.chdist/codeblocks/etc/apt/sources.list
Run chdist apt-get codeblocks update
And enjoy.
$ cat >.chdist/codeblocks/etc/apt/sources.list <<EOF
deb [trusted=yes] http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu xenial main
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
EOF
$ chdist apt-get codeblocks update
# ignore GPG errors in the output, which don't matter for the purposes of
# inspection
$ chdist apt-get codeblocks install libwxgtk2.8-dev
Reading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 libwxgtk2.8-dev : Depends: libwxgtk2.8-0 (= 2.8.12.1+dfsg2-0~48~ubuntu16.04.1) but it is not going to be installed
                   Depends: libwxbase2.8-dev (= 2.8.12.1+dfsg2-0~48~ubuntu16.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后将包名称添加到命令行,直到收到比“不会安装”更具体的消息:

$ chdist apt-get codeblocks install libwxgtk2.8-dev libwxgtk2.8-0 libwxbase2.8-dev libwxbase2.8-0
Reading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 libwxbase2.8-0 : Depends: libwxbase2.8-0 (>= 2.8.12.1+dfsg2) but 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 is to be installed
 libwxgtk2.8-0 : Depends: libwxbase2.8-0 (>= 2.8.12.1+dfsg2) but 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 is to be installed
                 Depends: libwxgtk2.8-0 (>= 2.8.12.1+dfsg2) but 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
$ dpkg --compare-versions 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 gt 2.8.12.1+dfsg2 && echo yes || echo no
no

因此,翻译成英文,您的 PPA 中的 wx 软件包至少具有 的内部依赖性2.8.12.1+dfsg2,但您在 PPA 中用于向前移植到 xenial 的版本是 ,2.8.12.1+dfsg2-0~48~ubuntu16.04.1它实际上(巧妙地)略低于所需版本。您必须修复版本号,或(更激进地)调整依赖关系以使其更加自由。

但是,为什么不直接复制 wily 中的源代码和构建的二进制包呢?虽然它们已从 xenial 中删除,但如果直接复制,它们显然仍然可以安装,而且这是迄今为止最省力的选择。抓取lp:ubuntu-存档工具使用bzr并运行:

$ ./copy-package --from ubuntu --from-suite wily --to ppa:damien-moore/ubuntu/codeblocks-stable --to-suite xenial -b wxwidgets2.8

然后等待复制和发布,一切就都好了。如果做不到这一点,我建议将您的 wxwidgets2.8 源包基于 wily ( 2.8.12.1+dfsg2-2ubuntu2) 中的源包,并确保您使用的版本号大于或等于该版本号。

顺便提一下,您的构建实际上应该被 Launchpad 记录为构建失败,而不是依赖项等待,因为在存在但无法卸载的构建依赖项的情况下,我们无法产生明确的依赖项等待。我已将其归档为错误 1575965

相关内容