Skip to content

Commit 1c693d1

Browse files
authored
Merge pull request #213 from rust-osdev/dev
dev: misc improvements
2 parents 3df6cd4 + 8149f3f commit 1c693d1

File tree

26 files changed

+169
-102
lines changed

26 files changed

+169
-102
lines changed
File renamed without changes.

.github/workflows/integrationtest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name: "Integration Test"
1010

1111
# Run on every push (tag, branch) and pull_request
12-
on: [pull_request, push, merge_group]
12+
on: [ pull_request, push, merge_group ]
1313

1414
env:
1515
CARGO_TERM_COLOR: always
@@ -27,7 +27,7 @@ jobs:
2727
# This channel is only required to invoke "nix-shell".
2828
# Everything inside that nix-shell will use a pinned version of
2929
# nixpkgs.
30-
nix_path: nixpkgs=channel:nixos-23.05
30+
nix_path: nixpkgs=channel:nixos-23.11
3131
- uses: DeterminateSystems/magic-nix-cache-action@main
3232
- name: Set up cargo cache
3333
uses: actions/cache@v4
@@ -44,6 +44,6 @@ jobs:
4444
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
4545
# Have all the "copying into Nix store" messages in a dedicated step for
4646
# better log visibility.
47-
- run: cd integration-test && nix-shell --run "echo OK" && cd ..
47+
- run: nix-shell --run "echo OK"
4848
# Now, run the actual test.
49-
- run: cd integration-test && nix-shell --run ./run.sh && cd ..
49+
- run: nix-shell --run run-integrationtest

.github/workflows/rust.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name: "Cargo workspace"
1010

1111
# Run on every push (tag, branch) and pull_request
12-
on: [pull_request, push, workflow_dispatch, merge_group]
12+
on: [ pull_request, push, workflow_dispatch, merge_group ]
1313

1414
env:
1515
CARGO_TERM_COLOR: always
@@ -20,7 +20,7 @@ jobs:
2020
name: build (msrv)
2121
uses: ./.github/workflows/_build-rust.yml
2222
with:
23-
rust-version: 1.69.0 # MSRV
23+
rust-version: 1.70.0 # MSRV
2424
do-style-check: false
2525
features: builder
2626

@@ -46,7 +46,7 @@ jobs:
4646
needs: build_msrv
4747
uses: ./.github/workflows/_build-rust.yml
4848
with:
49-
rust-version: 1.69.0 # MSRV
49+
rust-version: 1.70.0 # MSRV
5050
do-style-check: false
5151
rust-target: thumbv7em-none-eabihf
5252
features: builder
@@ -103,7 +103,7 @@ jobs:
103103
needs: build_msrv
104104
uses: ./.github/workflows/_build-rust.yml
105105
with:
106-
rust-version: 1.69.0 # MSRV
106+
rust-version: 1.70.0 # MSRV
107107
do-style-check: true
108108
do-test: false
109109
features: builder

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ exclude = [
99
]
1010

1111
[workspace.dependencies]
12-
bitflags = "2"
13-
derive_more = { version = "0.99", default-features = false, features = ["display"] }
14-
log = { version = "0.4", default-features = false }
12+
bitflags = "2.0.2"
13+
derive_more = { version = "~0.99", default-features = false, features = ["display"] }
14+
log = { version = "~0.4", default-features = false }
1515

1616
# This way, the "multiboot2" dependency in the multiboot2-header crate can be
1717
# referenced by version, while still the repository version is used

integration-test/bins/Cargo.lock

Lines changed: 49 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration-test/bins/Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ members = [
1010
codegen-units = 1
1111
lto = true
1212

13-
[patch.crates-io]
14-
multiboot2 = { path = "../../multiboot2" }
13+
14+
[workspace.dependencies]
15+
anyhow = { version = "1.0", default-features = false }
16+
log = { version = "0.4", default-features = false }
17+
multiboot2 = { path = "../../multiboot2", features = ["builder", "unstable"] }
18+
multiboot2-header = { path = "../../multiboot2-header", features = ["builder", "unstable"] }
19+
good_memory_allocator = "0.1"
20+
util = { path = "./util" }
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[package]
22
name = "multiboot2_chainloader"
3-
description = "Multiboot chainloader that loads a Multiboot2 payload"
3+
description = "Integrationtest: Multiboot2 chainloader"
44
version = "0.1.0"
55
edition = "2021"
66
publish = false
77

88
[dependencies]
9-
util = { path = "../util" }
10-
multiboot2 = { path = "../../../multiboot2" }
11-
multiboot2-header = { path = "../../../multiboot2-header" }
12-
anyhow = { version = "1.0", default-features = false }
13-
elf_rs = "0.3"
14-
log = { version = "0.4", default-features = false }
15-
good_memory_allocator = "0.1"
9+
anyhow.workspace = true
10+
log.workspace = true
11+
good_memory_allocator.workspace = true
1612
multiboot = "0.8"
13+
multiboot2.workspace = true
14+
multiboot2-header.workspace = true
15+
util.workspace = true
16+
elf_rs = "0.3"

integration-test/bins/multiboot2_chainloader/src/loader.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
use core::ops::Deref;
12
use elf_rs::{ElfFile, ProgramHeaderEntry, ProgramType};
23
use multiboot2::{
3-
BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag,
4-
ModuleTag,
4+
BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag, ModuleTag,
5+
SmbiosTag,
56
};
67

78
/// Loads the first module into memory. Assumes that the module is a ELF file.
@@ -56,6 +57,11 @@ pub fn load_module(mut modules: multiboot::information::ModuleIter) -> ! {
5657
elf_mod.end as u32,
5758
elf_mod.string.unwrap(),
5859
))
60+
// Test that we can add SmbiosTag multiple times.
61+
.add_tag(SmbiosTag::new(1, 1, &[1, 2, 3]).deref())
62+
.unwrap()
63+
.add_tag(SmbiosTag::new(1, 2, &[1, 2, 3]).deref())
64+
.expect("should allow tag multiple times")
5965
.build();
6066

6167
log::info!(
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "multiboot2_payload"
3-
description = "Multiboot2 integration test"
3+
description = "Integrationtest: Multiboot2 payload"
44
version = "0.1.0"
55
edition = "2021"
66
publish = false
77

88
[dependencies]
9-
multiboot2 = { path = "../../../multiboot2", features = ["builder", "unstable"] }
10-
util = { path = "../util" }
11-
anyhow = { version = "1.0", default-features = false }
12-
good_memory_allocator = "0.1"
13-
log = { version = "0.4", default-features = false }
9+
anyhow.workspace = true
10+
log.workspace = true
11+
good_memory_allocator.workspace = true
12+
multiboot2.workspace = true
13+
util.workspace = true
1414
x86 = "0.52"

integration-test/bins/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "nightly-2024-03-31" # rustc 1.79-nightly
2+
channel = "nightly-2024-04-30" # rustc 1.80-nightly
33
profile = "default"
44
components = [
55
"rust-src",

integration-test/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function fn_main() {
1515

1616
function fn_build_rust_bins() {
1717
cd "bins"
18-
cargo build --release
18+
cargo --version
19+
cargo build --release --verbose
1920
cd "$DIR"
2021
}
2122

0 commit comments

Comments
 (0)