Ubuntu snap 插件 'autotools' 默认值 'make install' 在使用 snapcraft 构建时被跳过

Ubuntu snap plugin 'autotools' default 'make install' to be skipped while building with snapcraft

我正在为我的项目构建一个 snap 包,我有一个我只想编译的库。即只有 /configure && make 不是:/configure && make && make install

因为我在 Ubuntu snap 中搜索了它的文档,我发现:https://snapcraft.io/docs/reference/plugins/autotools

也在此处搜索:https://github.com/search?o=desc&q=filename%3Asnapcraft.yaml+%22plugin%3A+autotools%22+&s=indexed&type=Code&utf8=%E2%9C%93

但我找不到任何可以跳过 make install 部分的内容。谁能建议我该怎么做?一个肮脏的方法可能是在 make install 之后,我将添加一个 shell 脚本来递归删除 make install 生成的文件,然后进一步进行应用程序代码编译。但我认为应该有一条快乐的道路来做好这件事。 因此,当我 运行 snapcraft 构建 snap 包时,如果有任何方法可以跳过此 make install,请告诉我。

我通过反复试验得到了答案。解决方案是:

artifacts: [.]

在 snapcraft.yaml 文件。根据文档,它默认跳过 make install 。我一直保持它为零,但没有工作。但这一个工作得很好,permision denied 错误也消失了(snapcraft 想在系统中安装,因此 sudo 是那里的解决方案)。