Remove support for env and process functionality#17
Conversation
AzureMarker
left a comment
There was a problem hiding this comment.
I did test the freestanding functions in process (id, exit, and abort). id returns a really big, static-looking ID that didn't change across runs. Both exit and abort caused the app to quit to the home screen with a dialog saying it crashed and needs to restart.
I also double checked that we can't spawn processes, and it fails to link due to missing symbols (which is expected).
So, I think it's good that we're disabling the process module. However, see the comments about the other functions, since I don't think we should disable them.
| #[cfg(not(target_os = "espidf"))] | ||
| #[cfg(not(any(target_os = "espidf", target_os = "horizon")))] | ||
| pub fn page_size() -> usize { | ||
| unsafe { libc::sysconf(libc::_SC_PAGESIZE) as usize } |
There was a problem hiding this comment.
This is actually supported, and is used by std threads. See rust3ds/shim-3ds#11
| #[cfg(target_os = "espidf")] | ||
| #[cfg(any(target_os = "espidf", target_os = "horizon"))] | ||
| pub fn getcwd() -> io::Result<PathBuf> { | ||
| Ok(PathBuf::from("/")) |
There was a problem hiding this comment.
I was able to run an example that successfully reads the current dir and changes the directory:
println!("Current dir: {:?}", std::env::current_dir());
println!("Change dir result: {:?}", std::env::set_current_dir("/3ds"));
println!("Current dir: {:?}", std::env::current_dir());I don't think we should remove this.
|
Interestingly, libctru implements |
|
Oh wow, env is way more supported than I thought. Even EnvVars are present. We could do some cool stuff with this, like setting Edit: I'm not saying we should do the |
|
Yes, |
Related to #6
Removed
processsupport and changedenvfunctions to avoid unsupported functionality. Tell me if anything else is left to remove, we can do one big cleanup here.@AzureMarker @ian-h-chamberlain