-
Notifications
You must be signed in to change notification settings - Fork 651
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
RFC: Managing versions and long-pending changes #3622
base: master
Are you sure you want to change the base?
Conversation
69f9924
to
7eb32ae
Compare
When preparing a major release for Tock, a new branch will be christened | ||
as the 'eventual release' branch, generally named `tock-v{N+1}` or | ||
similar. ABI-breaking changes will all go to the major release branch. | ||
Smaller changes and bugfixes will still go to the primary development | ||
branch. The major release branch will periodically merge in new | ||
changesets as is appropriate for its development process. |
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.
This is duplicated from the next section.
@@ -36,6 +37,63 @@ academic and professional conferences. | |||
The project also maintains a [book](https://book.tockos.org) which includes | |||
self-guided tutorials for various Tock features. | |||
|
|||
## Between Releases |
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.
This section header doesn't seem to match the contents.
currently released major version, but may also include bugfixes and new, | ||
additional features. | ||
|
||
### Patch Releases |
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.
Can this just move to the "Preparing a Release" section?
While we have a CHANGELOG file, to-date we are not great about keeping | ||
it up to date during active development. Rather, as part of release | ||
preparation the core team retroactively looks through all of the PRs and | ||
commit history since the last release and synthesizes the key changes. |
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.
CHANGELOG takes work, and it's work no one wants to do (as evidenced by it not getting updated). Perhaps eventually we hire someone who can help. But I don't think any amount of documenting is going to get the current set of core members interested in maintaining a changelog.
This is fairly on-the-nose, forgive me, but rather than creating this PR, why not direct your "service" tock time towards maintaining the changelog? You created it (a32a34d) but I don't think have touched it since 2018, and I think it's reasonable to say you are the main person who remembers it is there.
- Pro: Have the "real code" and "real fix" already there. | ||
- Con: Likely that the PR will not merge cleanly by the time the next | ||
major release occurs. | ||
- Con: Lots of noise in the PR queue |
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.
This is a substantial con.
not in the released version [though, this could arguably also be | ||
accomplished with some type of comment keyword]. | ||
|
||
4. ...? |
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.
4. ...? | |
4. Open a tracking issue for the change needed for the next release. Include the diff required to implement the change in the issue text. | |
- Pro: Work to implement the change already done. | |
- Pro: Because by definition this is a change to some stabilized portion of the kernel, the patch is likely to cleanly apply or be very close when the next release is prepared. | |
- Con: Someone has to remember to address the tracking issue. |
**Proposal:** We should not stabilize whole driver interfaces, but | ||
rather individual syscalls within them. Low-level-debug Command 2, | ||
"print a number", seems pretty safe to call immutable; I don't think | ||
we want to lock the LLD interface yet, however. |
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.
This seems like the opposite of this section, as it would make it harder to know if your app relies on stable functionality or not.
EDIT: There is a summary below so you don't have to read all this. I'm thinking through what the conditional compilation option would look like. I'll use the current state (current version is Tock 2.x but we want to carry 3.0 changes) as an example. Idea 1:
|
EDIT: There is a summary below so you don't have to read all this. Just came up with some more ideas. Idea 4: Procedural macroAdd a new procedural macro crate that exports attribute macros for each version ( extern crate proc_macro;
use proc_macro::TokenStream;
// Builds the specified item if and only if TOCK3 is empty.
#[proc_macro_attribute]
pub fn tock2(_attr: TokenStream, item: TokenStream) -> TokenStream {
match std::env::var_os("TOCK3") {
None => item,
Some(_) => Default::default(),
}
}
// Builds the specified item if and only if TOCK3 is specified.
#[proc_macro_attribute]
pub fn tock3(_attr: TokenStream, item: TokenStream) -> TokenStream {
match std::env::var_os("TOCK3") {
None => Default::default(),
Some(_) => item,
}
} In each crate that has Tock 3.0 changes, we would add a dependency on this procedural macro and use it as follows: #[tock2]
fn foo_v2() {}
#[tock3]
fn foo_v3() {} This has the advantage of working for users who do not use Cargo. Unlike the Big downside: The build system will be oblivious to the fact our crates depend on the value of Idea 5: idea 4 + idea 3We could have Procedural macro fn main() {
println!("cargo:rerun-if-env-changed=TOCK3");
if std::env::var_os("TOCK3").is_some() {
println!("cargo:rustc-cfg=tock3");
}
} Procedural macro extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn tock2(_attr: TokenStream, _item: TokenStream) -> TokenStream {
#[cfg(not(tock3))]
return _item;
#[cfg(tock3)]
return Default::default();
}
#[proc_macro_attribute]
pub fn tock3(_attr: TokenStream, _item: TokenStream) -> TokenStream {
#[cfg(not(tock3))]
return Default::default();
#[cfg(tock3)]
return _item;
} Usage: #[tock2]
fn foo_v2() {}
#[tock3]
fn foo_v3() {} This has the advantage of just Doing The Right Thing (building Tock 2.0 code) if someone builds the crate without invoking |
I realize I should summarize my previous comments, especially because this may be discussed at the next core WG call, which I do not expect to attend. I thought through how we could implement "The Truthfully, I think the conditional-compilation option is lower maintenance than the "keep PRs open until the next major release" and "always keep a next-major-release branch open" options. If we don't come up with any better ideas, then I would advocate for it. |
Idea 6: Diff in tracking issueOpen a tracking issue for the change needed for the next release. Include the diff required to implement the change in the issue text. Pro:
Con:
|
My pushback to all of the automatic/cfg/etc. options is that we would effectively be maintaining two versions of the kernel (and giving users a [relatively] easy option to use either). I argue we have trouble keeping up with one version of the kernel, and don't want the inevitable issue: "I enabled the tock-3.0 flag and userspace doesn't work how do I fix it". |
Pull Request Overview
This tries to write up a more complete summary of my thinking from #3585. As I was working on this, it bled over to a couple distinct concerns that arguably could be 4-5 separate RFCs, but these are all interrelated to a degree. I tried to keep the document reasonably organized which hopefully can facilitate logical threads of conversation.
Testing Strategy
N/A
TODO or Help Wanted
Your thoughts! And talk me off the ledge of
cfg
maybe being a good idea for something. I think I talked myself out of it already, but there was a real moment there where I was almost going to advocate for it.Rendered