Skip to content

Instantly share code, notes, and snippets.

@chenyukang
Last active March 12, 2024 05:20
Show Gist options
  • Save chenyukang/1483cbbf75a4bd5ae2930415329cb682 to your computer and use it in GitHub Desktop.
Save chenyukang/1483cbbf75a4bd5ae2930415329cb682 to your computer and use it in GitHub Desktop.
rustc-justfile
alias ba := build-all
alias b := build
alias ts := test-one
alias l := log
alias d := dev
alias d21 := dev21
build-all:
x b
rb:
x clean; x b
rui:
x test tests/ui --bless
am:
git add tests compiler library
git commit --amend
tm:
x test tests/ui --only-modified --bless --keep-stage-std 1
sm:
x test --stage 2 ui-fulldeps --keep-stage 0 --keep-stage-std 0
reb N:
git rebase -i HEAD~{{N}}
err FILE N:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp rustc +dev2 {{FILE}} -Z treat-err-as-bug={{N}}
diag FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp rustc +dev2 {{FILE}} -Z track-diagnostics=y
cerr FILE N:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp RUST_BACKTRACE=1 rustc +dev2 {{FILE}} -Z treat-err-as-bug={{N}}
build:
x build library --keep-stage-std=1
test:
x test
test-one FILE:
x test `echo "{{FILE}}" | sed -E 's/(\.edition[0-9]*\.stderr$|.stderr$)/.rs/'` --bless --keep-stage-std 1
dev FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp RUST_BACKTRACE=1 rustc +dev2 {{FILE}} --edition 2021
dev21 FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp RUST_BACKTRACE=1 rustc +dev2 --edition 2018 {{FILE}}
cur FILE:
RUSTC_ICE=/tmp RUST_BACKTRACE=1 rustc --edition 2018 {{FILE}}
log FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp RUSTC_LOG=debug rustc +dev2 {{FILE}} -Z unstable-options > /tmp/r.log 2>&1; cat /tmp/r.log | grep anan
logp FILE PATTERN:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp RUSTC_LOG=debug rustc +dev2 {{FILE}} > /tmp/r.log 2>&1; cat /tmp/r.log | grep {{PATTERN}}
tree FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp rustc +dev2 {{FILE}} -Zunpretty=hir-tree --edition 2021 > /tmp/tree.log
ty-tree FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp rustc +dev2 {{FILE}} -Zunpretty=thir-tree > /tmp/ty-tree.log
ast FILE:
rustup toolchain link dev2 ./build/aarch64-apple-darwin/stage1/
RUSTC_ICE=/tmp rustc +dev2 {{FILE}} -Zunpretty=ast-tree > /tmp/ast.log
clean:
clean-binary ./* --do
old_branch := `git rev-parse --abbrev-ref HEAD`
rebm:
git stash
git checkout up-master
git pull
git submodule sync
git submodule update
git stash
git checkout {{old_branch}}
git rebase up-master
sync:
git stash
git checkout up-master
git pull
git submodule sync
git submodule update
pr:
gh pr view --web
npr:
gh pr create -w
gl:
git log --pretty=oneline -n 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment