-
Notifications
You must be signed in to change notification settings - Fork 702
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
bump Rust nightly to nightly-2024-05-23 and set optimize_for_size #4002
Conversation
Still waiting on the flag to propagate through. Should hopefully be here in a day or two |
a9496c8
to
43db5ed
Compare
43db5ed
to
39dfd89
Compare
39dfd89
to
134be4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, modulo the removed code.
At some point we ought to do a pass and remove all these feature flags in favor of reflecting this through type-level mechanisms (e.g., pluggable generics and corresponding trait implementations).
@alistair23 to merge this, we need to have a clean change that doesn't "sneak in" any other changes that would merit separate discussion. At this point I think that's just removing the cfg's in the lowrisc chip crate (the comment in the stm32 chip Cargo.toml is possibly inaccurate, but oh well) should be reverted, in the same manner as the STM32 cfgs were restored. Separately, on those changes, it's important to recognize that not all code that uses this repository is in this repository----that is both a reality and desirable---so there are very well may be users of code that appears dead in the sense that no code in this repository exercises/enables it. |
Separate from this PR, but that's something we should probably discuss at some point. Especially once the automated, federated CI is online, having 'forever uncovered' code feels like it isn't a great system. (This is to say, if it's used externally, and we're maintaining dead-looking code to avoid folks having to carry out-of-tree patches, there should be something external checking to make sure that other changes here don't break the dead-looking stuff). For the immediate term, however, I agree with leaving the status quo, such as it is. |
@ppannuto I agree, but I do think that the problems are exacerbated by the fact that this is hidden behind a conditional compilation flag. We're much more confident in, and have made better experiences with, switching between different code paths at compile-time with type-system based approaches. Rust's expressive type-system and Tock's use of it allows us to catch a great many types of issues even without runtime tests, but we don't even have that with conditional compilation. |
Bump to nightly-2024-05-23 of Rust. This includes: - a few clippy fixes - Removing mut from &mut self that don't need it - Removing dead code hidden behind non-existant cfg - Also adding cfgs to avoid the warnings for dead code, as per Amit's request (see tock#4002 (comment)) Signed-off-by: Alistair Francis <[email protected]>
134be4a
to
534e3b5
Compare
Bump to nightly-2024-05-23 of Rust. This includes: - a few clippy fixes - Removing mut from &mut self that don't need it - Removing dead code hidden behind non-existant cfg - Also adding cfgs to avoid the warnings for dead code, as per Amit's request (see tock#4002 (comment)) Signed-off-by: Alistair Francis <[email protected]>
534e3b5
to
38e16fb
Compare
I have re-added the I also updated the Tock docs to clarify that custom I still think this is a really bad idea to keep, espicially when there is no way for us to enable it without adding a custom build.rs (I think it can also be enabled in
It's not a conditional compilation flag though. It's not even a Cargo feature. It requires a special |
I don't want to block on this further and I don't think that this is the right place to discuss these issues, but my 2ct:
|
Actionable: @alistair23 please just exclude the updates to docs. This can/should just be a clean upgrade nightly, and otherwise what you've done is awesome. If you just exclude the most recent doc commit, I will hit merge immediately. Re: @lschuermann's comments (and @alistair23's position) I agree that these cfgs are a bad way of solving this problem. Feature flags would be better, and a generic would be even better. I think it absolutely makes sense to discourage both cfgs in favor of feature flags and discourage feature flags in favor of generics whenever possible, including for the stm32s. Just in a separate discussion/PR that would solicit insights from the people involved with those chips. |
I don't want to cement the I opened #4012 to split the doc change out. Let's just clarify that this is desirable behaviour from a Tock perspective before I end up being the person |
It is not desirable! But it is a separate discussion, that actually requires some feedback from anyone who put these in or may have insight about these chips, not something to just remove in an update of nightly. |
You said earlier that it is desirable, sorry if I misinterpreted that I have CCed Wilfred who added the |
If you're worried about who gets git blamed I am happy to cherry pick those changes into a separate commit that blames me with an appropriate explanation in the commit message. We definitely do not want to solidify a discouraged practice in the docs, and we also don't want to remove exported functionality in a commit who's title is about updating nightly in a PR that is about updating nightly. There is really no disagreement here about what is better to have in the code, just about the appropriate place and way to change it. |
Wait, if the issue is just that you want a separate PR to remove the dead code I can just open a separate PR to remove it. That wasn't my original interpretation of what you were asking |
I just want a separate PR to deal with the "potentially" dead code. One option is to just remove the cfg and code, but we'd want to do some sue dilligence so as not to lose some important value it might provide. |
Easy! PR opened to remove the dead code |
Ok, thanks, but we still need to remove the doc change in this PR to merge it (remove the last commit). I think it's likely for the new PR to involve a fair amount of detective work to (a) figure out whether that code is useful and (b) decide how to deal with it if it is (removing it is probably not the right move if it's useful, even if keeping it as cfgs is also not good). |
Just a note, if we merge this we need to update #1654. |
Bump to nightly-2024-05-23 of Rust. This includes: - a few clippy fixes - Removing mut from &mut self that don't need it - Removing dead code hidden behind non-existant cfg - Also adding cfgs to avoid the warnings for dead code, as per Amit's request (see tock#4002 (comment)) Signed-off-by: Alistair Francis <[email protected]>
38e16fb
to
f74c8ff
Compare
Bump to nightly-2024-05-23 of Rust. This includes: - a few clippy fixes - Removing mut from &mut self that don't need it Signed-off-by: Alistair Francis <[email protected]>
Signed-off-by: Alistair Francis <[email protected]>
f74c8ff
to
be1b5b5
Compare
Pull Request Overview
bump Rust nightly to nightly-2024-05-23
Bump to nightly-2024-05-23 of Rust. This includes:
Also set a feature flag in the core library that aims to produce smaller implementations for certain algorithms. See rust-lang/rust#125011 for more details.
Testing Strategy
CI
TODO or Help Wanted
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.