diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 30e0d710..9ab178d5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,14 +8,6 @@ updates: ignore: - dependency-name: "*" update-types: [ "version-update:semver-patch" ] - - package-ecosystem: cargo - directory: "/integration-test/bins" - schedule: - interval: monthly - open-pull-requests-limit: 10 - ignore: - - dependency-name: "*" - update-types: [ "version-update:semver-patch" ] - package-ecosystem: github-actions directory: "/" schedule: diff --git a/Cargo.lock b/Cargo.lock index cd96a157..f494613b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,18 +2,83 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + [[package]] name = "bitflags" version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elf_rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894d710b6b07dae25ce69f9227ec2ffa3a3f71dc7f071acea3e1928ab4aeafdf" +dependencies = [ + "bitflags", + "num-traits", +] + +[[package]] +name = "good_memory_allocator" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1651659e016ea4259760966432aebcc96c81e26743fb018c59585ddd677127e" +dependencies = [ + "either", + "spin", +] + +[[package]] +name = "integration-test-util" +version = "0.1.0" +dependencies = [ + "good_memory_allocator", + "log", + "qemu-exit", +] + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + [[package]] name = "log" version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +[[package]] +name = "multiboot" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87ad3b7b7bcf5da525c22221e3eb3a020cd68b2d55ae62f629c15e8bc3bd56e" +dependencies = [ + "paste", +] + [[package]] name = "multiboot2" version = "0.24.0" @@ -38,13 +103,50 @@ dependencies = [ name = "multiboot2-header" version = "0.7.0" dependencies = [ - "log", "multiboot2", "multiboot2-common", "ptr_meta", "thiserror", ] +[[package]] +name = "multiboot2_chainloader" +version = "0.1.0" +dependencies = [ + "anyhow", + "elf_rs", + "integration-test-util", + "log", + "multiboot", + "multiboot2", + "multiboot2-header", +] + +[[package]] +name = "multiboot2_payload" +version = "0.1.0" +dependencies = [ + "anyhow", + "integration-test-util", + "log", + "multiboot2", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "proc-macro2" version = "1.0.101" @@ -74,6 +176,12 @@ dependencies = [ "syn", ] +[[package]] +name = "qemu-exit" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb0fd6580eeed0103c054e3fba2c2618ff476943762f28a645b63b8692b21c9" + [[package]] name = "quote" version = "1.0.41" @@ -83,6 +191,21 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "syn" version = "2.0.106" diff --git a/Cargo.toml b/Cargo.toml index 9c3f7298..8158eb64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,31 +1,53 @@ [workspace] resolver = "2" members = [ + "integration-test/bins/multiboot2_chainloader", + "integration-test/bins/multiboot2_payload", + "integration-test/bins/util", "multiboot2", "multiboot2-common", "multiboot2-header", ] -exclude = [ - "integration-test" +# Default members are all members without special Rust runtime attributes, such +# as panic_handler and global_allocator. This way, `cargo test` et al. will work +# smoothley while the workspace still contains the integration tests. +default-members = [ + "multiboot2", + "multiboot2-common", + "multiboot2-header", ] package.rust-version = "1.85.0" package.edition = "2024" package.license = "MIT/Apache-2.0" [workspace.dependencies] -bitflags = "2.9.1" +# Dependencies of multiboot2 et al. +bitflags = { version = "2.9", default-features = false } log = { version = "~0.4", default-features = false } -ptr_meta = { version = "~0.3", default-features = false, features = ["derive"] } -thiserror = { version = "2.0.12", default-features = false } +ptr_meta = { version = "~0.3", default-features = false } +thiserror = { version = "2.0", default-features = false } +uefi-raw = { version = "~0.11", default-features = false } -# Intra-workspace dependencies of upstream crates: always point to the latest -# stable version +# Dependencies for integration tests +anyhow = { version = "1.0", default-features = false } +multiboot = { version = "0.8", default-features = false } +elf_rs = { version = "0.3", default-features = false } +good_memory_allocator = { version = "0.1", default-features = false } +integration-test-util = { path = "./integration-test/bins/util" } +qemu-exit = { version = "3.0", default-features = false } + +# Intra-workspace dependencies of upstream crates multiboot2 = { version = "0.24.0", default-features = false } multiboot2-common = { version = "0.3.0", default-features = false } +multiboot2-header = { version = "0.7.0", default-features = false } + +[profile.release-integration-test] +inherits = "release" +panic = "abort" +opt-level = "s" -# This way, the corresponding crate dependency can be normalley referenced by -# version, while still the repository version is used transparently during local -# development. +# Force the local versions of the multiboot2 crates, i.e., override any +# dependency to a crates.io version. [patch.crates-io] multiboot2 = { path = "multiboot2" } multiboot2-common = { path = "multiboot2-common" } diff --git a/README.md b/README.md index ee9219f3..cab379f8 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,12 @@ Licensed under either of at your option. -### Contribution +## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. + +## Run Integration Tests + +- `$ nix develop --command bash -c "run-integrationtest"` diff --git a/integration-test/bins/.cargo/config.toml b/integration-test/bins/.cargo/config.toml deleted file mode 100644 index b02f2b2e..00000000 --- a/integration-test/bins/.cargo/config.toml +++ /dev/null @@ -1,11 +0,0 @@ -[unstable] -build-std = ["core", "compiler_builtins", "alloc"] -build-std-features = ["compiler-builtins-mem"] - -[build] -target = "x86-unknown-none.json" -rustflags = [ - "-C", "code-model=kernel", - # "-C", "link-arg=-Tlink.ld", - "-C", "relocation-model=static", -] diff --git a/integration-test/bins/Cargo.lock b/integration-test/bins/Cargo.lock deleted file mode 100644 index c9b61939..00000000 --- a/integration-test/bins/Cargo.lock +++ /dev/null @@ -1,296 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "anyhow" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "bit_field" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "elf_rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894d710b6b07dae25ce69f9227ec2ffa3a3f71dc7f071acea3e1928ab4aeafdf" -dependencies = [ - "bitflags 2.9.4", - "num-traits", -] - -[[package]] -name = "good_memory_allocator" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1651659e016ea4259760966432aebcc96c81e26743fb018c59585ddd677127e" -dependencies = [ - "either", - "spin", -] - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" - -[[package]] -name = "multiboot" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87ad3b7b7bcf5da525c22221e3eb3a020cd68b2d55ae62f629c15e8bc3bd56e" -dependencies = [ - "paste", -] - -[[package]] -name = "multiboot2" -version = "0.24.0" -dependencies = [ - "bitflags 2.9.4", - "log", - "multiboot2-common", - "ptr_meta", - "thiserror", - "uefi-raw", -] - -[[package]] -name = "multiboot2-common" -version = "0.3.0" -dependencies = [ - "ptr_meta", - "thiserror", -] - -[[package]] -name = "multiboot2-header" -version = "0.7.0" -dependencies = [ - "log", - "multiboot2", - "multiboot2-common", - "ptr_meta", - "thiserror", -] - -[[package]] -name = "multiboot2_chainloader" -version = "0.1.0" -dependencies = [ - "anyhow", - "elf_rs", - "good_memory_allocator", - "log", - "multiboot", - "multiboot2", - "multiboot2-header", - "util", -] - -[[package]] -name = "multiboot2_payload" -version = "0.1.0" -dependencies = [ - "anyhow", - "good_memory_allocator", - "log", - "multiboot2", - "util", - "x86", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "proc-macro2" -version = "1.0.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "ptr_meta" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "qemu-exit" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb0fd6580eeed0103c054e3fba2c2618ff476943762f28a645b63b8692b21c9" - -[[package]] -name = "quote" -version = "1.0.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "raw-cpuid" -version = "10.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "syn" -version = "2.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "2.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "uefi-raw" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cad96b8baaf1615d3fdd0f03d04a0b487d857c1b51b19dcbfe05e2e3c447b78" -dependencies = [ - "bitflags 2.9.4", - "uguid", -] - -[[package]] -name = "uguid" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab14ea9660d240e7865ce9d54ecdbd1cd9fa5802ae6f4512f093c7907e921533" - -[[package]] -name = "unicode-ident" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" - -[[package]] -name = "util" -version = "0.1.0" -dependencies = [ - "good_memory_allocator", - "log", - "qemu-exit", -] - -[[package]] -name = "x86" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2781db97787217ad2a2845c396a5efe286f87467a5810836db6d74926e94a385" -dependencies = [ - "bit_field", - "bitflags 1.3.2", - "raw-cpuid", -] diff --git a/integration-test/bins/Cargo.toml b/integration-test/bins/Cargo.toml deleted file mode 100644 index af50178b..00000000 --- a/integration-test/bins/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[workspace] -resolver = "2" -members = [ - "multiboot2_chainloader", - "multiboot2_payload", - "util" -] - -[profile.release] -codegen-units = 1 -lto = true - - -[workspace.dependencies] -anyhow = { version = "1.0", default-features = false } -log = { version = "0.4", default-features = false } -multiboot2 = { path = "../../multiboot2", features = ["builder"] } -multiboot2-header = { path = "../../multiboot2-header", features = ["builder"] } -good_memory_allocator = "0.1" -util = { path = "./util" } - -# This way, the "multiboot2" dependency in the multiboot2-header crate can be -# referenced by version, while still the repository version is used -# transparently during local development. -[patch.crates-io] -multiboot2 = { path = "../../multiboot2" } -multiboot2-common = { path = "../../multiboot2-common" } -multiboot2-header = { path = "../../multiboot2-header" } diff --git a/integration-test/bins/multiboot2_chainloader/Cargo.toml b/integration-test/bins/multiboot2_chainloader/Cargo.toml index 68bbcb82..0527935a 100644 --- a/integration-test/bins/multiboot2_chainloader/Cargo.toml +++ b/integration-test/bins/multiboot2_chainloader/Cargo.toml @@ -2,15 +2,17 @@ name = "multiboot2_chainloader" description = "Integrationtest: Multiboot2 chainloader" version = "0.1.0" -edition = "2024" +edition.workspace = true publish = false +[features] +default = [] + [dependencies] -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" +anyhow = { workspace = true } +elf_rs = { workspace = true } +integration-test-util = { workspace = true } +log = { workspace = true } +multiboot = { workspace = true } +multiboot2 = { workspace = true, features = ["builder"] } +multiboot2-header = { workspace = true } diff --git a/integration-test/bins/multiboot2_chainloader/src/main.rs b/integration-test/bins/multiboot2_chainloader/src/main.rs index 5462c579..81a0cca0 100644 --- a/integration-test/bins/multiboot2_chainloader/src/main.rs +++ b/integration-test/bins/multiboot2_chainloader/src/main.rs @@ -7,9 +7,9 @@ mod multiboot; extern crate alloc; #[macro_use] -extern crate util; +extern crate integration_test_util; -use util::init_environment; +use integration_test_util::init_environment; core::arch::global_asm!(include_str!("start.S"), options(att_syntax)); diff --git a/integration-test/bins/multiboot2_payload/Cargo.toml b/integration-test/bins/multiboot2_payload/Cargo.toml index d0c3a2e7..2a477def 100644 --- a/integration-test/bins/multiboot2_payload/Cargo.toml +++ b/integration-test/bins/multiboot2_payload/Cargo.toml @@ -2,13 +2,11 @@ name = "multiboot2_payload" description = "Integrationtest: Multiboot2 payload" version = "0.1.0" -edition = "2024" +edition.workspace = true publish = false [dependencies] -anyhow.workspace = true -log.workspace = true -good_memory_allocator.workspace = true -multiboot2.workspace = true -util.workspace = true -x86 = "0.52" +anyhow = { workspace = true } +integration-test-util = { workspace = true } +log = { workspace = true } +multiboot2 = { workspace = true } diff --git a/integration-test/bins/multiboot2_payload/src/main.rs b/integration-test/bins/multiboot2_payload/src/main.rs index 203354a5..ac696f2a 100644 --- a/integration-test/bins/multiboot2_payload/src/main.rs +++ b/integration-test/bins/multiboot2_payload/src/main.rs @@ -4,13 +4,13 @@ extern crate alloc; #[macro_use] -extern crate util; +extern crate integration_test_util; core::arch::global_asm!(include_str!("start.S"), options(att_syntax)); core::arch::global_asm!(include_str!("multiboot2_header.S")); +use integration_test_util::{init_environment, qemu_exit_success}; use multiboot2::BootInformation; -use util::{init_environment, qemu_exit_success}; mod verify; diff --git a/integration-test/bins/util/Cargo.toml b/integration-test/bins/util/Cargo.toml index bce195cb..a7ecf2e9 100644 --- a/integration-test/bins/util/Cargo.toml +++ b/integration-test/bins/util/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "util" -description = "Util library" +name = "integration-test-util" +description = "Integration Test Utils" version = "0.1.0" -edition = "2021" +edition.workspace = true publish = false [dependencies] -good_memory_allocator = "0.1" -log = { version = "0.4", default-features = false } -qemu-exit = "3.0.2" +good_memory_allocator = { workspace = true, features = ["spin"] } +log = { workspace = true } +qemu-exit = { workspace = true } diff --git a/integration-test/bins/util/src/allocator.rs b/integration-test/bins/util/src/allocator.rs index 017f3c2e..67d7b242 100644 --- a/integration-test/bins/util/src/allocator.rs +++ b/integration-test/bins/util/src/allocator.rs @@ -11,6 +11,7 @@ static ALLOCATOR: SpinLockedAllocator = SpinLockedAllocator::empty(); /// Initializes the allocator. Call only once. pub fn init() { + #[allow(static_mut_refs)] unsafe { ALLOCATOR.init(HEAP.0.as_ptr().cast::() as _, HEAP.0.len()); } diff --git a/integration-test/run.sh b/integration-test/run.sh index 9f4fd36c..b1eded48 100755 --- a/integration-test/run.sh +++ b/integration-test/run.sh @@ -7,30 +7,46 @@ IFS=$'\n\t' DIR=$(dirname "$(realpath "$0")") cd "$DIR" || exit +# rustc 1.89 (nightly). +RUSTUP_NIGHTLY_TOOLCHAIN="nightly-2025-05-31" + function fn_main() { + fn_prepare_rustup fn_build_rust_bins fn_multiboot2_integrationtest fn_multiboot2_header_integrationtest } +# We prefer this over a rustup-toolchain.toml as we need the nightly-toolchain +# only for the integration tests but not the actual crate. +function fn_prepare_rustup() { + rustup toolchain add "$RUSTUP_NIGHTLY_TOOLCHAIN" + rustup component add rust-src --toolchain "$RUSTUP_NIGHTLY_TOOLCHAIN" +} + function fn_build_rust_bins() { - cd "bins" - cargo --version - cargo build --release --verbose - cd "$DIR" + RUSTUP_TOOLCHAIN="$RUSTUP_NIGHTLY_TOOLCHAIN" \ + cargo build \ + --verbose \ + --target ./bins/x86-unknown-none.json \ + -Z build-std=core,alloc,compiler_builtins \ + -Z build-std-features=compiler-builtins-mem \ + --profile release-integration-test \ + -p multiboot2_chainloader \ + -p multiboot2_payload } function fn_multiboot2_integrationtest() { cd tests/multiboot2 ./build_img.sh ./run_qemu.sh - cd "$DIR" + cd - } function fn_multiboot2_header_integrationtest() { cd tests/multiboot2-header ./run_qemu.sh - cd "$DIR" + cd - } fn_main diff --git a/integration-test/tests/multiboot2-header/run_qemu.sh b/integration-test/tests/multiboot2-header/run_qemu.sh index d7bbfbc3..48907766 100755 --- a/integration-test/tests/multiboot2-header/run_qemu.sh +++ b/integration-test/tests/multiboot2-header/run_qemu.sh @@ -9,9 +9,9 @@ IFS=$'\n\t' DIR=$(dirname "$(realpath "$0")") cd "$DIR" || exit -BINS_DIR="../../bins/target/x86-unknown-none/release" -CHAINLOADER="$BINS_DIR/multiboot2_chainloader" -PAYLOAD="$BINS_DIR/multiboot2_payload" +TARGET_DIR="../../../target/x86-unknown-none/release-integration-test" +CHAINLOADER="$TARGET_DIR/multiboot2_chainloader" +PAYLOAD="$TARGET_DIR/multiboot2_payload" # add "-d int \" to debug CPU exceptions # "-display none" is necessary for the CI but locally the display and the # combat monitor are really helpful diff --git a/integration-test/tests/multiboot2/build_img.sh b/integration-test/tests/multiboot2/build_img.sh index 026e80cf..50f138ab 100755 --- a/integration-test/tests/multiboot2/build_img.sh +++ b/integration-test/tests/multiboot2/build_img.sh @@ -11,8 +11,8 @@ IFS=$'\n\t' DIR=$(dirname "$(realpath "$0")") cd "$DIR" || exit -MULTIBOOT2_PAYLOAD_DIR="../../bins" -MULTIBOOT2_PAYLOAD_PATH="$MULTIBOOT2_PAYLOAD_DIR/target/x86-unknown-none/release/multiboot2_payload" +TARGET_DIR="../../../target/x86-unknown-none/release-integration-test" +MULTIBOOT2_PAYLOAD_PATH="$TARGET_DIR/multiboot2_payload" echo "Verifying that the binary is a multiboot2 binary..." grub-file --is-x86-multiboot2 "$MULTIBOOT2_PAYLOAD_PATH" diff --git a/multiboot2-common/Cargo.toml b/multiboot2-common/Cargo.toml index 103351e6..903fc3e3 100644 --- a/multiboot2-common/Cargo.toml +++ b/multiboot2-common/Cargo.toml @@ -29,8 +29,8 @@ builder = ["alloc"] [dependencies] -ptr_meta.workspace = true -thiserror.workspace = true +ptr_meta = { workspace = true, features = ["derive"] } +thiserror = { workspace = true } [package.metadata.docs.rs] all-features = true diff --git a/multiboot2-header/Cargo.toml b/multiboot2-header/Cargo.toml index 01f05376..ebf18098 100644 --- a/multiboot2-header/Cargo.toml +++ b/multiboot2-header/Cargo.toml @@ -41,11 +41,10 @@ alloc = ["multiboot2-common/alloc"] builder = ["alloc", "multiboot2-common/builder"] [dependencies] -log.workspace = true -multiboot2-common.workspace = true -multiboot2.workspace = true -ptr_meta.workspace = true -thiserror.workspace = true +multiboot2-common = { workspace = true } +multiboot2 = { workspace = true } +ptr_meta = { workspace = true } +thiserror = { workspace = true } [package.metadata.docs.rs] all-features = true diff --git a/multiboot2/Cargo.toml b/multiboot2/Cargo.toml index a79f3386..c961f258 100644 --- a/multiboot2/Cargo.toml +++ b/multiboot2/Cargo.toml @@ -40,12 +40,12 @@ alloc = ["multiboot2-common/alloc"] builder = ["alloc", "multiboot2-common/builder"] [dependencies] -bitflags.workspace = true -log.workspace = true -multiboot2-common.workspace = true -ptr_meta.workspace = true -thiserror.workspace = true -uefi-raw = { version = "~0.11.0", default-features = false } +bitflags = { workspace = true } +log = { workspace = true } +multiboot2-common = { workspace = true } +ptr_meta = { workspace = true } +thiserror = { workspace = true } +uefi-raw = { workspace = true } [package.metadata.docs.rs] all-features = true