Repository navigation
Repair fuzz and Meson builds, and add GitHub Actions #36
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,197 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CARGO_BUILD_JOBS: 3 | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| style: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 | ||
| with: | ||
| toolchain: stable | ||
| components: rustfmt,clippy | ||
| - name: Install tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y nasm pipx | ||
| pipx install clang-format==23.1.1 | ||
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| - name: Format and lint | ||
| run: | | ||
| ./scripts/stylecheck.sh | ||
| git diff --exit-code | ||
|
|
||
| tests: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 25 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| asm: ['true', 'false'] | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: halidecx/wpd-test-data | ||
| ref: f8c31341db3ab4400f048a96e7b3736fed303b34 | ||
| path: wpd-test-data | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 | ||
| with: | ||
| toolchain: stable | ||
| - name: Install tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y pipx ninja-build nasm cmake | ||
| pipx install meson==1.12.1 | ||
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| - name: Tests, C API, parity and checkasm | ||
| env: | ||
| ASM: ${{ matrix.asm }} | ||
| run: | | ||
| meson setup build -Denable_asm="$ASM" -Dtrim_dsp=false \ | ||
| -Dtestdata_tests=true -Dlibwebp=subproject -Dwuffs=disabled | ||
| if [ "$ASM" = true ]; then | ||
| meson test -C build --list | grep -q checkasm | ||
| fi | ||
| meson test -C build --print-errorlogs --num-processes 3 | ||
|
|
||
| scripts: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: halidecx/wpd-test-data | ||
| ref: f8c31341db3ab4400f048a96e7b3736fed303b34 | ||
| path: wpd-test-data | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 | ||
| with: | ||
| toolchain: stable | ||
| - name: Install tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y pipx ninja-build nasm cmake webp | ||
| pipx install meson==1.12.1 | ||
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| - name: Build assembly and fallback tools | ||
| run: | | ||
| meson setup build -Dtrim_dsp=false -Dtestdata_tests=true \ | ||
| -Dlibwebp=subproject -Dwuffs=disabled | ||
| meson compile -C build -j 3 libwebpdec | ||
| meson setup build-noasm -Denable_asm=false \ | ||
| -Dlibwebp=disabled -Dwuffs=disabled | ||
| meson compile -C build-noasm -j 3 | ||
| - name: Existing correctness checks | ||
| run: | | ||
| ./scripts/testdata.sh | ||
| ./scripts/animcheck.sh | ||
| ./scripts/threadcheck.sh | ||
| ./scripts/md5check.sh ./build-noasm/wpd ./build/wpd | ||
| ./scripts/clicheck.sh ./build-noasm/wpd ./build/wpd | ||
| ./scripts/rac32.sh --print-errorlogs --num-processes 3 | ||
|
|
||
| c-sanitizers: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: halidecx/wpd-test-data | ||
| ref: f8c31341db3ab4400f048a96e7b3736fed303b34 | ||
| path: wpd-test-data | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 | ||
| with: | ||
| toolchain: stable | ||
| - name: Install tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y pipx ninja-build nasm cmake | ||
| pipx install meson==1.12.1 | ||
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| - name: C harnesses and damaged-input smoke | ||
| run: | | ||
| ./scripts/sanitize.sh --print-errorlogs --num-processes 3 | ||
| ./scripts/fuzz.sh 8 wpd-test-data/odd_lossy.webp \ | ||
| wpd-test-data/odd_a_lossy.webp wpd-test-data/palette_rgb.webp \ | ||
| wpd-test-data/mixed_codecs.webp | ||
|
|
||
| nightly: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| check: [rustsan, tsan, miri, fuzz] | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: halidecx/wpd-test-data | ||
| ref: f8c31341db3ab4400f048a96e7b3736fed303b34 | ||
| path: wpd-test-data | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 | ||
| with: | ||
| toolchain: nightly | ||
| components: rust-src,miri | ||
| - name: Install tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y pipx ninja-build nasm cmake clang | ||
| pipx install meson==1.12.1 | ||
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| - name: Nightly check | ||
| env: | ||
| CHECK: ${{ matrix.check }} | ||
| run: | | ||
| case "$CHECK" in | ||
| rustsan) | ||
| meson setup build -Dlibwebp=disabled -Dwuffs=disabled | ||
| meson compile -C build -j 3 | ||
| ./scripts/rustsan.sh | ||
| ;; | ||
| tsan) ./scripts/tsan.sh ;; | ||
| miri) ./scripts/miri.sh --lib container::tests ;; | ||
| fuzz) | ||
| cargo install cargo-fuzz --version 0.13.2 --locked | ||
| ./scripts/fuzz-smoke.sh | ||
| ;; | ||
| esac | ||
| - name: Save fuzz failures | ||
| if: failure() && matrix.check == 'fuzz' | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: fuzz-failures | ||
| path: fuzz/artifacts | ||
| if-no-files-found: ignore |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this file added? please remove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Changelog | ||
|
|
||
| ## Unreleased — 0.2.0 | ||
|
|
||
| ### Build and CI | ||
|
|
||
| - Repair the end-to-end fuzz target's decoder options initializer so all four | ||
| coverage-guided targets build again. | ||
| - Correct the optional Wuffs dependency name in the Meson build. | ||
| - Add one GitHub Actions workflow for tests, rustfmt/clippy, fuzz target builds, | ||
| seeded smoke runs, and the existing correctness and sanitizer checks. | ||
| - Bound fuzz-harness pictures to one megapixel so mutated dimensions fit the | ||
| smoke run's memory budget without changing decoder limits. |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove all README additions please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| pub const MAX_PIXELS: u32 = 1 << 20; | ||
|
|
||
| pub fn fits(data: &[u8]) -> bool { | ||
| // Keep malformed headers in coverage; only a successfully read size can | ||
| // exceed the harness budget. Raw codecs have no decoder options limit. | ||
| wpd::api::info(data).map_or(true, |info| { | ||
| wpd::api::Options { | ||
| frame_size_limit: MAX_PIXELS, | ||
| ..Default::default() | ||
| } | ||
| .fits(info.width, info.height) | ||
| }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
|
|
||
| #![no_main] | ||
|
|
||
| use libfuzzer_sys::fuzz_target; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add CI, but I'll be adding it myself – please remove