-
Notifications
You must be signed in to change notification settings - Fork 19
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
Workspace changes and MSRV 1.70 #100
Conversation
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.
Thanks for the great pull-request! I did not properly understand the role of MSRV and how to use it.
And I didn't know that workspace.dependencies
could centralize versions of dependent libraries, so this change seems very meaningful and good.
...However, I think that the libraries we want to provide to developers (api, xrpc-client, etc.) and the libraries to generate them (codegen), examples, etc. have different essential roles. So it seems a bit strange to centralize these. Would it have been better if only the ones we wanted to provide to developers were grouped together in a separate repository...
Thanks also for the reference information about MSRV. I think 1.70 is a good choice at this point. When a little more time goes by and 1.75 or higher becomes more common, I would like to move up to 1.75 and remove the dependency on async-trait
.
If you want to take this approach, we can do so; I was proposing just the minimal set of changes to modernise the workspace, but I can make a more radical PR 😈
In this structure:
An alternative would be to use a similar structure, but moving
I'm happy to rework this PR in this direction if you want. |
I separately note that |
Regarding the structure of the repository, I think your first suggestion sounds good: a library that we want to provide to developers as ATrium (whether or not you want to make it public), and a library as a tool to maintain those libraries. It seemed to me that it would be good to have a clear distinction by role. In this case, is my understanding correct that the so-called As for As for I am not good at English and am writing this reply with the help of machine translation. Sorry if it was not clear. |
This is the minimum version for the current dependencies; specifically the `clap 4.4` dependency in `atrium-cli` constrains this. The MSRV being at least 1.64 means we can use workspace inheritance.
Per the updated guidance from the Cargo team, library crates can check in a lockfile if they want to test against their MSRV. And in any case, atrium-cli is a binary crate, so it needs a lockfile to be checked in. The lockfile pins dependency versions that work with 1.70 (in particular `clap < 4.5`). Committing a `rust-toolchain.toml` file will result in CI running against MSRV by default, and developers using the MSRV toolchain by default (avoiding accidentally depending on features in later compiler versions).
Sounds good!
If you want the examples in the repository to be updated as changes are made to the other crates (i.e. if you want the examples to reflect the development state), then they would go into the workspace in If you want the examples to be standalone then it would make more sense to leave them at the top level (i.e. not part of either workspace), and then just remember to update them after releases.
Yep, I can do that. The crates under
In that case, rather than a
It's perfectly clear to me! 🙂 |
4020405
to
cea6299
Compare
Force-pushed to split the repository into two workspaces. I actually worked out that I could add a |
cea6299
to
a7a0211
Compare
Thank you for the reconstruction! |
If
It isn't necessary to move dependencies into the workspace, just useful. So if you don't find it useful to move the non- |
a7a0211
to
a28cb49
Compare
Force-pushed to remove from the |
Pushed an additional commit to add a |
As for what I want the Anyway, for now, the current repository structure looks very good. |
This fixes several instances where one of the workspace crates was depending on an old published version of another workspace crate. The instances in `atrium-xrpc-server` and the firehose example are not fixed here as this conflicts with sugyan#98.
They are now standalone crates that show how to use the latest published crates, not the workspace state.
f448486
to
94446b2
Compare
Force-pushed to fix the |
Oh... I forgot about Anyway, I will proceed that separately from this pull-request. I'll merge this once. Thank you! |
This sets the MSRV of the libraries in this workspace to 1.70 (released June 2023), which is the MSRV required for the previously-declared dependency versions (specifically
clap 4.4
). This is not the actual minimum Rust version that works with the published libraries however; I was able locally to get everything working with Rust 1.64 (released September 2022) by adjusting a couple of dependency lower version bounds. Going below this would require significant dependency version downgrades, and I'm not sure is actually desirable.For context, the Rust version packaged with current Debian stable (bookworm) is 1.63, and it looks like the next stable Debian will use 1.70. The Rust Docker images provide latest stable, as does
rustup
.Declaring some lower bound is beneficial both for downstream developers to know whether or not they can use the libraries up-front, and for contributors to know what features they can rely on:
async-trait
crate can be removed.