diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index b4e89fa8e..ce48aa395 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -10,7 +10,6 @@ jobs: name: Check source runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable @@ -18,13 +17,13 @@ jobs: with: name: coliasgroup authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: actions/checkout@v3 - name: Check source run: make check-source check-dependencies: name: Check dependencies runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable @@ -32,6 +31,7 @@ jobs: with: name: coliasgroup authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: actions/checkout@v3 - name: Check dependencies run: make check-dependencies run-sel4test: @@ -42,7 +42,6 @@ jobs: matrix: arch: [aarch64, aarch32, riscv64, riscv32, x86_64, ia32] steps: - - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable @@ -50,13 +49,25 @@ jobs: with: name: coliasgroup authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: actions/checkout@v3 - name: Build and check run: make run-sel4test-for SEL4TEST_ARCH=${{ matrix.arch }} run-other-tests: name: Run other tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Prepare to maximize build space + run: sudo mkdir /nix + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + build-mount-path: /nix + root-reserve-mb: 8192 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable @@ -64,13 +75,13 @@ jobs: with: name: coliasgroup authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: actions/checkout@v3 - name: Run tests run: make run-fast-tests build-docs: name: Build docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable @@ -78,6 +89,7 @@ jobs: with: name: coliasgroup authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: actions/checkout@v3 - name: Build docs run: make html-links build-everything: @@ -85,7 +97,18 @@ jobs: runs-on: ubuntu-latest needs: [check-source, run-sel4test, run-other-tests, build-docs] steps: - - uses: actions/checkout@v3 + - name: Prepare to maximize build space + run: sudo mkdir /nix + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + build-mount-path: /nix + root-reserve-mb: 8192 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' - uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-unstable @@ -93,6 +116,7 @@ jobs: with: name: coliasgroup authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - uses: actions/checkout@v3 - name: Build everything run: make everything - name: Expose docs @@ -122,18 +146,7 @@ jobs: # # May be necessary in the future: # -# - name: Prepare to maximize build space -# run: sudo mkdir /nix -# - name: Maximize build space -# uses: easimon/maximize-build-space@master -# with: -# build-mount-path: /nix -# root-reserve-mb: 8192 -# remove-dotnet: 'true' -# remove-android: 'true' -# remove-haskell: 'true' -# remove-codeql: 'true' -# remove-docker-images: 'true' + # # For debugging and monitoring disk usage: # (make foo && df -h) || (df -h && false) diff --git a/Cargo.lock b/Cargo.lock index f7128cba8..b08aacc5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2447,6 +2447,7 @@ dependencies = [ "sel4-async-request-statuses", "sel4-async-single-threaded-executor", "sel4-async-timers", + "sel4-async-unsync", "sel4-bounce-buffer-allocator", "sel4-config", "sel4-externally-shared", diff --git a/crates/examples/microkit/http-server/pds/virtio-blk-driver/src/main.rs b/crates/examples/microkit/http-server/pds/virtio-blk-driver/src/main.rs index f8da7461e..2113b481d 100644 --- a/crates/examples/microkit/http-server/pds/virtio-blk-driver/src/main.rs +++ b/crates/examples/microkit/http-server/pds/virtio-blk-driver/src/main.rs @@ -208,7 +208,7 @@ impl Handler for HandlerImpl { CLIENT => match msg_info.recv_using_postcard::() { Ok(req) => match req { Request::GetNumBlocks => { - let num_blocks = self.dev.capacity().try_into().unwrap(); + let num_blocks = self.dev.capacity(); MessageInfo::send_using_postcard(GetNumBlocksResponse { num_blocks }) .unwrap() } diff --git a/crates/private/meta/Cargo.toml b/crates/private/meta/Cargo.toml index 8e658be45..f682caca8 100644 --- a/crates/private/meta/Cargo.toml +++ b/crates/private/meta/Cargo.toml @@ -20,6 +20,7 @@ sel4-async-network = { path = "../../sel4-async/network" } sel4-async-request-statuses = { path = "../../sel4-async/request-statuses" } sel4-async-single-threaded-executor = { path = "../../sel4-async/single-threaded-executor" } sel4-async-timers = { path = "../../sel4-async/timers" } +sel4-async-unsync = { path = "../../sel4-async/unsync" } sel4-bounce-buffer-allocator = { path = "../../sel4-bounce-buffer-allocator" } sel4-config = { path = "../../sel4/config" } sel4-immediate-sync-once-cell = { path = "../../sel4-immediate-sync-once-cell" } diff --git a/crates/private/meta/src/lib.rs b/crates/private/meta/src/lib.rs index 9284c8531..98279f4f2 100644 --- a/crates/private/meta/src/lib.rs +++ b/crates/private/meta/src/lib.rs @@ -81,6 +81,7 @@ definitely! { sel4_async_request_statuses sel4_async_single_threaded_executor sel4_async_timers + sel4_async_unsync sel4_bounce_buffer_allocator sel4_config sel4_externally_shared diff --git a/crates/sel4-async/block-io/fat/src/dummy_time_source.rs b/crates/sel4-async/block-io/fat/src/dummy_time_source.rs index c9a5ccd58..607a26c9d 100644 --- a/crates/sel4-async/block-io/fat/src/dummy_time_source.rs +++ b/crates/sel4-async/block-io/fat/src/dummy_time_source.rs @@ -1,5 +1,6 @@ pub use embedded_fat as fat; +#[derive(Default)] pub struct DummyTimeSource(()); impl DummyTimeSource { diff --git a/crates/sel4-async/unsync/src/mutex.rs b/crates/sel4-async/unsync/src/mutex.rs index b950b583f..6e4b33b51 100644 --- a/crates/sel4-async/unsync/src/mutex.rs +++ b/crates/sel4-async/unsync/src/mutex.rs @@ -39,12 +39,12 @@ impl Deref for Guard<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { - &*self.ref_mut + &self.ref_mut } } impl DerefMut for Guard<'_, T> { fn deref_mut(&mut self) -> &mut Self::Target { - &mut *self.ref_mut + &mut self.ref_mut } } diff --git a/crates/sel4-backtrace/embedded-debug-info/cli/src/bin/sel4-embed-debug-info.rs b/crates/sel4-backtrace/embedded-debug-info/cli/src/bin/sel4-embed-debug-info.rs index 55a1487d5..982644772 100644 --- a/crates/sel4-backtrace/embedded-debug-info/cli/src/bin/sel4-embed-debug-info.rs +++ b/crates/sel4-backtrace/embedded-debug-info/cli/src/bin/sel4-embed-debug-info.rs @@ -78,5 +78,5 @@ fn with_bit_width>( input .concrete_patches .push(("embedded_debug_info_size".to_owned(), content_len)); - input.render_with_data(&image_elf).unwrap() + input.render_with_data(image_elf).unwrap() } diff --git a/crates/sel4-kernel-loader/build.rs b/crates/sel4-kernel-loader/build.rs index b22d80e1d..e8b1ee116 100644 --- a/crates/sel4-kernel-loader/build.rs +++ b/crates/sel4-kernel-loader/build.rs @@ -1,4 +1,5 @@ #![feature(int_roundings)] +#![allow(clippy::useless_conversion)] use std::env; use std::fs; diff --git a/crates/sel4-kernel-loader/embed-page-tables/src/embed.rs b/crates/sel4-kernel-loader/embed-page-tables/src/embed.rs index 191ad66c5..bfea8caa0 100644 --- a/crates/sel4-kernel-loader/embed-page-tables/src/embed.rs +++ b/crates/sel4-kernel-loader/embed-page-tables/src/embed.rs @@ -56,7 +56,7 @@ impl Embedding { } } - fn embed<'a, T: Scheme>(mut self, table: &'a Table) -> TokenStream { + fn embed(mut self, table: &Table) -> TokenStream { let _ = self.embed_inner(table); self.check_tables_order(); let runtime_mod_ident = self.runtime_mod_ident; @@ -82,7 +82,7 @@ impl Embedding { }); } - fn embed_inner<'a, T: Scheme>(&mut self, table: &'a Table) -> usize { + fn embed_inner(&mut self, table: &Table) -> usize { let index = self.allocate_index(); let entries = table.entries.iter().map(|entry| { let entry = EntryForEmbedding::::from_abstract_entry(entry); diff --git a/crates/sel4-kernel-loader/embed-page-tables/src/regions.rs b/crates/sel4-kernel-loader/embed-page-tables/src/regions.rs index d21b6f90b..fc99162fb 100644 --- a/crates/sel4-kernel-loader/embed-page-tables/src/regions.rs +++ b/crates/sel4-kernel-loader/embed-page-tables/src/regions.rs @@ -12,7 +12,7 @@ impl AbstractRegion { Self { range, content } } - fn to_arc(self) -> AbstractRegion> { + fn into_arc(self) -> AbstractRegion> { AbstractRegion { range: self.range, content: Arc::new(self.content), @@ -33,7 +33,7 @@ pub struct AbstractRegions { impl AbstractRegionsBuilder { pub fn new_with_background(background: AbstractRegion) -> Self { Self { - regions: vec![background.to_arc()], + regions: vec![background.into_arc()], } } @@ -67,7 +67,7 @@ impl AbstractRegionsBuilder { let new_regions = regions[..i_left] .iter() .chain( - [left, region.to_arc(), right] + [left, region.into_arc(), right] .iter() .filter(|r| r.range.start < r.range.end), ) diff --git a/crates/sel4-kernel-loader/embed-page-tables/src/table.rs b/crates/sel4-kernel-loader/embed-page-tables/src/table.rs index aa3a26262..0e947d525 100644 --- a/crates/sel4-kernel-loader/embed-page-tables/src/table.rs +++ b/crates/sel4-kernel-loader/embed-page-tables/src/table.rs @@ -125,7 +125,7 @@ where } fn current_content(&self) -> Option<&RegionContent> { - (&*self.current().content).as_ref() + (*self.current().content).as_ref() } fn advance(&mut self) -> bool { diff --git a/crates/sel4-kernel-loader/payload-types/src/lib.rs b/crates/sel4-kernel-loader/payload-types/src/lib.rs index 05719f74d..bf8e00b1f 100644 --- a/crates/sel4-kernel-loader/payload-types/src/lib.rs +++ b/crates/sel4-kernel-loader/payload-types/src/lib.rs @@ -1,6 +1,7 @@ #![no_std] #![feature(strict_provenance)] #![deny(unsafe_op_in_unsafe_fn)] +#![allow(clippy::useless_conversion)] use core::ops::Range; use core::ptr; @@ -117,6 +118,7 @@ impl<'a> RegionContent for DirectRegionContent<'a> { } impl Payload { + #[allow(clippy::missing_safety_doc)] pub unsafe fn copy_data_out(&self, region_content_source: &U::Source) { for region in self.data.iter() { let dst = unsafe { diff --git a/crates/sel4-kernel-loader/src/main.rs b/crates/sel4-kernel-loader/src/main.rs index df3ac4306..2b05673a5 100644 --- a/crates/sel4-kernel-loader/src/main.rs +++ b/crates/sel4-kernel-loader/src/main.rs @@ -11,6 +11,7 @@ #![feature(stdsimd)] #![allow(dead_code)] #![allow(unreachable_code)] +#![allow(clippy::reversed_empty_ranges)] use spin::RwLock; diff --git a/crates/sel4-shared-ring-buffer/block-io/src/lib.rs b/crates/sel4-shared-ring-buffer/block-io/src/lib.rs index 234bb9d6c..a4e65e825 100644 --- a/crates/sel4-shared-ring-buffer/block-io/src/lib.rs +++ b/crates/sel4-shared-ring-buffer/block-io/src/lib.rs @@ -2,6 +2,7 @@ #![feature(async_fn_in_trait)] #![feature(never_type)] #![feature(strict_provenance)] +#![allow(clippy::useless_conversion)] extern crate alloc; diff --git a/crates/sel4/src/bootinfo.rs b/crates/sel4/src/bootinfo.rs index 0587ac990..818b93be8 100644 --- a/crates/sel4/src/bootinfo.rs +++ b/crates/sel4/src/bootinfo.rs @@ -1,3 +1,5 @@ +#![allow(clippy::useless_conversion)] + use core::mem; use core::ops::Range; use core::slice; diff --git a/crates/sel4/src/invocations.rs b/crates/sel4/src/invocations.rs index db7a17034..96f9d9e68 100644 --- a/crates/sel4/src/invocations.rs +++ b/crates/sel4/src/invocations.rs @@ -1,3 +1,5 @@ +#![allow(clippy::useless_conversion)] + use core::mem; use sel4_config::{sel4_cfg, sel4_cfg_if}; diff --git a/crates/sel4/sys/build/xml/invocations/mod.rs b/crates/sel4/sys/build/xml/invocations/mod.rs index b56e171a6..274521d88 100644 --- a/crates/sel4/sys/build/xml/invocations/mod.rs +++ b/crates/sel4/sys/build/xml/invocations/mod.rs @@ -1,3 +1,6 @@ +#![allow(clippy::eq_op)] +#![allow(clippy::nonminimal_bool)] + use std::collections::BTreeMap; use std::fmt::Write; use std::ops::Range; diff --git a/hacking/cargo-manifest-sources/crates/private/meta/crate.nix b/hacking/cargo-manifest-sources/crates/private/meta/crate.nix index 7d4cf626c..c20f21706 100644 --- a/hacking/cargo-manifest-sources/crates/private/meta/crate.nix +++ b/hacking/cargo-manifest-sources/crates/private/meta/crate.nix @@ -20,6 +20,7 @@ mk { sel4-async-request-statuses sel4-async-single-threaded-executor sel4-async-timers + sel4-async-unsync sel4-bounce-buffer-allocator sel4-externally-shared sel4-immediate-sync-once-cell