Snapcraft 失败:[Errno 21] 是一个目录:'/path/to/snap/prime/'。

Snapcraft 失败:[Errno 21] 是一个目录:'/path/to/snap/prime/'。

我正在尝试拍摄这个项目,事实证明这是一个相当大的挑战。我不得不编写不少于 3 个自定义插件,但此时所有部分都已完成暂存。然而,在暂存所有内容后,Snapcraft 失败并出现主题中的错误。

这是我的 snapcraft.yaml:

name: stakeweightedvoting-app
version: "0.1"
summary: A blockchain-based secure voting and polling application
description: Stake Weighted Voting is Follow My Vote's application for stake-weighted voting on a blockchain. The app allows users to create and vote on polls on a blockchain, and securely tallying and displaying the results to ensure that no fraud can occur undetected.
confinement: devmode

apps:
  VotingApp:
    # If this actually works, I'll eat my hat. Can't fix it until I can build a snap, though...
    command: . $SNAP/opt/qt57/bin/qt57-env.sh && VotingApp

parts:
  stakeweightedvoting:
    plugin: x-qbs
    source: git://github.com/followmyvote/stakeweightedvoting
    source-branch: master
    build-packages: [qt57base, qt57declarative, qt57charts-no-lgpl, qt57quickcontrols2, qt57websockets, qt57svg, python-yaml]
    after: [botan, capnproto]
  capnproto:
    plugin: x-nonbroken-cmake
    source: git://github.com/sandstorm-io/capnproto
    # Ideally I would specify v0.5.3 here, but it no longer builds without tweaking, and I don't know how to apply patches in snapcraft
    source-branch: master
    source-subdir: c++
  botan:
    plugin: x-botan
    source: http://botan.randombit.net/releases/Botan-1.11.31.tgz

完整输出snapcraft

dev@ubuntu-dev:~/swv$ snapcraft
"grade" property not specified: defaulting to "stable"
Searching for local plugin for x-nonbroken-cmake
Searching for local plugin for x-botan
Searching for local plugin for x-qbs
Skipping pull botan (already ran)
Skipping pull capnproto (already ran)
'stakeweightedvoting' has prerequisites that need to be staged: capnproto botan
Skipping pull capnproto (already ran)
Skipping pull botan (already ran)
Skipping build capnproto (already ran)
Skipping build botan (already ran)
Skipping stage capnproto (already ran)
Skipping stage botan (already ran)
Skipping pull stakeweightedvoting (already ran)
Skipping build botan (already ran)
Skipping build capnproto (already ran)
'stakeweightedvoting' has prerequisites that need to be staged: capnproto botan
Skipping pull capnproto (already ran)
Skipping pull botan (already ran)
Skipping build capnproto (already ran)
Skipping build botan (already ran)
Skipping stage capnproto (already ran)
Skipping stage botan (already ran)
Skipping build stakeweightedvoting (already ran)
Skipping stage botan (already ran)
Skipping stage capnproto (already ran)
'stakeweightedvoting' has prerequisites that need to be staged: capnproto botan
Skipping pull capnproto (already ran)
Skipping pull botan (already ran)
Skipping build capnproto (already ran)
Skipping build botan (already ran)
Skipping stage capnproto (already ran)
Skipping stage botan (already ran)
Skipping stage stakeweightedvoting (already ran)
Skipping prime botan (already ran)
Skipping prime capnproto (already ran)
'stakeweightedvoting' has prerequisites that need to be staged: capnproto botan
Skipping pull capnproto (already ran)
Skipping pull botan (already ran)
Skipping build capnproto (already ran)
Skipping build botan (already ran)
Skipping stage capnproto (already ran)
Skipping stage botan (already ran)
Skipping prime stakeweightedvoting (already ran)
[Errno 21] Is a directory: '/home/dev/swv/prime/.'

我可以为这三个自定义插件提供源代码,但是在构建步骤之后它们都不会覆盖任何内容,所以我暂时省略它们。

我发现这个错误这可能就是我所看到的,但是这种解决方法对我来说不起作用。

答案1

command: . $SNAP/opt/qt57/bin/qt57-env.sh && VotingApp不起作用,因为您需要提供snap目录内的实际文件,并且.这是您收到的错误的结果。

但是您可以编写自己的包装脚本:

#!/bin/sh

source $SNAP/opt/qt57/bin/qt57-env.sh

exec VotingApp $*

并将其作为command条目。

做一些类似的事情tomcat 演示使用wrapper(但你不需要Makefile,只需使用dump插件即可,如蚊子演示

相关内容