swift icon indicating copy to clipboard operation
swift copied to clipboard

Fix `Bundle.module` paths

Open MaxDesiatov opened this issue 3 years ago • 2 comments

Currently use of Bundle.module for static resources causes issues, check the URL generated by carton with SwiftWasm 5.6 in this code: https://github.com/swiftwasm/carton/blob/b9dab08e869f51415a55b3bb15a3e29cfd1e16e7/Tests/Fixtures/TestApp/Sources/TestApp/main.swift#L48

It contains full path to the toolchain, which is obviously invalid.

MaxDesiatov avatar May 19 '22 13:05 MaxDesiatov

FWIW I think the full path was embedded by SwiftPM code generator for Bundle.module

kateinoigakukun avatar Jun 11 '22 09:06 kateinoigakukun

It seems that SwiftPM generates the bundle path here (by appending the bundle extension to the build path), then this property conditionally exposes the bundle path, and finally —on the WASI platform— the entire absolute path is retained, leading to the issue described.

filip-sakel avatar May 29 '23 17:05 filip-sakel