Skip to content

dev: misc improvements #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
8 changes: 4 additions & 4 deletions .github/workflows/integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: "Integration Test"

# Run on every push (tag, branch) and pull_request
on: [pull_request, push, merge_group]
on: [ pull_request, push, merge_group ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -27,7 +27,7 @@ jobs:
# This channel is only required to invoke "nix-shell".
# Everything inside that nix-shell will use a pinned version of
# nixpkgs.
nix_path: nixpkgs=channel:nixos-23.05
nix_path: nixpkgs=channel:nixos-23.11
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Set up cargo cache
uses: actions/cache@v4
Expand All @@ -44,6 +44,6 @@ jobs:
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
# Have all the "copying into Nix store" messages in a dedicated step for
# better log visibility.
- run: cd integration-test && nix-shell --run "echo OK" && cd ..
- run: nix-shell --run "echo OK"
# Now, run the actual test.
- run: cd integration-test && nix-shell --run ./run.sh && cd ..
- run: nix-shell --run run-integrationtest
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: "Cargo workspace"

# Run on every push (tag, branch) and pull_request
on: [pull_request, push, workflow_dispatch, merge_group]
on: [ pull_request, push, workflow_dispatch, merge_group ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -20,7 +20,7 @@ jobs:
name: build (msrv)
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.69.0 # MSRV
rust-version: 1.70.0 # MSRV
do-style-check: false
features: builder

Expand All @@ -46,7 +46,7 @@ jobs:
needs: build_msrv
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.69.0 # MSRV
rust-version: 1.70.0 # MSRV
do-style-check: false
rust-target: thumbv7em-none-eabihf
features: builder
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
needs: build_msrv
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.69.0 # MSRV
rust-version: 1.70.0 # MSRV
do-style-check: true
do-test: false
features: builder
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ exclude = [
]

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

# This way, the "multiboot2" dependency in the multiboot2-header crate can be
# referenced by version, while still the repository version is used
Expand Down
74 changes: 49 additions & 25 deletions integration-test/bins/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions integration-test/bins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ members = [
codegen-units = 1
lto = true

[patch.crates-io]
multiboot2 = { path = "../../multiboot2" }

[workspace.dependencies]
anyhow = { version = "1.0", default-features = false }
log = { version = "0.4", default-features = false }
multiboot2 = { path = "../../multiboot2", features = ["builder", "unstable"] }
multiboot2-header = { path = "../../multiboot2-header", features = ["builder", "unstable"] }
good_memory_allocator = "0.1"
util = { path = "./util" }
16 changes: 8 additions & 8 deletions integration-test/bins/multiboot2_chainloader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "multiboot2_chainloader"
description = "Multiboot chainloader that loads a Multiboot2 payload"
description = "Integrationtest: Multiboot2 chainloader"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
util = { path = "../util" }
multiboot2 = { path = "../../../multiboot2" }
multiboot2-header = { path = "../../../multiboot2-header" }
anyhow = { version = "1.0", default-features = false }
elf_rs = "0.3"
log = { version = "0.4", default-features = false }
good_memory_allocator = "0.1"
anyhow.workspace = true
log.workspace = true
good_memory_allocator.workspace = true
multiboot = "0.8"
multiboot2.workspace = true
multiboot2-header.workspace = true
util.workspace = true
elf_rs = "0.3"
10 changes: 8 additions & 2 deletions integration-test/bins/multiboot2_chainloader/src/loader.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use core::ops::Deref;
use elf_rs::{ElfFile, ProgramHeaderEntry, ProgramType};
use multiboot2::{
BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag,
ModuleTag,
BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag, ModuleTag,
SmbiosTag,
};

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

log::info!(
Expand Down
12 changes: 6 additions & 6 deletions integration-test/bins/multiboot2_payload/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "multiboot2_payload"
description = "Multiboot2 integration test"
description = "Integrationtest: Multiboot2 payload"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
multiboot2 = { path = "../../../multiboot2", features = ["builder", "unstable"] }
util = { path = "../util" }
anyhow = { version = "1.0", default-features = false }
good_memory_allocator = "0.1"
log = { version = "0.4", default-features = false }
anyhow.workspace = true
log.workspace = true
good_memory_allocator.workspace = true
multiboot2.workspace = true
util.workspace = true
x86 = "0.52"
2 changes: 1 addition & 1 deletion integration-test/bins/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-03-31" # rustc 1.79-nightly
channel = "nightly-2024-04-30" # rustc 1.80-nightly
profile = "default"
components = [
"rust-src",
Expand Down
3 changes: 2 additions & 1 deletion integration-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function fn_main() {

function fn_build_rust_bins() {
cd "bins"
cargo build --release
cargo --version
cargo build --release --verbose
cd "$DIR"
}

Expand Down
Loading