This is a fork of https://github.com/madsim-rs/madsim
The madsim project is building a tokio-like (but not 100% compatible) deterministic runtime. This fork modifies the original project to produce a drop-in replacement for tokio.
-
Clone the tokio fork, add an upstream remote, and fetch
$ git clone [email protected]:MystenLabs/tokio-msim-fork.git $ cd tokio-msim-fork $ git remote add upstream [email protected]:tokio-rs/tokio.git $ git fetch upstream --tags -
See what our current version of tokio is - don't just look in Cargo.toml since we can be ahead of the version requested there.
# cd sui # cargo tree -i tokio --depth 0 -
Now rebase the fork onto the tokio release you want to use.
# make a new branch for the version we want to upgrade TO # start the branch from the current version, that we are upgrading FROM $ git checkout -b msim-1.43.0 msim-1.38.1 # and rebase using the version tag $ git rebase tokio-1.43.0 # push the rebased version to our repo and remember the current commit $ git push $ FORK_COMMIT=`git rev-parse HEAD` -
Usually, there are no merge conflicts. If there are, the scope of the fork is limited and things should be fixable.
-
Now, in this repo
- Edit the version in
msim-tokio/Cargo.tomlto match the version we are upgrading to (1.43.0in this example). - Find all references to
https://github.com/MystenLabs/tokio-msim-fork.gitin Cargo.toml files in this repo and update therevparam toFORK_COMMIT.
- Edit the version in
-
Now, in the sui repo, update the tokio version by editing Cargo.toml, or by running:
$ cargo update -p tokio --precise 1.43.0 -
Install simtest (if you already have it, skip this step): https://github.com/MystenLabs/sui/blob/main/scripts/simtest/install.sh
-
Test all the changes against your local msim repo - if there are build errors the rebasing may have gone wrong. Make sure to put the correct path for the LOCAL_MSIM_PATH variable. $ cd sui $ LOCAL_MSIM_PATH=/path/to/mysten-sim cargo simtest
-
If you're updating tokio because it needs to be updated in
suimonorepo, then make sure to update allrevfields ofmsiminsuimonorepo to point to the right commit from this repository (including script files!).
TODO