I have been struggling with this for two hours now, I admit I do not navigate around this package manager well.

Above it the pastebin link of the Package.swift at the root of my project.
I am on Arch-Linux, 6.6.39-1lts and using Swift 5.10. Unrelated, but I also have Swiftly but I can't seem to get that to work. I really, REALLY Want to cross-test/build with 6.0 snapshot I Have installed, but that has not been working with swift commands in the terminal.

As for this project, I am trying to make a build tool that is reproducible with a simpler interface then Make. I really, really love Swift otherwise. It is my favorite language, I even have it on Windows! I was hoping to use this tool for myself and open source, but I don't even know what I am doing wrong.

See before I tried to use the -build-tool-plugin, but it turns out that is not here on my Linux toolchain (specifically the compiler will generate the right type, with a plugin folder, but PackagePlugin is 'not here' and I cannot use xcode, cant afford a mac yet.). So, I just deleted and started the project from scratch and now I am getting an error:

error: 'samurai': product 'NIO' required by package 'samurai' target 'Samurai' not found.
error: ExitCode(rawValue: 1)
[0/1] Planning build

Here is what I Want to do in plainspeak, I want to use XML to serialize a build configuration that is makelike and use TOML to serialize a build cache. I figured Swift NIO would also be a useful dependency so I added it, but removing it from my manifest still gives me the same error.

Please help me in anyway you can!

When product name differs from package name, you need to specify full .product in the dependencies (in fact, I personally recommend always use this instead of just strings):

.target(
    name: "samurai",
    dependencies: [
        .product(name: "NIO", package: "swift-nio"),
    ]
)
1 Like

I want to clarify that this fixed it with swift build and that is a nice tip to know! So next time, it should be better to pattern match the name with the package for me to use for next time. This worked great, thank you so much!

Edit: Also I hope this isn't much, but importing this should be just like any other module like Foundation, or should I look at the docs/code to be sure?

Yes, you then import it as any other module in your code.