Skip to content

Commit f53cbec

Browse files
authored
Merge pull request #486 from rust-osdev/master
merge master into next
2 parents 9afa8e9 + 5aff621 commit f53cbec

33 files changed

+566
-248
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
permissions:
1414
contents: read
1515

16+
env:
17+
RUSTFLAGS: -Dwarnings
18+
RUSTDOCFLAGS: -Dwarnings
19+
1620
jobs:
1721
stable:
1822
name: "Test MSRV and Stable Features"
@@ -24,100 +28,45 @@ jobs:
2428
runs-on: ubuntu-latest
2529
steps:
2630
- uses: actions/checkout@v4
27-
- uses: actions-rs/toolchain@v1
31+
- uses: dtolnay/rust-toolchain@master
2832
with:
29-
profile: minimal
3033
toolchain: ${{ matrix.rust }}
31-
override: true
32-
- name: Run cargo build for stable
33-
uses: actions-rs/cargo@v1
34-
with:
35-
command: build
36-
args: --no-default-features --features instructions
37-
- name: Run cargo build for stable without instructions
38-
uses: actions-rs/cargo@v1
39-
with:
40-
command: build
41-
args: --no-default-features
42-
- name: Run cargo doc for stable
43-
uses: actions-rs/cargo@v1
44-
with:
45-
command: doc
46-
args: --no-default-features --features instructions
47-
- name: Run cargo doc for stable without instructions
48-
uses: actions-rs/cargo@v1
49-
with:
50-
command: doc
51-
args: --no-default-features
52-
- name: Run cargo test for stable
53-
uses: actions-rs/cargo@v1
54-
with:
55-
command: test
56-
args: --no-default-features --features instructions
57-
- name: Run cargo test for stable without instructions
58-
uses: actions-rs/cargo@v1
59-
with:
60-
command: test
61-
args: --no-default-features
34+
- run: cargo build --no-default-features --features instructions
35+
- run: cargo build --no-default-features
36+
- run: cargo doc --no-default-features --features instructions
37+
- run: cargo doc --no-default-features
38+
- run: cargo test --no-default-features --features instructions
39+
- run: cargo test --no-default-features
6240

6341
test:
6442
name: "Test"
6543

6644
strategy:
6745
fail-fast: false
6846
matrix:
69-
platform: [ubuntu-latest, macos-latest, windows-latest]
47+
platform: [ubuntu-latest, macos-12, macos-latest, windows-latest]
7048

7149
runs-on: ${{ matrix.platform }}
7250
timeout-minutes: 15
7351

7452
steps:
7553
- uses: actions/checkout@v4
76-
- uses: actions-rs/toolchain@v1
54+
- uses: dtolnay/rust-toolchain@nightly
7755
with:
78-
profile: minimal
79-
toolchain: nightly
80-
override: true
81-
target: x86_64-unknown-linux-musl
82-
83-
- name: "Print Rust Version"
84-
run: |
85-
rustc -Vv
86-
cargo -Vv
56+
targets: x86_64-unknown-linux-musl, i686-unknown-linux-gnu, thumbv7em-none-eabihf
8757

88-
- name: "Run cargo build"
89-
uses: actions-rs/cargo@v1
90-
with:
91-
command: build
58+
- run: cargo build
9259

93-
- name: "Run cargo doc"
94-
uses: actions-rs/cargo@v1
95-
with:
96-
command: doc
60+
- run: cargo doc
9761

98-
- name: "Run cargo build on musl"
99-
uses: actions-rs/cargo@v1
100-
with:
101-
command: build
102-
args: --target x86_64-unknown-linux-musl
62+
- run: cargo build --target x86_64-unknown-linux-musl
10363
if: runner.os == 'Linux'
10464

105-
- name: "Run cargo test"
106-
uses: actions-rs/cargo@v1
107-
with:
108-
command: test
65+
- run: cargo test
10966

110-
- name: "Run cargo test on musl"
111-
uses: actions-rs/cargo@v1
112-
with:
113-
command: test
114-
args: --target x86_64-unknown-linux-musl
67+
- run: cargo test --target x86_64-unknown-linux-musl
11568
if: runner.os == 'Linux'
11669

117-
- name: "Install Rustup Targets"
118-
run: |
119-
rustup target add i686-unknown-linux-gnu
120-
rustup target add thumbv7em-none-eabihf
12170
- name: "Build on non x86_64 platforms"
12271
run: |
12372
cargo build --target i686-unknown-linux-gnu --no-default-features --features nightly
@@ -134,6 +83,9 @@ jobs:
13483
runs-on: ${{ matrix.platform }}
13584
timeout-minutes: 15
13685

86+
env:
87+
RUSTFLAGS: -Crelocation-model=static -Dwarnings
88+
13789
steps:
13890
- name: "Checkout Repository"
13991
uses: actions/checkout@v4
@@ -148,15 +100,10 @@ jobs:
148100
run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH
149101
shell: bash
150102

151-
- name: "Install Rustup Components"
152-
uses: actions-rs/toolchain@v1
103+
- uses: dtolnay/rust-toolchain@nightly
153104
with:
154-
toolchain: nightly
155-
override: true
156-
profile: minimal
157-
components: rust-src, llvm-tools-preview
158-
- name: "Install cargo-xbuild"
159-
run: cargo install cargo-xbuild --debug --root binaries
105+
targets: x86_64-unknown-none
106+
components: rust-src, llvm-tools
160107
- name: "Install bootimage"
161108
run: cargo install bootimage --debug --root binaries
162109

@@ -184,7 +131,7 @@ jobs:
184131
run: qemu-system-x86_64 --version
185132

186133
- name: "Run Test Framework"
187-
run: cargo xtest
134+
run: cargo test
188135
shell: bash
189136
working-directory: "testing"
190137

@@ -194,32 +141,21 @@ jobs:
194141
timeout-minutes: 2
195142
steps:
196143
- uses: actions/checkout@v4
197-
- uses: actions-rs/toolchain@v1
144+
- uses: dtolnay/rust-toolchain@nightly
198145
with:
199-
toolchain: nightly
200-
override: true
201-
profile: minimal
202146
components: rustfmt
203-
- uses: actions-rs/cargo@v1
204-
with:
205-
command: fmt
206-
args: --all -- --check
147+
- run: cargo fmt --all -- --check
207148

208149
clippy:
209150
name: "Clippy"
210151
runs-on: ubuntu-latest
211152
timeout-minutes: 10
212153
steps:
213154
- uses: actions/checkout@v4
214-
- uses: actions-rs/toolchain@v1
155+
- uses: dtolnay/rust-toolchain@nightly
215156
with:
216-
toolchain: nightly
217-
override: true
218-
profile: minimal
219157
components: clippy
220-
- uses: actions-rs/cargo@v1
221-
with:
222-
command: clippy
158+
- run: cargo clippy
223159

224160
semver-checks:
225161
name: Semver Checks
@@ -233,3 +169,13 @@ jobs:
233169
- run: cargo install cargo-semver-checks --locked
234170
- name: Check semver
235171
run: cargo +stable semver-checks check-release
172+
173+
kani:
174+
runs-on: ubuntu-20.04
175+
steps:
176+
- uses: actions/checkout@v4
177+
- uses: Swatinem/rust-cache@v2
178+
with:
179+
shared-key: "kani"
180+
cache-targets: false
181+
- uses: model-checking/kani-github-action@v1.1

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ license = "MIT/Apache-2.0"
1515
name = "x86_64"
1616
readme = "README.md"
1717
repository = "https://github.com/rust-osdev/x86_64"
18-
version = "0.15.0-beta"
18+
version = "0.15.1"
1919
edition = "2018"
2020
rust-version = "1.59" # Needed to support inline asm and default const generics
2121

@@ -47,3 +47,6 @@ pre-release-commit-message = "Bump version to {{version}}"
4747
push = false
4848
publish = false
4949
tag = false
50+
51+
[lints.rust]
52+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }

Changelog.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Unreleased
22

3-
# 0.15.0-beta – 2024-02-08
3+
# 0.15.1 – 2024-03-19
4+
5+
## New Features
6+
7+
- [add constructor for `InterruptStackFrameValue`](https://github.com/rust-osdev/x86_64/pull/467)
8+
- [add `Cr3::write_pcid_no_flush`](https://github.com/rust-osdev/x86_64/pull/472)
9+
10+
## Fixes
11+
12+
- [properly jump the address gap in CleanUp](https://github.com/rust-osdev/x86_64/pull/469)
13+
14+
## Other Improvements
15+
16+
- [added help on update_flags to get flags](https://github.com/rust-osdev/x86_64/pull/465)
17+
- [expose DEBUG_STR more directly](https://github.com/rust-osdev/x86_64/pull/471)
18+
19+
# 0.15.0 – 2024-03-04
420

521
## Breaking changes
622

@@ -26,16 +42,36 @@
2642

2743
## New Features
2844

29-
- [Add `HandlerFuncType` trait](https://github.com/rust-osdev/x86_64/pull/439)
45+
- [implement `Step` for `PageTableIndex`](https://github.com/rust-osdev/x86_64/pull/464)
3046

3147
## Fixes
3248

3349
- [fix typo in docs](https://github.com/rust-osdev/x86_64/pull/265)
3450
- [activate `feature(asm_const)`](https://github.com/rust-osdev/x86_64/pull/320)
3551
- [gdt: Check that MAX is in range](https://github.com/rust-osdev/x86_64/pull/365)
36-
- [fix `Page::from_page_table_indices`](https://github.com/rust-osdev/x86_64/pull/398)
3752

38-
# 0.14.11 – 2023-09-15
53+
## Other Improvements
54+
55+
- [allow inlining Step methods](https://github.com/rust-osdev/x86_64/pull/464)
56+
- [constify more `Page` and `PageTableIndex` functions](https://github.com/rust-osdev/x86_64/pull/464)
57+
58+
# 0.14.12 – 2023-02-09
59+
60+
## New Features
61+
62+
- [Add `HandlerFuncType` trait](https://github.com/rust-osdev/x86_64/pull/439)
63+
- [Support `VirtAddr::from_ptr` for `T: ?Sized`](https://github.com/rust-osdev/x86_64/pull/442)
64+
- [Expose `Cr3::write_raw`](https://github.com/rust-osdev/x86_64/pull/445)
65+
66+
## Fixes
67+
68+
- [Use synchronizing assembly for `interrupts::enable`/`disable`](https://github.com/rust-osdev/x86_64/pull/440)
69+
70+
## Other Improvements
71+
72+
- [Optimize `Page::from_page_table_indices`](https://github.com/rust-osdev/x86_64/pull/456)
73+
74+
# 0.14.11 – 2022-09-15
3975

4076
## New Features
4177

rust-toolchain

Lines changed: 0 additions & 1 deletion
This file was deleted.

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "nightly"

scripts/ci-release.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import json
22
import subprocess
33
import tomllib
4-
from urllib.request import urlopen
4+
import urllib.request
55

66
with open("Cargo.toml", "rb") as f:
77
cargo_toml = tomllib.load(f)
88
crate_version = cargo_toml["package"]["version"]
99
print("Detected crate version " + crate_version)
1010

11-
api_url = "https://crates.io/api/v1/crates/x86_64/" + crate_version
12-
version_data = json.loads(urlopen(api_url).read())
13-
14-
if "version" in version_data:
15-
version = version_data["version"]
16-
assert (version["crate"] == "x86_64")
17-
assert (version["num"] == crate_version)
18-
print("Version " + crate_version + " already exists on crates.io")
19-
11+
index_url = "https://index.crates.io/x8/6_/x86_64"
12+
for line in urllib.request.urlopen(index_url):
13+
version_info = json.loads(line)
14+
assert (version_info["name"] == "x86_64")
15+
if version_info["vers"] == crate_version:
16+
print("Version " + crate_version + " already exists on crates.io")
17+
break
2018
else:
2119
print("Could not find version " + crate_version +
2220
" on crates.io; creating a new release")

0 commit comments

Comments
 (0)