Я бы хотел удаленно разрабатывать / запускать / отлаживать программу Swift Bluetooth с использованием Xcode на хосте Mac для удаленного (SBC) ASUS Tinkerboard S с ОС Debian.
После долгих усилий по поиску и прокруткевместе случайные блоги, работает следующая часть:
Когда я проверяю версию Swift:
$ swift -v
Swift version 4.2.1 (swift-4.2.1-RELEASE)
Target: armv7-unknown-linux-gnueabihf
/usr/bin/lldb "--repl=-disable-objc-interop -color-diagnostics"
error: failed to stop process at REPL breakpoint
Что не работает:
- Мне нужна поддержка Bluetooth, поэтому добавленав Package.swift (из https://github.com/PureSwift: BluetoothLinux, GATT, SwiftFoundation.
- После редактирования Package.swift я восстанавливаю
.xcodeproj
, вызывая swift package generate-xcodeproj
. - Появится предупреждение: предупреждение:
PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): SwiftFoundation, CJSONC, CStatfs
- Затем, так как процесс регенерации уничтожает цель удаленной сборки, добавил ее обратно.
- Попробуйте выполнить сборку и выдает ошибку с приведенным ниже сообщениемЯ проверил и папку
x86_64-linux-gnu
и ее отсутствие. Я установил известные мне зависимости ... и подумал, что вместо этого следует использовать armv7-unknown-linux-gnueabihf
.
-----------------------------
Configuration:
-----------------------------
Username: linaro
Hostname: tinkerboard.local
Destination: ~/Swish/swift_program
-----------------------------
? Start syncing project to linaro@tinkerboard.local:~/Swish/swift_program
sending incremental file list
./
Package.swift
993 100% 0.00kB/s 0:00:00
993 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=12/16)
? Did sync project to remote machine
⚒ Start building project
bash: /home/linaro/.bash_profile: No such file or directory
warning: PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): SwiftFoundation, CJSONC, CStatfs
Compile Swift Module 'SwiftFoundation' (39 sources)
Compile Swift Module 'Bluetooth' (430 sources)
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
error: terminated(1): /usr/bin/swift-build-tool -f /home/linaro/Swish/swift_program/.build/debug.yaml main output:
Мой файл Package.swift:
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "swift_program",
dependencies: [
.package(url: "https://github.com/PureSwift/BluetoothLinux.git", .branch("master")),
.package(url: "https://github.com/PureSwift/GATT", .branch("master")),
.package(url: "https://github.com/PureSwift/SwiftFoundation.git", .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: "swift_program",
dependencies: ["BluetoothLinux", "GATT", "SwiftFoundation"])
]
)
Любая помощь / предложения приветствуются.