diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f348c1b995..6e4e1cfe272 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,9 @@ concurrency: cancel-in-progress: true jobs: - # macOS, because `toyos-fat32`'s fixtures are formatted with `newfs_msdos` - # and `hdiutil`. host: if: github.event_name == 'merge_group' || github.event.pull_request.draft == false - runs-on: macos-latest + runs-on: ubuntu-24.04 timeout-minutes: 45 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 @@ -37,7 +35,7 @@ jobs: toyos/target kernel/target bootloader/target - key: host-${{ github.run_id }} - restore-keys: host- + key: host-linux-${{ github.run_id }} + restore-keys: host-linux- - run: cargo run -- --ci host diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3b7808ad94f..c9010b31699 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,7 +17,7 @@ concurrency: jobs: host: - runs-on: macos-latest + runs-on: ubuntu-24.04 timeout-minutes: 90 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 @@ -35,8 +35,8 @@ jobs: toyos/target kernel/target bootloader/target - key: host-${{ github.run_id }} - restore-keys: host- + key: host-linux-${{ github.run_id }} + restore-keys: host-linux- - run: cargo run -- --ci host @@ -46,7 +46,7 @@ jobs: uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: *host-paths - key: host-${{ github.run_id }} + key: host-linux-${{ github.run_id }} # Publishes this tree's toolchain if nobody has, and on main moves the SDK # alias onto it. Bare `ubuntu-24.04`, not a container: its glibc is the @@ -209,3 +209,5 @@ jobs: sh "$RUNNER_TEMP/rustup-init.sh" -y --profile minimal --default-toolchain stable echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - run: env -u GITHUB_ACTIONS -u CI cargo run -- --build-only + # The host suite's macOS arms run here alone: `ci.yml`'s `host` is Linux. + - run: cargo run -- --ci host diff --git a/Cargo.lock b/Cargo.lock index 5a9bffbf3c5..cc05a45c729 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1007,6 +1007,7 @@ version = "0.1.0" name = "toyos-fat32" version = "0.1.0" dependencies = [ + "fatfs", "toyos-fat32-check", "toyos-tmpdir", "toyos-wallclock", diff --git a/NOTICE b/NOTICE index 8738752851e..517fd70bc36 100644 --- a/NOTICE +++ b/NOTICE @@ -309,3 +309,88 @@ the tool, not the bytes a user's own data becomes when the tool writes it: the layout is a published on-disk format, not a copyrightable work of the program, and the file contents are ours. The tool is not distributed with this repository in any form. + + +toyos-fat32/tests/fixtures/ — volumes macOS's FAT tools wrote +-------------------------------------------------------------- + + blank-512.runs 3,672 bytes, of a 67,108,864-byte raw volume + sha256 4f1686152769fb4b064a78b0a2287c8b54bff3ec1e279b35c8f337d538a45f78 + raw 51dfc22ac6ab939a28f8cf113da48cbb75eb0b4f5a4d2b79c9f09522a58fe052 + blank-4k.runs 3,672 bytes, of a 314,572,800-byte raw volume + sha256 14e98fc505450882f4d284fb712d32b4f9e4d50c1bfc86702ace8f0adee745e0 + raw 788974e418ac37cb43f65057f609bd4234b4f5fffb10e8be7563a608b423e137 + read-512.runs 336,152 bytes, of a 67,108,864-byte raw volume + sha256 6bef14efca36070830f5a4a2b1dc9b69a0e2627679cc5c9ed542acaa4ece416c + raw 911903c9338144f65df86a6f98d87c375725806a709db3bb48d772fe3b719fbb + read-4k.runs 55,032 bytes, of a 314,572,800-byte raw volume + sha256 cab78e1ea6c46b0a04a0de32a24f1a6ac90a2017dd7188745de2d603c5ab121b + raw cb4cefe9a9b2b17371ec20fa8a49b16475f2434ff5ed5d9277c99bef3cdd592c + hostile.runs 36,536 bytes, of a 67,108,864-byte raw volume + sha256 c570b3c6944f47d2cd1498da14f12c4a98dc85683f782624181917eba68f9066 + raw 1750198122459dee8f1b4d54ac460d9689279189d6ff59f6072d57d00dbbd68e + empty-file.runs 6,264 bytes, of a 67,108,864-byte raw volume + sha256 68a6abf1626e4bdf6b3586d3f52b2d7051390e4e18beb31258dd0021bb3e96b9 + raw ff0e162a36ccf76d1aa5cb36ce47c0d728442bf926d59af498d0d55820bcfd85 + Boot stub: Copyright (c) 1998 Robert Nordier + Licence text: licenses/BSD-2-Clause-newfs_msdos.txt + SPDX-License-Identifier: (MIT OR Apache-2.0) AND BSD-2-Clause + +`toyos-fat32`'s host tests read these volumes, and write into the two blank +ones. The only honest judge of a FAT reader is bytes a FAT implementation that +is not ours wrote, and these are those bytes. Each is committed as its runs of +nonzero 512-byte sectors, which `Image::fixture` in +`toyos-fat32/tests/common/mod.rs` expands into a sparse file; the raw digest is +of that expansion, and equals the digest of what the tools wrote. + +They were made once, on macOS 27.0.1 (build 26A434), with Apple's `msdosfs` +project at SourceVersion 845000003000001 (`/sbin/newfs_msdos`, sha256 +29b3d7daa299583015c823ea6ebce643c030a79c8bc26b9bf9c23deb4c6d1a73) and +`/usr/bin/hdiutil`, by a throwaway program making the invocations +`toyos-fat32/tests/common/mod.rs` made at fa134154c with a fixed label. Per +volume, on a sparse file of the raw size: + + hdiutil attach -imagekey diskimage-class=CRawDiskImage -nobrowse -nomount + newfs_msdos -F 32 -S 512 -c -v