New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yams is not compatible with Swift REPL #325
Comments
Sounds like a Swift REPL bug to me, but I can’t file one there on your behalf without knowing more about it. For example, what steps can I take to reproduce the issue? |
Hey @jpsim, please try this minimalistic example:
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "YamsTest",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "YamsTest",
targets: ["YamsTest"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/jpsim/Yams.git", from: "4.0.6")
],
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 this package depends on.
.target(
name: "YamsTest",
dependencies: ["Yams"]),
.testTarget(
name: "YamsTestTests",
dependencies: ["YamsTest"]),
]
)
You can see several warnings there but it somehow works. I also tried to run Swift REPL differently - not using the I am using Swift 5.2, Xcode 12.5, macOS Big Sur. |
Thanks for that info, I can reproduce the issue more simply now:
I get similar issues when running with Swift 5.5 bundled with Xcode 13 beta 1. I'll file a bug at bugs.swift.org and report back. |
Minimal repro project: Yams-325.zip In the root of the project, running the following 3 commands triggers the error: |
I've filed https://bugs.swift.org/browse/SR-14806, please follow along there. |
@jpsim Great, thank you 🙏 |
I am using Yams as a dependency for my swift package library. Yams is included as a swift package in a standard way. I use the command
swift run --repl
for running my library in REPL mode. This command runs the Swift interpreter with these arguments:Swift REPL session is started but unfortunately, the session in Swift REPL is often interrupted with error messages like (not only once but quite often)
Besides these annoying errors, it looks like Yams somehow works. It mostly gives good results. I tried also different Yaml libraries for Swift, but as far as I know, only Yams supports Swift Codable.
When I am using Yams in Swift script, it often works. But sometimes it returns
zsh: segmentation fault
error. But usage with Swift REPL is still problematic. I would be more than happy if there is some solution. Using Yams with REPL is very useful. I know that problem with CYaml was already discussed in a different context. Do you have some tips on how to fix this, please? Thank you.This is my Package.swift. It defines one library and two executables.
The text was updated successfully, but these errors were encountered: