Brendonovich / swift-rs

Call Swift functions from Rust with ease!
Apache License 2.0
253 stars 30 forks source link

Build script breaks when package_root does not end with slash #14

Closed amodm closed 1 year ago

amodm commented 1 year ago

Currently, string concatenation is used to determine the path to be output for cargo:rustc-link-search=native=, as seen here: https://github.com/Brendonovich/swift-rs/blob/1ca64300e3deedbd47d782d86770d5fc673ffaa4/src-rs/build.rs#L80

So if the package_root argument to link_swift_package does not end with a /, the build breaks, and it's not obvious to the user why that has happened.

This needs to be changed to use std::path's join mechanism instead of a simple string concatenation.

amodm commented 1 year ago

PR #13 fixes this.