-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STD Cleanup and Test #6
Comments
I'm interested to see what kind of futures executor I can get running on the 3DS. Then again, there isn't much in the futures module that could be broken. |
Maybe there's a way to run the runtime std tests on-device? |
At one point I actually was able to build I can start taking a look at cleaning up lints and warnings, I noticed that |
|
rust3ds/ctru-rs#25 Maybe we could do something with this, or Citra. Though I suggest on-hardware tests (as I also can't run Citra). |
This was me before noticing |
This was a while ago, so it might have been a combination of |
I personally never built the
It's just a small change in |
I haven't looked into it, but there's some randomness code in libctru used by ctru-rs which we might be able to use in the linker fix crate to supply a libc call? |
Is there? I haven't found anything other than |
This API is the only thing I've found, but it includes this note at the top of the module:
So I'm not sure if we could use that. BTW, I've found that searching with Google and Edit: there are a few other APIs, |
We could implement a call to |
Turns out |
Looking at the implementation of So maybe we could try our own impl that basically looks like this? let now = svcGetSystemTick();
// Not sure if the math is quite right but you get the idea...
(*tp).tv_sec = now / SYSCLOCK_ARM11;
(*tp).tv_nsec = 1000 * (now - SYSCLOCK_ARM11*(*tp).tv_sec) / CPU_TICKS_PER_USEC; I have to imagine that |
Fantastic. If it's ticks since boot, it's by definition monotonic. Though now I wonder if we may have link problems (this is the first normally available function we are actively going to reimplement). |
I'm not sure I understand, wouldn't this just go into a different |
Yeah, no other syscall. We just need a CLOCK_MONOTONIC match |
Fixed HashMaps in bbaf4bf |
Based on https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/std.3A.3Athread.20support.20for.20armv6k-nintendo-3ds/near/271654826, I think we should consider making a PR with what we have (or split it up into more chunks) without the thread changes in #10, and then make PRs for that and other changes later. |
We can totally do that. But first we need a couple of things. 1) We have to make a PR to libc (this includes renaming the newly added pthread functions) and make sure we won’t need much of libc in the future. 2) Check if our repo passes CI checks. GitHub doesn’t let us run them, but I wonder if we can try them anyways via CLI. |
Putting this out there... A lot of the stuff we'd like to test may work "well enough" if we can use the same mechanism as I don't imagine it would be easy, especially since |
Yeah we could try running std tests, that would simplify things a lot, but I have no idea where to start implementing it. These kinds of tests are usually done for the host target. |
Priorities on the first STD PR:
|
I tried this a bit yesterday, but didn't get super far along. I have a patch to |
Honestly compiling an executable would be more than enough. Getting to run them even once would give us immense info on the status of our progress. |
What’s left doing: |
I think both of those are nice-to-haves, especially the path one. We could start opening a PR to libc and eventually std in the meantime. We can open follow-up PRs as needed. |
We need to squash some commits both in libc and std (though std commits also needs to be separated in two PR’s). I don’t have much time these days, if you could do that (in a new branch) I’ll open the PR to libc. |
I made two branches for libc. I can merge them into one, but I think the first might go in easier than the second (to unblock the getrandom PR quicker): Feel free to push these to your repo and open the PR from there if you want. Or, I could handle the PR if you think you won't have time. |
Thank you! They look good already. You can open the PR’s yourself if you want it to go through faster, I don’t have my pc right now. |
Opened rust-lang/libc#2714 and rust-lang/libc#2715 |
Well, that was pretty easy :). Both PRs are merged now and released in 0.2.120. We should update https://github.com/Meziu/libc to match the upstream (I definitely don't have permission to force-push master, so I'll leave that to @Meziu). We may want to make more changes later (I'm still eyeing tokio-console, which requires some more networking changes). rust-random/getrandom#248 is published as well now, which isn't needed for std but is well used in third party crates (ex. through |
Little update about what I've been doing: I've made a bit of progress getting std tests to compile, but not 100% there yet (some linker issue with Side note: I also found out there is a built-in way to run Re #16 (comment) - I need to test again and can probably do so whenever I figure out or give up on the std testing. |
I rebased our commits on the latest rust-lang/rust changes, and split it into two branches:
This rebase also cleaned up the Cargo.lock situation (upgraded to libc 0.2.120 in the first commit) and tidied up the history slightly (removed some reverted commits, squashed/fixed-up a commit). I can open a PR to rust-lang/rust soon for Once that merges we can rebase the threads branch and make another PR. In the meantime, @Meziu you could reset your Note: when testing I did run into rust-lang#94983, which I worked around by setting |
Wait, does Edit: I also wonder how the automatic building process works for |
@AzureMarker - sounds good, I can help with cleanup if there is enough worth splitting the work. @Meziu it looks like rust-lang/libc#2725 did not make it in to 0.2.120 but everything else did, based on the commit order. So perhaps we will want to bump again and update before a PR to std. As far as I know, tier 3 platforms do not have prebuilt std (that would be tier 2 i think based on https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2 ) Also, should we add a documentation page for 3ds as in https://doc.rust-lang.org/nightly/rustc/platform-support/TEMPLATE.html ? Seems like the policy to start adding these happened right around the time of rustc support for 3ds was added so it wasn't required in review, but with std coming in I think it would make sense. I can write that up if you'd like and put the three of us on as maintainers? |
I didn’t know about those. Yeah, we three can be maintainers (maybe I should put up a GitHub group now that I think about it). About specific info, like build information, specify the need of system libraries, and that we automatically link them via |
Let’s just wait for Rust to pull everything and then sync with them. That tree is screwed, thanks for the cleanup. |
There is the https://github.com/Rust3DS group, but we'd have to talk to them and see if they're still interested or are able to transfer ownership (we should let them know of our progress in any case). |
I can contact @FenrirWolf later (doesn't look active on GitHub). |
Hiya folks, I'm still alive. Just haven't been very active in the 3DS space. I'll definitely have to look over everything you guys have been doing though! I have some control over the Rust3DS github group, but iirc @HybridEidolon is the one who has full ownership and permissions over it. |
Yeah, I played around with things and I don't have very many permissions in the org. Don't think I can even add people to it myself. But hopefully we can get Eidolon's help with that. Also do you guys coordinate on discord or something, or has it mainly been through github issues? |
We have only communicated via GitHub for now. |
We could enable GitHub Discussions on some of the repositories to make non-issue communication easier (I don't have that permission). |
This is now in 0.2.121. I'll bump it in the rustc fork. |
I enabled Discussions on my rustc fork at least (where we have some branches staged for the upstream PRs), if anyone's interested: @FenrirWolf if you have any issues with getting the toolchain working, feel free to open a thread there. |
@HybridEidolon we’ve noticed people still stumble (most definitely because of google search results) in your rust3ds GitHub org, which is quite outdated. Are you willing to pass the ownership to us or make us contributors so we can port our changes to that repo and re-organize it? |
Thanks for the organization invites @HybridEidolon! @Meziu @ian-h-chamberlain we should discuss how we should transfer and organize repos in the org. Let's talk here: |
Opened the std PR! rust-lang#95897 |
I think with that, we can close this issue? We will still need to open the |
We have worked with most of the
std
while updatingctru-rs
's modules. However, we now have to merge our changes into the rustlang tree, and this will require cleanup and a lot of testing. We must make sure to never have to make PR's tostd
ever again, since the effort for the contributor and the reviewer is great.Since very basic/already tested multiple times, I'd skip testing of fundamental datatypes and of these modules:
TESTED AND NOW WORKING MODULES:
Modules we should test, though we have already worked with:
Other than testing, cleaning up lints and other problems is needed.
@AzureMarker @ian-h-chamberlain
Please, a combined effort is the best and fastest way.
The text was updated successfully, but these errors were encountered: