Skip to content

Commit e953167

Browse files
committed
Merge branch 'main' into tr-translation-of-day-1-afternoon
2 parents d44b48f + 010b443 commit e953167

File tree

304 files changed

+14167
-12723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+14167
-12723
lines changed

.cargo/config.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[alias]
2+
# We use this alias for task automation in the project.
3+
# See README in xtask directory.
4+
xtask = "run --package xtask --"
5+
6+
[env]
7+
# To provide an anchor to the root of the workspace when working with paths.
8+
# See https://github.com/rust-lang/cargo/issues/3946#issuecomment-973132993
9+
CARGO_WORKSPACE_DIR = { value = "", relative = true }

.github/CODEOWNERS

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,26 @@ po/it.po @detro @nicomazz
1111
po/ja.po @keiichiw @chikoski @kantasv @HidenoriKobayashi
1212
po/ko.po @jiyongp @jooyunghan @namhyung
1313
po/pl.po @jkotur @dyeroshenko
14-
po/pt-BR.po @rastringer @hugojacob @henrif75 @joaovicmendes @jcvicelli @azevedoalice
14+
po/pt-BR.po @rastringer @hugojacob @henrif75 @joaovicmendes @azevedoalice
1515
po/ro.po @AlexandraImbrisca @razvanm
1616
po/ru.po @istolga @baltuky @zvonden @dyeroshenko
1717
po/tr.po @alerque
1818
po/uk.po @dyeroshenko
1919
po/vi.po @daivinhtran @qu-ngx
2020
po/zh-CN.po @wnghl @anlunx @kongy @noahdragon @superwhd @emmali01 @candysonya @AgainstEntropy
21-
po/zh-TW.po @edong @hueich @kuanhungchen @victorhsieh @mingyc @johnathan79717
21+
po/zh-TW.po @edong @hueich @kuanhungchen @victorhsieh @mingyc
22+
23+
# Dependency changes (mostly dependabot PRs)
24+
Cargo.toml @djmitche @mgeisler @qwandor
25+
Cargo.lock @djmitche @mgeisler @qwandor
26+
src/bare-metal/alloc-example/Cargo.toml @djmitche @mgeisler @qwandor
27+
src/bare-metal/alloc-example/Cargo.lock @djmitche @mgeisler @qwandor
28+
src/bare-metal/aps/examples/Cargo.toml @djmitche @mgeisler @qwandor
29+
src/bare-metal/aps/examples/Cargo.lock @djmitche @mgeisler @qwandor
30+
src/bare-metal/microcontrollers/examples/Cargo.toml @djmitche @mgeisler @qwandor
31+
src/bare-metal/microcontrollers/examples/Cargo.lock @djmitche @mgeisler @qwandor
32+
src/exercises/bare-metal/compass/Cargo.toml @djmitche @mgeisler @qwandor
33+
src/exercises/bare-metal/compass/Cargo.lock @djmitche @mgeisler @qwandor
34+
src/exercises/bare-metal/rtc/Cargo.toml @djmitche @mgeisler @qwandor
35+
src/exercises/bare-metal/rtc/Cargo.lock @djmitche @mgeisler @qwandor
36+
.github/workflows @djmitche @mgeisler @qwandor

.github/dependabot.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ updates:
77
directory: /
88
schedule:
99
interval: monthly
10-
reviewers:
11-
- djmitche
12-
- mgeisler
13-
- qwandor
1410
commit-message:
1511
prefix: cargo
1612
groups:
@@ -24,10 +20,6 @@ updates:
2420
directory: /src/bare-metal/alloc-example/
2521
schedule:
2622
interval: monthly
27-
reviewers:
28-
- djmitche
29-
- mgeisler
30-
- qwandor
3123
commit-message:
3224
prefix: cargo
3325
groups:
@@ -41,10 +33,6 @@ updates:
4133
directory: /src/bare-metal/aps/examples/
4234
schedule:
4335
interval: monthly
44-
reviewers:
45-
- djmitche
46-
- mgeisler
47-
- qwandor
4836
commit-message:
4937
prefix: cargo
5038
groups:
@@ -58,10 +46,6 @@ updates:
5846
directory: /src/bare-metal/microcontrollers/examples/
5947
schedule:
6048
interval: monthly
61-
reviewers:
62-
- djmitche
63-
- mgeisler
64-
- qwandor
6549
commit-message:
6650
prefix: cargo
6751
groups:
@@ -75,10 +59,6 @@ updates:
7559
directory: /src/exercises/bare-metal/compass/
7660
schedule:
7761
interval: monthly
78-
reviewers:
79-
- djmitche
80-
- mgeisler
81-
- qwandor
8262
commit-message:
8363
prefix: cargo
8464
groups:
@@ -92,10 +72,6 @@ updates:
9272
directory: /src/exercises/bare-metal/rtc/
9373
schedule:
9474
interval: monthly
95-
reviewers:
96-
- djmitche
97-
- mgeisler
98-
- qwandor
9975
commit-message:
10076
prefix: cargo
10177
groups:
@@ -109,7 +85,3 @@ updates:
10985
directory: /
11086
schedule:
11187
interval: monthly
112-
reviewers:
113-
- djmitche
114-
- mgeisler
115-
- qwandor

