Skip to content

Commit

Permalink
feat: 📌 update MSRV policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisu-Woniu committed Jun 22, 2024
1 parent b1127df commit 5f0af08
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Setup Rust toolchain
uses: moonrepo/setup-rust@v1
with:
channel: "1.74"
channel: "1.77"
components: rust-src
bins: cargo-hack
env:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/NJUPT-SAST/rsjudge"

# clap requires Rust 1.74+ to work
rust-version = "1.74"
# MSRV is set to N - 2, where N is the current stable version.
rust-version = "1.77"

[workspace.dependencies]
log = "0.4.21"
Expand Down
19 changes: 18 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ An online judge sandbox server in Rust, inspired by https://github.com/criyle/go
* Highly extensible with plugins.
* Blazingly fast and secured with Rust🦀.

== Pronunciation and spelling

The name "rsjudge" is a combination of "Rust" and "judge". It is pronounced as "R-S-judge". The word should be written in lowercase, with no space in between, even in the title or at the beginning of a sentence.

== Repository structure

`src/`::
Expand Down Expand Up @@ -49,14 +53,27 @@ https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=NJUPT-SAST%2Frsjudge[

=== Prerequisites

* Rust 1.74 or later,
* Rust toolchain according to <<msrv, MSRV>>.
* Linux kernel >= 4.5,
** Required for Seccomp BPF support.
* For gRPC support (under `grpc` feature):
** https://github.com/protocolbuffers/protobuf?tab=readme-ov-file#protobuf-compiler-installation[`protoc`] >= 3.15,
** https://github.com/bufbuild/buf/[`buf`] for gRPC dependencies management.
* For `.deb` package generation, a Debian/Ubuntu system with `dpkg-dev` and `liblzma-dev` installed.

[#msrv]
==== MSRV (Minimum Supported Rust Version)

rsjudge uses the MSRV policy of N - 2, where N is the current stable version of Rust. For example, if the current stable version is 1.79, then the MSRV will be set to 1.77.

The current MSRV can be found in the `rust-version` field in link:Cargo.toml[]. We will not support any Rust version older than the MSRV after we update it. They may still work, or fail to compile or execute rsjudge correctly.

[NOTE]
.To maintainers:
====
When MSRV is updated, be sure to update the link:.github/workflows/building.yml[building workflow] at the same time.
====

=== Install dependencies

You can install Rust toolchain with `rustup`:
Expand Down
13 changes: 12 additions & 1 deletion README.zh-CN.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ xref:README.adoc[English]
* 支持使用插件进行扩展。
* 使用 Rust🦀编写,速度极快,安全性高。

== 发音和拼写

"rsjudge" 是 "Rust" 和 "judge" 的组合,发音为 "R-S-judge"。单词应该以小写字母书写,单词中间无空格,即使在标题或句子开头也是如此。

== 目录结构

`src/`::
Expand Down Expand Up @@ -51,14 +55,21 @@ https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=NJUPT-SAST%2Frsjudge[

=== 先决条件

* Rust 1.74 或更高版本
* 符合 <<msrv, MSRV>> 的 Rust 工具链
* Linux 内核 >= 4.5
** 这是为了支持 Seccomp BPF。
* 对于 gRPC 支持(在 `grpc` 特性下)
** https://github.com/protocolbuffers/protobuf?tab=readme-ov-file#protobuf-compiler-installation[`protoc`] >= 3.15,
** https://github.com/bufbuild/buf/[`buf`] 用于 gRPC 依赖管理。
* 对于 `.deb` 包的生成,需要安装了 `dpkg-dev` 和 `liblzma-dev` 的 Debian/Ubuntu 系统。

[#msrv]
==== MSRV(最低支持的 Rust 版本)

rsjudge 采取 N - 2 的 MSRV 策略,其中 N 是当前的 Rust 稳定版本。例如,如果当前的 Rust 稳定版本是 1.79,则 MSRV 将会被设置为 1.77。

当前的 MSRV 可以从 link:Cargo.toml[] 中的 `rust-version` 字段中找到。在更新 MSRV 后,我们将不再支持任何比其更旧的 Rust 版本。这些版本可能仍然可以工作,或者无法正确编译或运行 rsjudge。

=== 安装额外的依赖

==== Debian/Ubuntu
Expand Down

0 comments on commit 5f0af08

Please sign in to comment.