-
Notifications
You must be signed in to change notification settings - Fork 21
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
chore(infra): use rust-toolchain.toml to align rust toolchains locally and in ci #656
chore(infra): use rust-toolchain.toml to align rust toolchains locally and in ci #656
Conversation
d9470c7
to
a61b3aa
Compare
Benchmark movements: |
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.
Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @alon-dotan-starkware and @nadin-Starkware)
a discussion (no related file):
- delete rust_version.txt
- update merge_branches.py to reflect your changes (see where rust_version.txt was used)
a discussion (no related file):
please add @nimrod-starkware and @giladchase as reviewers
rust-toolchain.toml
line 5 at r1 (raw file):
components = [ "rustfmt", "rustc-dev", "clippy" ] targets = [ "x86_64-unknown-linux-gnu" ] profile = "default"
this file defines the toolchain, so it should not be merged forward (i.e. once it exists on main, the merge script should checkout this file).
this means that any changes to this file will need to be cherry-picked to all relevant branches, right?
Code quote:
[toolchain]
channel = "stable"
components = [ "rustfmt", "rustc-dev", "clippy" ]
targets = [ "x86_64-unknown-linux-gnu" ]
profile = "default"
.github/actions/install_rust/action.yml
line 7 at r1 (raw file):
required: false type: string default: ''
no longer used...? how do we control component installation now?
Code quote:
components:
description: "Optional: which additional components to install."
required: false
type: string
default: ''
a61b3aa
to
a5167b9
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.
Reviewable status: 11 of 13 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
- delete rust_version.txt
- update merge_branches.py to reflect your changes (see where rust_version.txt was used)
Done.
a discussion (no related file):
Previously, dorimedini-starkware wrote…
please add @nimrod-starkware and @giladchase as reviewers
Done.
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.
Reviewable status: 11 of 13 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
.github/actions/install_rust/action.yml
line 7 at r1 (raw file):
Previously, dorimedini-starkware wrote…
no longer used...? how do we control component installation now?
in the rust-toolchain.toml file
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.
Reviewable status: 11 of 13 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
rust-toolchain.toml
line 5 at r1 (raw file):
Previously, dorimedini-starkware wrote…
this file defines the toolchain, so it should not be merged forward (i.e. once it exists on main, the merge script should checkout this file).
this means that any changes to this file will need to be cherry-picked to all relevant branches, right?
this will be like the bazel WORKSPACE file... it will define the exact toolchain to use for each commit
Benchmark movements: |
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @alon-dotan-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
rust-toolchain.toml
line 5 at r1 (raw file):
Previously, alon-dotan-starkware wrote…
this will be like the bazel WORKSPACE file... it will define the exact toolchain to use for each commit
yes, but we decided we want
- stable version on
main
- fixed version on release branches
- each release branch should have it's own (unchanging!) version
so, we need merge guards somehow.
load_blockifier and load_committer bzl files allow forward merging by splitting lines and writing each release branches "version" (of the crate) explicitly on separate lines.
how will this work with therust-toolchain.toml
file?
.github/actions/install_rust/action.yml
line 7 at r1 (raw file):
Previously, alon-dotan-starkware wrote…
in the rust-toolchain.toml file
so delete the inputs key please
scripts/merge_branches.py
line 19 at r2 (raw file):
FINAL_BRANCH = "main" MERGE_PATHS_FILE = "scripts/merge_paths.json" FILES_TO_PRESERVE = {}
what about the toolchain file?
Code quote:
FILES_TO_PRESERVE = {}
a5167b9
to
59239d8
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
.github/actions/install_rust/action.yml
line 7 at r1 (raw file):
Previously, dorimedini-starkware wrote…
so delete the inputs key please
Done.
scripts/merge_branches.py
line 19 at r2 (raw file):
Previously, dorimedini-starkware wrote…
what about the toolchain file?
Done.
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.
Reviewable status: 10 of 13 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
rust-toolchain.toml
line 5 at r1 (raw file):
Previously, dorimedini-starkware wrote…
yes, but we decided we want
- stable version on
main
- fixed version on release branches
- each release branch should have it's own (unchanging!) version
so, we need merge guards somehow.
load_blockifier and load_committer bzl files allow forward merging by splitting lines and writing each release branches "version" (of the crate) explicitly on separate lines.
how will this work with therust-toolchain.toml
file?
Done.
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.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alon-dotan-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
a discussion (no related file):
pending python side PR success
Benchmark movements: |
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.
Reviewed 1 of 11 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alon-dotan-starkware, @giladchase, and @nadin-Starkware)
scripts/merge_branches.py
line 19 at r3 (raw file):
FINAL_BRANCH = "main" MERGE_PATHS_FILE = "scripts/merge_paths.json" FILES_TO_PRESERVE = {"rust-toolchain.toml"}
What if we have changes in that file that we want to keep in the source branch? (Changes that are unrelated to the rust version)
Do we expect that this file will change?
Code quote:
FILES_TO_PRESERVE = {"rust-toolchain.toml"}
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alon-dotan-starkware, @giladchase, @nadin-Starkware, and @nimrod-starkware)
scripts/merge_branches.py
line 19 at r3 (raw file):
Previously, nimrod-starkware wrote…
What if we have changes in that file that we want to keep in the source branch? (Changes that are unrelated to the rust version)
Do we expect that this file will change?
this is indeed a problem... but the advantages of using a rust-toolchain.toml file is worth it.
with this file, if you run cargo build
locally, cargo will auto-install the specific toolchain required and build the workspace with it.
we should probably make the merge_branches script smarter: check that, if there is a diff in this file, that it is only in the toolchain version and nothing else - otherwise report a conflict or something
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alon-dotan-starkware, @giladchase, and @nadin-Starkware)
scripts/merge_branches.py
line 19 at r3 (raw file):
Previously, dorimedini-starkware wrote…
this is indeed a problem... but the advantages of using a rust-toolchain.toml file is worth it.
with this file, if you runcargo build
locally, cargo will auto-install the specific toolchain required and build the workspace with it.
we should probably make the merge_branches script smarter: check that, if there is a diff in this file, that it is only in the toolchain version and nothing else - otherwise report a conflict or something
ok, unblocking :)
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.
Reviewed 9 of 11 files at r1, 1 of 2 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @alon-dotan-starkware and @nadin-Starkware)
.github/actions/install_rust/action.yml
line 4 at r3 (raw file):
using: "composite" steps: - uses: moonrepo/setup-rust@v1
is this better than dtolnay/rust-toolchain?
Code quote:
- uses: moonrepo/setup-rust@v1
.github/workflows/blockifier_compiled_cairo.yml
line 35 at r3 (raw file):
- uses: actions/checkout@v4 - uses: ./.github/actions/install_rust - uses: Swatinem/rust-cache@v2
Curious, what issues has this causes? how do we caching without it?
Code quote:
- uses: Swatinem/rust-cache@v2
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @alon-dotan-starkware, @giladchase, and @nadin-Starkware)
.github/actions/install_rust/action.yml
line 4 at r3 (raw file):
Previously, giladchase wrote…
is this better than dtolnay/rust-toolchain?
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alon-dotan-starkware and @nadin-Starkware)
.github/actions/install_rust/action.yml
line 4 at r3 (raw file):
Previously, dorimedini-starkware wrote…
yes looks like dtonlay's is basic by design.
In particular, dtolnay refuses to support rust-toolchain.toml which might make it irrelevant for us.
However, maybe there might be a better way of doing this if dtolnay isn't supporting it, I couldn't find it.
Also note that we're switching from a 1K-star action to a 100 star one, but I have no better alternative 😅
.github/workflows/blockifier_compiled_cairo.yml
line 35 at r3 (raw file):
Previously, giladchase wrote…
Curious, what issues has this causes? how do we caching without it?
looks like setup-rust handles caching out of the box,
59239d8
to
9f3846e
Compare
Benchmark movements: |
0c115f3
to
4632a88
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.
Reviewable status: 12 of 16 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @giladchase, and @nadin-Starkware)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
pending python side PR success
https://reviewable.io/reviews/starkware-industries/starkware/35901
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.
Reviewed 8 of 11 files at r1, 1 of 2 files at r2, 3 of 3 files at r3, 4 of 4 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @giladchase, and @nadin-Starkware)
4632a88
to
aaef4e3
Compare
Benchmark movements: |
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.
Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
This change is