我正在尝试使用 Vapor 构建包 ( https://github.com/vapor-community/heroku-buildpack/tree/master ) 将 Swift 包推送到 Heroku,但我不断收到此错误:
错误:终止(1):/app/tmp/cache/heroku-18/swiftenv/versions/4.2/usr/bin/swift-build-tool -f/tmp/build_1041959f11306dce64ad9d4712e1d962/.build/debug .yaml主要输出:
我使用 Swift 5.2 编写了该包,但 Heroku 坚持使用 Swift 4.2。我已确认该 buildpack 与 Swift 5.2 兼容,并且我已将 .swift-version 文件以及 Package.swift 文件的第一行设置为 5.2。
这是 Package.swift 文件:
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "TurnipBot",
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/Azoy/Sword", .branch("master"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "TurnipBot",
dependencies: ["Sword"]),
.testTarget(
name: "TurnipBotTests",
dependencies: ["TurnipBot"]),
]
)
最佳答案
您确实提交了 .swift-version
文件吗?拼写是否正确等?我在one of my apps中使用过它并且部署得很好
关于swift - 无法使用 Vapor 将 swift 包推送到 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60979749/