Skip to content

Commit 4886f90

Browse files
mystenmarkstefan-mysten
andauthoredJan 21, 2025··
Move tokio fork to MystenLabs repo, and add instructions to upgrade tokio (#57)
* Move tokio fork to MystenLabs repo, and add instructions to upgrade tokio * Update README.md Co-authored-by: stefan-mysten <135084671+stefan-mysten@users.noreply.github.com> * Update README.md Co-authored-by: stefan-mysten <135084671+stefan-mysten@users.noreply.github.com> --------- Co-authored-by: stefan-mysten <135084671+stefan-mysten@users.noreply.github.com>
1 parent 2a170f4 commit 4886f90

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed
 

‎README.md

+44
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,50 @@
55
The madsim project is building a tokio-like (but not 100% compatible) deterministic runtime.
66
This fork modifies the original project to produce a drop-in replacement for tokio.
77

8+
## How to upgrade the tokio version:
9+
10+
1. Clone the tokio fork, add an upstream remote, and fetch
11+
12+
$ git clone git@github.com:MystenLabs/tokio-msim-fork.git
13+
$ cd tokio-msim-fork
14+
$ git remote add upstream git@github.com:tokio-rs/tokio.git
15+
$ git fetch upstream --tags
16+
17+
2. 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.
18+
19+
# cd sui
20+
# cargo tree -i tokio --depth 0
21+
22+
2. Now rebase the fork onto the tokio release you want to use.
23+
24+
# make a new branch for the version we want to upgrade TO
25+
# start the branch from the current version, that we are upgrading FROM
26+
$ git checkout -b msim-1.43.0 msim-1.38.1
27+
28+
# and rebase using the version tag
29+
$ git rebase tokio-1.43.0
30+
31+
# push the rebased version to our repo and remember the current commit
32+
$ git push
33+
$ FORK_COMMIT=`git rev-parse HEAD`
34+
35+
3. Usually, there are no merge conflicts. If there are, the scope of the fork is limited and things should be fixable.
36+
37+
4. Now, in this repo
38+
39+
1. Edit the version in `msim-tokio/Cargo.toml` to match the version we are upgrading to (`1.43.0` in this example).
40+
2. Find all references to `https://github.com/MystenLabs/tokio-msim-fork.git` in Cargo.toml files in this repo and update the `rev` param to `FORK_COMMIT`.
41+
42+
5. Now, in the sui repo, update the tokio version by editing Cargo.toml, or by running:
43+
44+
$ cargo update -p tokio --precise 1.43.0
45+
46+
6. Test all the changes against your local msim repo - if there are build errors the rebasing may have gone wrong.
47+
48+
- install simtest (if you already have it, skip this step): https://github.com/MystenLabs/sui/blob/main/scripts/simtest/install.sh
49+
50+
$ LOCAL_MSIM_PATH=/path/to/mysten-sim/repo cargo simtest
51+
852
## Usage:
953

1054
TODO

‎msim-tokio/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ msim = { version = "0.1.0", path = "../msim" }
6161
[dependencies]
6262
tracing = "0.1"
6363

64-
real_tokio = { git = "https://github.com/mystenmark/tokio-madsim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", package = "real_tokio", features = ["full"] }
64+
real_tokio = { git = "https://github.com/MystenLabs/tokio-msim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", package = "real_tokio", features = ["full"] }
6565
bytes = { version = "1.1" }
6666
futures = { version = "0.3.0", features = ["async-await"] }
6767
mio = { version = "0.8.1" }

‎msim/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ ahash = "0.7"
3838
downcast-rs = "1.2"
3939
libc = "0.2"
4040
naive-timer = "0.2"
41-
tokio = { git = "https://github.com/mystenmark/tokio-madsim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", package = "real_tokio", features = ["full"] }
42-
tokio-util = { git = "https://github.com/mystenmark/tokio-madsim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", features = ["full"] }
41+
tokio = { git = "https://github.com/MystenLabs/tokio-msim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", package = "real_tokio", features = ["full"] }
42+
tokio-util = { git = "https://github.com/MystenLabs/tokio-msim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", features = ["full"] }
4343
toml = "0.5"
4444
socket2 = "0.4"
4545
erasable = "1.2"
@@ -50,7 +50,7 @@ async-task = { git = "https://github.com/mystenmark/async-task", rev = "4e45b26e
5050
[dev-dependencies]
5151
criterion = "0.3"
5252
structopt = "0.3"
53-
tokio = { git = "https://github.com/mystenmark/tokio-madsim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", package = "real_tokio", features = ["full"] }
53+
tokio = { git = "https://github.com/MystenLabs/tokio-msim-fork.git", rev = "d46208cb11118c0e6ab5dfea1a2265add36fbc15", package = "real_tokio", features = ["full"] }
5454

5555
[[bench]]
5656
name = "rpc"

0 commit comments

Comments
 (0)
Please sign in to comment.