diff --git a/Cargo.lock b/Cargo.lock index 368078befd..0dfbc45f68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,7 +56,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b763acdc1d85c36d61acf97a59938f23202d0e8efe45e8759de10c02db242744" dependencies = [ "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "byteorder", "log", "pci_types", @@ -239,6 +239,15 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "arceos-affinity" version = "0.3.1" @@ -551,7 +560,7 @@ name = "arm-gic-driver" version = "0.17.2" dependencies = [ "aarch64-cpu 11.2.0", - "bitflags 2.11.1", + "bitflags 2.13.0", "enum_dispatch", "log", "paste", @@ -564,7 +573,7 @@ name = "arm-scmi-rs" version = "0.1.3" dependencies = [ "aarch64-cpu-ext", - "bitflags 2.11.1", + "bitflags 2.13.0", "log", "mbarrier", "nb", @@ -755,7 +764,7 @@ dependencies = [ name = "ax-cap-access" version = "0.3.5" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -998,7 +1007,7 @@ dependencies = [ "ax-sync", "axfs-ng-vfs", "axpoll", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "chrono", "intrusive-collections", @@ -1026,7 +1035,7 @@ name = "ax-fs-vfs" version = "0.3.11" dependencies = [ "ax-errno 0.6.0", - "bitflags 2.11.1", + "bitflags 2.13.0", "log", ] @@ -1257,7 +1266,7 @@ dependencies = [ "ax-task", "axfs-ng-vfs", "axpoll", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "enum_dispatch", "event-listener", @@ -1276,7 +1285,7 @@ version = "0.8.10" dependencies = [ "aarch64-cpu 11.2.0", "ax-memory-addr", - "bitflags 2.11.1", + "bitflags 2.13.0", "x86_64", ] @@ -1326,7 +1335,7 @@ dependencies = [ "ax-memory-addr", "ax-percpu", "ax-plat-macros", - "bitflags 2.11.1", + "bitflags 2.13.0", "const-str", "irq-framework", "rdrive", @@ -1416,7 +1425,7 @@ dependencies = [ "ax-percpu", "ax-plat", "axklib", - "bitflags 2.11.1", + "bitflags 2.13.0", "heapless 0.9.3", "log", "multiboot", @@ -1441,7 +1450,7 @@ dependencies = [ "ax-percpu", "ax-plat", "axklib", - "bitflags 2.11.1", + "bitflags 2.13.0", "heapless 0.9.3", "log", "multiboot", @@ -1615,7 +1624,7 @@ dependencies = [ "axin", "axvm-types", "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "lazy_static", "log", @@ -1723,7 +1732,7 @@ version = "0.1.0-pre.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf1c27753a96a0f835cca49e6fb354912107d018c905d13c7eff39be757eb5a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "log", ] @@ -1734,7 +1743,7 @@ dependencies = [ "ax-errno 0.6.0", "ax-kspin", "axpoll", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "hashbrown 0.16.1", "inherit-methods-macro", @@ -1815,7 +1824,7 @@ name = "axpoll" version = "0.3.10" dependencies = [ "ax-kspin", - "bitflags 2.11.1", + "bitflags 2.13.0", "futures", "linux-raw-sys 0.12.1", "spin 0.12.0", @@ -2045,7 +2054,7 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cexpr", "clang-sys", "itertools 0.13.0", @@ -2063,7 +2072,7 @@ version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cexpr", "clang-sys", "itertools 0.13.0", @@ -2144,9 +2153,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "bitmap-allocator" @@ -2254,6 +2263,12 @@ dependencies = [ "libc", ] +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + [[package]] name = "byte-unit" version = "5.2.0" @@ -2414,9 +2429,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -2725,7 +2740,7 @@ name = "crab-usb" version = "0.9.4" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.13.0", "crossbeam", "crossbeam-skiplist", "dma-api", @@ -2895,7 +2910,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "crossterm_winapi", "mio", "parking_lot", @@ -2911,7 +2926,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "crossterm_winapi", "derive_more", "document-features", @@ -3674,6 +3689,12 @@ dependencies = [ "regex", ] +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + [[package]] name = "fastrand" version = "2.4.1" @@ -3723,7 +3744,7 @@ version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da02698288e0275e442a47fc12ca26d50daf0d48b15398ba5906f20ac2e2a9f9" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "ffmpeg-sys-next", "libc", ] @@ -4894,7 +4915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43c066bb7997a6daf34a35ad2790570f32f33677dec17538781bbaff4be2248e" dependencies = [ "ax-errno 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 2.11.1", + "bitflags 2.13.0", "int-enum", "log", "lru 0.18.0", @@ -4927,7 +4948,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -4949,7 +4970,7 @@ checksum = "a5d13c9132595e1b16ba64390fc23a19ab0f9b940a144445bdd270854e61f544" dependencies = [ "ax-errno 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitfield-struct 0.13.0", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "goblin", "int-enum", @@ -5078,6 +5099,12 @@ dependencies = [ "windows-link", ] +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + [[package]] name = "libudev" version = "0.3.0" @@ -5127,7 +5154,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f50e8f47623268b5407192d26876c4d7f89d686ca130fdc53bced4814cd29f8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -5165,9 +5192,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.30" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" [[package]] name = "loongArch64" @@ -5176,7 +5203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "236e72a07bb26b68662f7cc9dcb58cea50cf5e3d8b698e1b51ff7c36d633dd92" dependencies = [ "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -5470,7 +5497,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "cfg_aliases", "libc", @@ -5731,9 +5758,9 @@ dependencies = [ [[package]] name = "ostool" -version = "0.21.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d0470fd8561e21f458d865490c928ebff45c0e1037a45f634a527acb8f15ff" +checksum = "ada76a46f68ee817f9c32b8374939b7d456eb6165654284e2f28e8db89585ca4" dependencies = [ "anyhow", "async-trait", @@ -5800,7 +5827,7 @@ dependencies = [ name = "page-table-generic" version = "0.7.3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "env_logger", "heapless 0.9.3", "log", @@ -5809,6 +5836,30 @@ dependencies = [ "tock-registers 0.10.1", ] +[[package]] +name = "palette" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +dependencies = [ + "approx", + "fast-srgb8", + "libm", + "palette_derive", +] + +[[package]] +name = "palette_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +dependencies = [ + "by_address", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "parking_lot" version = "0.12.5" @@ -5851,7 +5902,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0c2a105c657261a938ff68ee231c199a3d80eef33976004829de761ef5b1a9b" dependencies = [ "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -5859,7 +5910,7 @@ name = "pcie" version = "0.6.2" dependencies = [ "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "fdt-edit", "log", "mmio-api", @@ -6095,7 +6146,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613142bc127747febf3eae56e000f1be431756a6eaa8d3f060f9144d938e798c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "itertools 0.14.0", ] @@ -6435,9 +6486,9 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce67fb8ba4446454d1c8dbaeda0557ff5e94d39d5e5ed7f10a65eb4c8266bc" +checksum = "1695748e3a735b34968c887ceea5a380b43545903868ae8f5b666593100f6b68" dependencies = [ "instability", "ratatui-core", @@ -6445,22 +6496,26 @@ dependencies = [ "ratatui-macros", "ratatui-termwiz", "ratatui-widgets", + "serde", ] [[package]] name = "ratatui-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef8dea09a92caaf73bff7adb70b76162e5937524058a7e5bff37869cbbec293" +checksum = "42d3603f354bba8c595fa47860e60142d7372b7210c27044c6a7d0e1a4336b44" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "compact_str 0.9.1", - "hashbrown 0.16.1", + "critical-section", + "hashbrown 0.17.1", "indoc", "itertools 0.14.0", "kasuari", - "lru 0.16.4", - "strum 0.27.2", + "lru 0.18.0", + "palette", + "serde", + "strum 0.28.0", "thiserror 2.0.18", "unicode-segmentation", "unicode-truncate", @@ -6469,9 +6524,9 @@ dependencies = [ [[package]] name = "ratatui-crossterm" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "577c9b9f652b4c121fb25c6a391dd06406d3b092ba68827e6d2f09550edc54b3" +checksum = "2b2867bedcbd6a690ca4f8672a687b730ec07660c79844517b084311b529980c" dependencies = [ "cfg-if", "crossterm 0.29.0", @@ -6481,9 +6536,9 @@ dependencies = [ [[package]] name = "ratatui-macros" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f1342a13e83e4bb9d0b793d0ea762be633f9582048c892ae9041ef39c936f4" +checksum = "80fac59720679490d89d200df411faa249be728681adcabed3d047ae72c48f1d" dependencies = [ "ratatui-core", "ratatui-widgets", @@ -6491,9 +6546,9 @@ dependencies = [ [[package]] name = "ratatui-termwiz" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f76fe0bd0ed4295f0321b1676732e2454024c15a35d01904ddb315afd3d545c" +checksum = "386b8ff8f74ed749509391c56d549761a2fcdb408e1f42e467286bcb7dac8967" dependencies = [ "ratatui-core", "termwiz", @@ -6501,18 +6556,19 @@ dependencies = [ [[package]] name = "ratatui-widgets" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7dbfa023cd4e604c2553483820c5fe8aa9d71a42eea5aa77c6e7f35756612db" +checksum = "7ef4f17dd7ac3abf5adc2b920a03c61eee4bfe6a88fa5191936895525371d79c" dependencies = [ - "bitflags 2.11.1", - "hashbrown 0.16.1", + "bitflags 2.13.0", + "hashbrown 0.17.1", "indoc", "instability", "itertools 0.14.0", "line-clipping", "ratatui-core", - "strum 0.27.2", + "serde", + "strum 0.28.0", "time", "unicode-segmentation", "unicode-width 0.2.2", @@ -6533,7 +6589,7 @@ version = "11.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -6666,7 +6722,7 @@ dependencies = [ name = "rdif-serial" version = "0.7.2" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "futures", "heapless 0.9.3", "rdif-base", @@ -6745,7 +6801,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -6912,7 +6968,7 @@ version = "0.4.8" dependencies = [ "bare-metal", "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "log", "riscv", ] @@ -6939,7 +6995,7 @@ dependencies = [ "axvcpu", "axvm-types", "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "log", "memoffset", @@ -7024,7 +7080,7 @@ name = "rockchip-npu" version = "0.2.2" dependencies = [ "aarch64-cpu-ext", - "bitflags 2.11.1", + "bitflags 2.13.0", "dma-api", "log", "mbarrier", @@ -7050,7 +7106,7 @@ name = "rockchip-soc" version = "0.3.1" dependencies = [ "ax-kspin", - "bitflags 2.11.1", + "bitflags 2.13.0", "dma-api", "enum_dispatch", "fdt-edit", @@ -7067,7 +7123,7 @@ name = "rsext4" version = "0.5.0" dependencies = [ "ax-kspin", - "bitflags 2.11.1", + "bitflags 2.13.0", "log", ] @@ -7125,7 +7181,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys 0.4.15", @@ -7138,7 +7194,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys 0.12.1", @@ -7298,7 +7354,7 @@ version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "785b91fcc41c7426fc07510be49ed1db44f002b45d45c175ec7f155c3cd447a9" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -7385,7 +7441,7 @@ dependencies = [ name = "sdmmc-protocol" version = "0.1.2" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "embedded-hal", "log", ] @@ -7402,7 +7458,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -7532,7 +7588,7 @@ version = "4.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4d91116f97173694f1642263b2ff837f80d933aa837e2314969f6728f661df3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "core-foundation 0.10.1", "core-foundation-sys", @@ -7769,7 +7825,7 @@ name = "some-serial" version = "0.5.0" dependencies = [ "ax-kspin", - "bitflags 2.11.1", + "bitflags 2.13.0", "enum_dispatch", "fdt-edit", "heapless 0.9.3", @@ -7794,7 +7850,7 @@ dependencies = [ "anyhow", "arrayvec", "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "buddy_system_allocator 0.12.0", "byte-unit", "byteorder", @@ -7906,7 +7962,7 @@ version = "0.4.1-preview.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d994a3a25a5cc4a895b200bd00d8e757515f21f9c21647bd4e9a8e572a326f1" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "log", ] @@ -7947,7 +8003,7 @@ dependencies = [ "axnsproxy", "axplat-dyn", "axpoll", - "bitflags 2.11.1", + "bitflags 2.13.0", "bitmaps", "bytemuck", "cfg-if", @@ -8017,7 +8073,7 @@ dependencies = [ "ax-cpu", "ax-errno 0.6.0", "ax-kspin", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "derive_more", "event-listener", @@ -8203,7 +8259,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -8287,7 +8343,7 @@ checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7" dependencies = [ "anyhow", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.13.0", "fancy-regex", "filedescriptor", "finl_unicode", @@ -8806,7 +8862,7 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytes", "futures-core", "futures-util", @@ -8970,7 +9026,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94d293f51425981fdb1b766beae254dbb711a17e8c4b549dc69b9b7ee0d478d5" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "rustversion", "x86", ] @@ -8981,7 +9037,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71cceed8939ba6ebde9d1e8a603b3c7f1a239a3db22e1ff465ed71ddca7a7d66" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -9017,7 +9073,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66ab9569afdd1e33a31d8002343aa1df594f055347b1a66136bf9dd6cbc3ec37" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "log", "ptr_meta 0.3.1", @@ -9044,7 +9100,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3775e5934877acaef4b00f254f252df1e2266903c31e51455c117f4f2824eda" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "uguid", ] @@ -9293,7 +9349,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfdc1c628cdd8ce7c3b9e65a8ed550d0338e9ef9f911e729666f1cce097de2f7" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "enumn", "log", "safe-mmio", @@ -9493,7 +9549,7 @@ version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "hashbrown 0.15.5", "indexmap", "semver", @@ -10020,7 +10076,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.13.0", "indexmap", "log", "serde", @@ -10096,7 +10152,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7841fa0098ceb15c567d93d3fae292c49e10a7662b4936d5f6a9728594555ba" dependencies = [ "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "const_fn", "rustversion", "volatile 0.4.6", @@ -10124,7 +10180,7 @@ dependencies = [ "axvcpu", "axvm-types", "bit_field", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "log", "memoffset", @@ -10228,9 +10284,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", diff --git a/Cargo.toml b/Cargo.toml index 7ea6581102..e944c36b24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -345,7 +345,7 @@ mmio-api = { version = "0.2.2", path = "memory/mmio-api" } lock_api = { version = "0.4", default-features = false } log = "0.4" spin = "0.12" -ostool = { version = "0.21" } +ostool = { version = "0.22.1" } riscv = { version = "0.16.1", default-features = false } sbi-rt = { version = "0.0.4", default-features = false } uefi = "0.37.0" diff --git a/scripts/axbuild/src/arceos/mod.rs b/scripts/axbuild/src/arceos/mod.rs index 49e0babf50..07e30e3dad 100644 --- a/scripts/axbuild/src/arceos/mod.rs +++ b/scripts/axbuild/src/arceos/mod.rs @@ -239,7 +239,6 @@ impl ArceOS { let mut qemu = match request.qemu_config.as_deref() { Some(path) => self .app - .tool_mut() .read_qemu_config_from_path_for_cargo(cargo, path) .await .map(Some)?, @@ -259,7 +258,6 @@ impl ArceOS { match request.uboot_config.as_deref() { Some(path) => self .app - .tool_mut() .read_uboot_config_from_path_for_cargo(cargo, path) .await .map(Some), diff --git a/scripts/axbuild/src/axvisor/mod.rs b/scripts/axbuild/src/axvisor/mod.rs index 3cea19a9d2..301b2e2078 100644 --- a/scripts/axbuild/src/axvisor/mod.rs +++ b/scripts/axbuild/src/axvisor/mod.rs @@ -374,7 +374,6 @@ impl Axvisor { match request.uboot_config.as_deref() { Some(path) => self .app - .tool_mut() .read_uboot_config_from_path_for_cargo(cargo, path) .await .map(Some), @@ -390,14 +389,12 @@ impl Axvisor { match board_config_path { Some(path) => { self.app - .tool_mut() .read_board_run_config_from_path_for_cargo(cargo, path) .await } None => { let workspace_root = self.app.workspace_root().to_path_buf(); self.app - .tool_mut() .ensure_board_run_config_in_dir_for_cargo(cargo, &workspace_root) .await } diff --git a/scripts/axbuild/src/axvisor/rootfs.rs b/scripts/axbuild/src/axvisor/rootfs.rs index 854dfad009..c8b2a5f8e1 100644 --- a/scripts/axbuild/src/axvisor/rootfs.rs +++ b/scripts/axbuild/src/axvisor/rootfs.rs @@ -58,7 +58,6 @@ pub(super) async fn load_patched_qemu_config( }); let mut qemu = axvisor .app - .tool_mut() .read_qemu_config_from_path_for_cargo(cargo, &config_path) .await?; patch_qemu_rootfs( diff --git a/scripts/axbuild/src/axvisor/test.rs b/scripts/axbuild/src/axvisor/test.rs index 699b8abf1b..769c8da128 100644 --- a/scripts/axbuild/src/axvisor/test.rs +++ b/scripts/axbuild/src/axvisor/test.rs @@ -452,12 +452,7 @@ impl Axvisor { let cargo = build::load_cargo_config(&request)?; let base_uboot = match request.uboot_config.as_deref() { Some(_) => self.load_uboot_config(&request, &cargo).await?, - None => Some( - self.app - .tool_mut() - .ensure_uboot_config_for_cargo(&cargo) - .await?, - ), + None => Some(self.app.ensure_uboot_config_for_cargo(&cargo).await?), }; let board_config = self .load_board_config(&cargo, Some(board_test_config.as_path())) @@ -604,7 +599,6 @@ impl Axvisor { )?; let qemu = self .app - .tool_mut() .read_qemu_config_from_path_for_cargo(&cargo, &case.case.qemu_config_path) .await .with_context(|| { diff --git a/scripts/axbuild/src/context/mod.rs b/scripts/axbuild/src/context/mod.rs index e4bbdc7e38..c46f9536eb 100644 --- a/scripts/axbuild/src/context/mod.rs +++ b/scripts/axbuild/src/context/mod.rs @@ -8,12 +8,15 @@ use std::{ use anyhow::Context; use log::info; use ostool::{ - Tool, ToolConfig, - board::{RunBoardOptions, config::BoardRunConfig}, - build::{CargoQemuRunnerArgs, CargoRunnerKind, CargoUbootRunnerArgs, config::Cargo}, + board::{self as ostool_board, RunBoardOptions, config::BoardRunConfig}, + build::{ + self as ostool_build, CargoQemuRunnerArgs, CargoRunnerKind, CargoUbootRunnerArgs, + config::{BuildConfig, BuildSystem, Cargo}, + }, + invocation::{Invocation, InvocationOptions}, run::{ - qemu::{QemuConfig, RunQemuOptions}, - uboot::UbootConfig, + qemu::{self as ostool_qemu, QemuConfig, RunQemuOptions}, + uboot::{self as ostool_uboot, UbootConfig}, }, }; @@ -69,7 +72,7 @@ fn snapshot_store_disabled() -> bool { } pub struct AppContext { - tool: Tool, + invocation: Invocation, build_config_path: Option, root: PathBuf, member_dirs: HashMap, @@ -84,9 +87,10 @@ impl AppContext { info!("Workspace root: {}", workspace_root.display()); - let tool = Tool::new(ToolConfig::default()).context("failed to initialize ostool")?; + let invocation = Self::new_invocation(&workspace_root, false) + .context("failed to initialize ostool invocation")?; Ok(Self { - tool, + invocation, build_config_path: None, root: workspace_root, member_dirs: HashMap::new(), @@ -99,10 +103,6 @@ impl AppContext { &self.root } - pub(crate) fn tool_mut(&mut self) -> &mut Tool { - &mut self.tool - } - pub(crate) fn workspace_member_dir(&mut self, package: &str) -> anyhow::Result<&Path> { if !self.member_dirs.contains_key(package) { let member_dir = resolve_workspace_member_dir(package)?; @@ -126,7 +126,8 @@ impl AppContext { ) -> anyhow::Result<()> { self.set_build_config_path(build_config_path); let _env_guard = EnvRestoreGuard::set(&cargo.env); - self.tool.cargo_build(&cargo).await + let build_config_path = self.build_config_path.clone(); + ostool_build::cargo_build(&mut self.invocation, &cargo, build_config_path.as_deref()).await } pub(crate) async fn prepare_elf_artifact( @@ -134,7 +135,7 @@ impl AppContext { elf_path: PathBuf, to_bin: bool, ) -> anyhow::Result<()> { - self.tool.prepare_elf_artifact(elf_path, to_bin).await + self.invocation.prepare_elf_artifact(elf_path, to_bin).await } pub(crate) async fn qemu( @@ -146,17 +147,18 @@ impl AppContext { let _env_guard = EnvRestoreGuard::set(&cargo.env); let _path_guard = self.scoped_qemu_path(&cargo)?; self.set_build_config_path(build_config_path); - self.tool - .cargo_run( - &cargo, - &CargoRunnerKind::Qemu(Box::new(CargoQemuRunnerArgs { - qemu, - debug: self.debug, - dtb_dump: false, - show_output: true, - })), - ) - .await + let build_config_path = self.build_config_path.clone(); + ostool_build::cargo_run( + &mut self.invocation, + &cargo, + build_config_path.as_deref(), + &CargoRunnerKind::Qemu(Box::new(CargoQemuRunnerArgs { + qemu, + debug: self.debug, + dtb_dump: false, + })), + ) + .await } pub(crate) async fn run_qemu( @@ -171,15 +173,13 @@ impl AppContext { .map(crate::support::backtrace_output_capture::BacktraceOutputCaptureGuard::install) .transpose() .context("failed to install backtrace block output capture")?; - self.tool - .run_qemu( - &qemu, - RunQemuOptions { - dtb_dump: false, - show_output: true, - }, - ) - .await + self.activate_cargo_build_context(cargo)?; + ostool_qemu::run_qemu( + &mut self.invocation, + &qemu, + RunQemuOptions { dtb_dump: false }, + ) + .await } pub(crate) async fn run_prepared_qemu( @@ -192,15 +192,12 @@ impl AppContext { .map(crate::support::backtrace_output_capture::BacktraceOutputCaptureGuard::install) .transpose() .context("failed to install backtrace block output capture")?; - self.tool - .run_qemu( - &qemu, - RunQemuOptions { - dtb_dump: false, - show_output: true, - }, - ) - .await + ostool_qemu::run_qemu( + &mut self.invocation, + &qemu, + RunQemuOptions { dtb_dump: false }, + ) + .await } pub(crate) async fn uboot( @@ -211,15 +208,14 @@ impl AppContext { ) -> anyhow::Result<()> { let _env_guard = EnvRestoreGuard::set(&cargo.env); self.set_build_config_path(build_config_path); - self.tool - .cargo_run( - &cargo, - &CargoRunnerKind::Uboot(Box::new(CargoUbootRunnerArgs { - uboot, - show_output: true, - })), - ) - .await + let build_config_path = self.build_config_path.clone(); + ostool_build::cargo_run( + &mut self.invocation, + &cargo, + build_config_path.as_deref(), + &CargoRunnerKind::Uboot(Box::new(CargoUbootRunnerArgs { uboot })), + ) + .await } pub(crate) async fn board( @@ -231,9 +227,15 @@ impl AppContext { ) -> anyhow::Result<()> { let _env_guard = EnvRestoreGuard::set(&cargo.env); self.set_build_config_path(build_config_path); - self.tool - .cargo_run_board(&cargo, &board_config, options) - .await + let build_config_path = self.build_config_path.clone(); + ostool_board::cargo_run_board( + &mut self.invocation, + &cargo, + build_config_path.as_deref(), + &board_config, + options, + ) + .await } pub(crate) fn set_debug_mode(&mut self, debug: bool) -> anyhow::Result<()> { @@ -241,21 +243,74 @@ impl AppContext { return Ok(()); } - self.tool = Tool::new(ToolConfig { - debug, - ..ToolConfig::default() - })?; + self.invocation = Self::new_invocation(&self.root, debug) + .context("failed to reinitialize ostool invocation")?; self.debug = debug; - self.tool - .set_build_config_path(self.build_config_path.clone()); - Ok(()) } + pub(crate) async fn read_qemu_config_from_path_for_cargo( + &self, + cargo: &Cargo, + path: &Path, + ) -> anyhow::Result { + ostool_qemu::read_config_from_path_for_cargo(&self.invocation, cargo, path).await + } + + pub(crate) async fn read_uboot_config_from_path_for_cargo( + &self, + cargo: &Cargo, + path: &Path, + ) -> anyhow::Result { + ostool_uboot::read_config_from_path_for_cargo(&self.invocation, cargo, path).await + } + + pub(crate) async fn ensure_uboot_config_for_cargo( + &self, + cargo: &Cargo, + ) -> anyhow::Result { + ostool_uboot::ensure_config_for_cargo(&self.invocation, cargo).await + } + + pub(crate) async fn read_board_run_config_from_path_for_cargo( + &self, + cargo: &Cargo, + path: &Path, + ) -> anyhow::Result { + ostool_board::read_run_config_from_path_for_cargo(&self.invocation, cargo, path).await + } + + pub(crate) async fn ensure_board_run_config_in_dir_for_cargo( + &self, + cargo: &Cargo, + dir: &Path, + ) -> anyhow::Result { + ostool_board::ensure_run_config_in_dir_for_cargo(&self.invocation, cargo, dir).await + } + fn set_build_config_path(&mut self, path: PathBuf) { - self.build_config_path = Some(path.clone()); - self.tool.set_build_config_path(Some(path)); + self.build_config_path = Some(path); + } + + fn activate_cargo_build_context(&mut self, cargo: &Cargo) -> anyhow::Result<()> { + let build_config_path = self.build_config_path.clone(); + ostool_build::activate_build_config( + &mut self.invocation, + &BuildConfig { + system: BuildSystem::Cargo(cargo.clone()), + }, + build_config_path.as_deref(), + ) + } + + fn new_invocation(workspace_root: &Path, debug: bool) -> anyhow::Result { + Invocation::new(InvocationOptions::new( + Some(workspace_root.join("Cargo.toml")), + None, + None, + debug, + )) } fn scoped_qemu_path(&self, cargo: &Cargo) -> anyhow::Result { diff --git a/scripts/axbuild/src/context/tests.rs b/scripts/axbuild/src/context/tests.rs index 5d17625db3..4bc1b1a583 100644 --- a/scripts/axbuild/src/context/tests.rs +++ b/scripts/axbuild/src/context/tests.rs @@ -7,14 +7,14 @@ use std::{ sync::{LazyLock, Mutex}, }; -use ostool::{Tool, ToolConfig}; +use ostool::invocation::{Invocation, InvocationOptions}; use tempfile::tempdir; use super::*; fn test_app_context(root: &Path) -> AppContext { AppContext { - tool: Tool::new(ToolConfig::default()).unwrap(), + invocation: test_invocation(root), build_config_path: None, root: root.to_path_buf(), member_dirs: HashMap::from([("axvisor".to_string(), root.join("os/axvisor"))]), @@ -23,6 +23,32 @@ fn test_app_context(root: &Path) -> AppContext { } } +fn test_invocation(root: &Path) -> Invocation { + let manifest_path = root.join("Cargo.toml"); + if !manifest_path.exists() { + fs::create_dir_all(root.join("src")).unwrap(); + fs::write(root.join("src/lib.rs"), "").unwrap(); + fs::write( + &manifest_path, + r#"[package] +name = "test-workspace" +version = "0.1.0" +edition = "2021" + +[workspace] +"#, + ) + .unwrap(); + } + Invocation::new(InvocationOptions::new( + Some(manifest_path), + None, + None, + false, + )) + .unwrap() +} + fn resolve_arceos_build_info_path( package: &str, target: &str, diff --git a/scripts/axbuild/src/starry/mod.rs b/scripts/axbuild/src/starry/mod.rs index 92a7aa0f9e..a7c794bfdb 100644 --- a/scripts/axbuild/src/starry/mod.rs +++ b/scripts/axbuild/src/starry/mod.rs @@ -407,7 +407,6 @@ impl Starry { let cargo = build::load_cargo_config(&request)?; let mut qemu = self .app - .tool_mut() .read_qemu_config_from_path_for_cargo(&cargo, &test_case.qemu_config_path) .await?; rootfs::patch_rootfs( @@ -442,7 +441,6 @@ impl Starry { let asset_config = test::starry_case_asset_config(); let mut qemu = self .app - .tool_mut() .read_qemu_config_from_path_for_cargo(&cargo, &test_case.qemu_config_path) .await?; qemu_case::apply_grouped_qemu_config(&mut qemu, &test_case, &asset_config.grouped_runner); @@ -563,7 +561,6 @@ impl Starry { match request.uboot_config.as_deref() { Some(path) => self .app - .tool_mut() .read_uboot_config_from_path_for_cargo(cargo, path) .await .map(Some), @@ -579,14 +576,12 @@ impl Starry { match board_config_path { Some(path) => { self.app - .tool_mut() .read_board_run_config_from_path_for_cargo(cargo, path) .await } None => { let workspace_root = self.app.workspace_root().to_path_buf(); self.app - .tool_mut() .ensure_board_run_config_in_dir_for_cargo(cargo, &workspace_root) .await } diff --git a/scripts/axbuild/src/starry/rootfs.rs b/scripts/axbuild/src/starry/rootfs.rs index 4e3b502b16..19bd7d1e77 100644 --- a/scripts/axbuild/src/starry/rootfs.rs +++ b/scripts/axbuild/src/starry/rootfs.rs @@ -90,7 +90,6 @@ pub(super) async fn load_patched_qemu_config( Some(path) => { starry .app - .tool_mut() .read_qemu_config_from_path_for_cargo(cargo, path) .await? } @@ -101,7 +100,6 @@ pub(super) async fn load_patched_qemu_config( ); starry .app - .tool_mut() .read_qemu_config_from_path_for_cargo(cargo, &path) .await? } diff --git a/scripts/axbuild/src/starry/test.rs b/scripts/axbuild/src/starry/test.rs index 67d980e36b..31c78899e4 100644 --- a/scripts/axbuild/src/starry/test.rs +++ b/scripts/axbuild/src/starry/test.rs @@ -754,7 +754,6 @@ impl Starry { for starry_case in cases { let mut qemu = self .app - .tool_mut() .read_qemu_config_from_path_for_cargo(cargo, &starry_case.case.qemu_config_path) .await .with_context(|| {