rust3ds / cargo-3ds

Cargo command to work with Nintendo 3DS project binaries.
Apache License 2.0
58 stars 10 forks source link

[Question]: Is the family supposed to say unix? #54

Closed lexi-the-cute closed 6 months ago

lexi-the-cute commented 6 months ago

I was looking into the environment variables for 3DS building and it looks like the only identifying feature that marks it is the target variable that says armv6k-nintendo-3ds. The family and arch say it's unix and arm respectively. I was looking into modifying my Cargo.toml and build.rs to handle 3DS for potential future implementation and to remove things like ctrlc support if it's not in the unix and windows families. Right now the only other option I see is wasm. I was thinking the family would be something different for something that's unique like maybe setting it to horizon or nintendo. So, I'm just wanting to know if setting to unix is intentional

Meziu commented 6 months ago

It is intentional. Even though the 3DS’ OS doesn’t fit into any public standard (let alone the unix family of operating systems) the many homebrew libraries built for it are made to emulate the general Unix-like ecosystem (first and foremost by using a subset of newlib).

This is what enables us to use most of the standard library’s common implementations without manual intervention and also why many smaller or feature specific crates (like getrandom) can expect a more-or-less standard behaviour by the platform.

Again, having a “unix-like” software ecosystem and being a common desktop OS are two completely different things. One can never expect common functionality from such a specific piece of software and hardware (of which we don’t even know the full inner workings).

ian-h-chamberlain commented 6 months ago

If you do want to use #[cfg] to avoid the 3DS, you can always use not(target_os = "horizon"), which is what much of the standard library does for things that are unix-ish but don't work on the 3DS.

@Meziu I was thinking of transferring this to https://github.com/orgs/rust3ds/discussions but I don't see a button for doing that... maybe it needs to be transferred to ctru repo first and then converted?

Meziu commented 6 months ago

@Meziu I was thinking of transferring this to https://github.com/orgs/rust3ds/discussions but I don't see a button for doing that... maybe it needs to be transferred to ctru repo first and then converted?

Possibly, I had noticed these were opened on cargo-3ds, which isn’t where we usually discuss issues related to the toolchain at large.