.github/workflows/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ set -Eeuo pipefail
99
#
1010
# The src/ and third_party/ directories are left in a dirty state so
1111
# you can run `mdbook test` and other commands afterwards.
12+
#
13+
# See also TRANSLATIONS.md.
1214

1315
book_lang=${1:?"Usage: $0 <book-lang> <dest-dir>"}
1416
dest_dir=${2:?"Usage: $0 <book-lang> <dest-dir>"}
@@ -23,7 +25,7 @@ else
2325
# Back-date the sources to POT-Creation-Date. The content lives in two
2426
# directories:
2527
rm -r src/ third_party/
26-
git restore --source "$(git rev-list -n 1 --before "$pot_creation_date" @)" src/ third_party/
28+
git restore --source "$(git rev-list -n 1 --before "$pot_creation_date" @)" src/ third_party/ book.toml
2729
# Set language and adjust site URL. Clear the redirects since they are
2830
# in sync with the source files, not the translation.
2931
export MDBOOK_BOOK__LANGUAGE=$book_lang

.github/workflows/build.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
rustup component add rustfmt
2929
3030
- name: Check formatting
31-
uses: dprint/check@v2.2
31+
uses: dprint/check@v2.3
3232

3333
typos:
3434
runs-on: ubuntu-latest
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/checkout@v4
3838

3939
- name: Check for typos
40-
uses: crate-ci/typos@v1.28.1
40+
uses: crate-ci/typos@v1.34.0
4141
with:
4242
config: ./.github/typos.toml
4343

@@ -161,10 +161,6 @@ jobs:
161161
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' mdbook build -d po
162162
msgfmt -o /dev/null --statistics po/messages.pot
163163
164-
- name: Install mdbook-linkcheck
165-
if: contains(fromJSON(env.LINK_CHECKED_LANGUAGES), matrix.language)
166-
run: cargo install mdbook-linkcheck --locked --version 0.7.7
167-
168164
- name: Build ${{ matrix.language }} translation
169165
run: |
170166
.github/workflows/build.sh ${{ matrix.language }} book/comprehensive-rust-${{ matrix.language }}
@@ -182,14 +178,21 @@ jobs:
182178
run: mdbook test
183179

184180
- name: Setup Node
181+
if: matrix.language == 'en'
185182
uses: actions/setup-node@v4
186183
with:
187-
node-version: 18
184+
node-version: 22
185+
cache: "npm"
186+
cache-dependency-path: "tests/package-lock.json"
188187
- name: Install test framework
188+
if: matrix.language == 'en'
189189
run: npm install
190190
working-directory: ./tests
191191
- name: Test Javascript
192-
run: npm test
192+
if: matrix.language == 'en'
193+
run: |
194+
./src/slides/create-slide.list.sh
195+
npm test
193196
env:
194197
TEST_BOOK_DIR: ../book/comprehensive-rust-${{ matrix.language }}/html
195198
working-directory: ./tests
@@ -203,6 +206,9 @@ jobs:
203206
with:
204207
fetch-depth: 0
205208

209+
- name: Update Rust
210+
run: rustup update
211+
206212
- name: Setup Rust cache
207213
uses: ./.github/workflows/setup-rust-cache
208214

