overdrivenpotato / rust-psp

Rust on PSP. Panic and allocation support. Access PSP system libraries.
Other
588 stars 31 forks source link

fix: remove `OsStrExt` from psp build script #138

Closed zetanumbers closed 1 year ago

zetanumbers commented 1 year ago

Fixes #135

It's practically impossible to have nonunicode rustflags passed into a buildscript

overdrivenpotato commented 1 year ago

Have you tested this on Windows, macOS, and Linux? I'm curious if this can break if RUSTFLAGS somehow grabs UTF16 paths on Windows.

zetanumbers commented 1 year ago

Have you tested this on Windows, macOS, and Linux? I'm curious if this can break if RUSTFLAGS somehow grabs UTF16 paths on Windows.

Rust std assumes windows strings are wtf-8, which is basically utf-8 pretending to be utf-16. Since wtf-8 is a superset of utf-8, you can interact with it via any tool with wtf-8 (terminal, shell), which i imagine is majority. Rust std only checks if wtf-8 contains any surrogate code point (pair) and if not, it trivially converts OsString to String. Cargo should use wtf-8 too, so this pr should have the right approach.

I've tested passing Cyrillic on windows via nushell, and it woked as intended.

I am touched by your assumption that i am a CI in the flesh, but i do not have a spare macos system 😉. But since macos is unix, it's the same as for linux (OsStrExt is implemented for unix family).

sajattack commented 1 year ago

Speaking of which, I could set up macOS and windows VMs on my server if concourse supports adding those as runners.

overdrivenpotato commented 1 year ago

Given that we're going to set up Windows/macOS workers at a later date, I'll merge this.

overdrivenpotato commented 1 year ago

Thanks for the PR!