gpt4 book ai didi

swift - 为什么 swift build 在应用程序引擎上失败?

转载 作者:行者123 更新时间:2023-11-30 10:54:38 25 4
gpt4 key购买 nike

我正在运行来自 here 的教程但似乎正在构建步骤中运行,这可能只是我对 docker 的经验不足。我收到以下构建错误'Munger-API'/root/Munger-API:错误:找不到目标的源文件:Munger-API;使用 Swift 4 list 中的“path”属性设置自定义目标路径

Dockerfile:

FROM ibmcom/swift-ubuntu:latest
LABEL Description="Docker image for Swift + Perfect on Google App Engine flexible environment."

# Get extra dependencies for Perfect
RUN apt-get update && apt-get install -y \
openssl \
libssl-dev \
uuid-dev

# Expose default port for App Engine
EXPOSE 8080

# Copy sources
RUN mkdir /root/Munger-API
ADD Sources/Munger-API/main.swift /root/Munger-API
ADD Package.swift /root/Munger-API
ADD Sources/Munger-API/Controller/MungerController.swift /root/Munger-API
ADD Sources/Munger-API/Emailer/Emailer.swift /root/Munger-API

# Build the app
RUN cd /root/Munger-API && swift build

# Run the app
USER root
CMD ["/root/Munger-API/.build/debug/Munger-API"]

Package.swift

let package = Package(
name: "Munger-API",
products: [
.executable(name: "Munger-API", targets: ["Munger-API"])
],
dependencies: [
.package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"),
.package(url: "https://github.com/mhs2342/DAP-Munger-Model.git", from: "0.1.5"),
.package(url: "https://github.com/PerfectlySoft/Perfect-SMTP.git", from: "3.0.0")
],
targets: [
.target(name: "Munger-API",
dependencies: [
"PerfectHTTPServer",
"DAP-Munger-Model",
"PerfectSMTP"
],
path: "root/Munger-API")
])

有人知道这里出了什么问题吗?

最佳答案

问题有两个。虽然我确实需要在 Package.swift 中设置 path 参数,但它需要是 path: "" 这是有意义的我已经将项目的内容复制到 root/DAP-Munger-API 了。

关于swift - 为什么 swift build 在应用程序引擎上失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54098394/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com