.github/workflows/install-mdbook/action.yml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,14 @@ description: Install mdbook with the dependencies we need.
55
runs:
66
using: composite
77
steps:
8-
# The --locked flag is important for reproducible builds. It also
9-
# avoids breakage due to skews between mdbook and mdbook-svgbob.
108
- name: Install mdbook
11-
run: cargo install mdbook --locked --version 0.4.37
9+
run: cargo xtask install-tools
1210
shell: bash
1311

14-
- name: Install mdbook-svgbob
15-
run: cargo install mdbook-svgbob --locked --version 0.2.1
16-
shell: bash
17-
18-
- name: Install mdbook-pandoc and related dependencies
12+
- name: Install dependencies for mdbook-pandoc
1913
run: |
20-
cargo install mdbook-pandoc --locked --version 0.7.0
2114
sudo apt-get update
22-
sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk librsvg2-bin fonts-noto
23-
curl -LsSf https://github.com/jgm/pandoc/releases/download/3.2.1/pandoc-3.2.1-linux-amd64.tar.gz | tar zxf -
24-
echo "$PWD/pandoc-3.2.1/bin" >> $GITHUB_PATH
25-
shell: bash
26-
27-
- name: Install mdbook-i18n-helpers
28-
run: cargo install mdbook-i18n-helpers --locked --version 0.3.3
29-
shell: bash
30-
31-
- name: Install i18n-report
32-
run: cargo install i18n-report --locked --version 0.2.0
33-
shell: bash
34-
35-
- name: Install mdbook-exerciser
36-
run: cargo install --path mdbook-exerciser --locked
37-
shell: bash
38-
39-
- name: Install mdbook-course
40-
run: cargo install --path mdbook-course --locked
15+
sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto
16+
curl -LsSf https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-linux-amd64.tar.gz | tar zxf -
17+
echo "$PWD/pandoc-3.7.0.1/bin" >> $GITHUB_PATH
4118
shell: bash

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Publish
22

3+
# See also TRANSLATIONS.md.
4+
35
on:
46
push:
57
branches:
@@ -33,6 +35,9 @@ jobs:
3335
with:
3436
fetch-depth: 0 # We need the full history for build.sh below.
3537

38+
- name: Update Rust
39+
run: rustup update
40+
3641
- name: Setup Rust cache
3742
uses: ./.github/workflows/setup-rust-cache
3843

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ crowdin.yml
3131

3232
# Python virtualenv (for mdbook-slide-evaluator local installation)
3333
.venv/
34+
35+
# tests/ framework artifacts
36+
tests/src/slide/slides/slides.list.ts

CONTRIBUTING.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ the [instructions in the README].
88

99
[instructions in the README]: README.md#building
1010

11+
## Writing Exercises
12+
13+
Each segment ends with an exercise. Exercises are typically structured as an
14+
`exercise.rs` containing the problem and solution. This is referenced from
15+
`exercise.md` and `solution.md`, using `{{#include exercise.rs:anchor_name}}` to
16+
match ANCHOR comments in the `exercise.rs` file. Each segment also has a
17+
`Cargo.toml` file containing a `[[bin]]` or `[lib]` section referring to
18+
`exercise.rs`, and that Cargo package is referenced from the workspace the root
19+
`Cargo.toml`. The result is that `exercise.rs` is built and tested by
20+
`cargo test`.
21+
22+
For segments on day 1, exercises should use `fn main() { .. }` and `dbg!` or
23+
`println!`, with students visually verifying the correct output. On subsequent
24+
days, prefer tests and omit `fn main() { .. }`. However, where tests would be
25+
difficult and visual verification is more natural (such as in the Logger
26+
exercise), using `fn main { .. }` is OK.
27+
28+
Especially for exercises without tests, consider including tests in
29+
`exercise.rs` that do not appear in either `exercise.md` or `solution.md`, as
30+
these can ensure the solution is correct.
31+
1132
## Testing
1233

1334
We test the course material in several ways:
@@ -38,10 +59,12 @@ Install `dprint` using their
3859
[installation instructions](https://dprint.dev/install/) and install `rustfmt`
3960
via `rustup`.
4061

62+
Install [pandoc 3.7.0.1](https://github.com/jgm/pandoc/releases/tag/3.7.0.1).
63+
4164
On Debian, you can install the other tools using:
4265

4366
```sh
44-
sudo apt install yapf3 gettext
67+
sudo apt install yapf3 gettext texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto
4568
```
4669

4770
### MacOS

0 commit comments

Comments
 (0)