mirror of
https://github.com/uutils/diffutils.git
synced 2026-06-10 15:48:59 -07:00
Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc9ca179f3 | |||
| f29e96cdba | |||
| a46dae68b1 | |||
| 1a8d7f96a6 | |||
| 53599ccd40 | |||
| 9bc64f03ed | |||
| d266f9b90e | |||
| ec3428b48f | |||
| 58da229c09 | |||
| 250f935efe | |||
| 1254f146f8 | |||
| c1943c5abb | |||
| d33aca1fff | |||
| 649179069c | |||
| 9fe96ed5e9 | |||
| 2c47ea9f04 | |||
| 9a7a727da4 | |||
| a24b0c391e | |||
| 3f2c8678da | |||
| d73fa831b0 | |||
| be90f75e68 | |||
| 259e51d0d4 | |||
| da98437b08 | |||
| 54db7b0b3e | |||
| c811142a6c | |||
| 4043bb1928 | |||
| d11f672d29 | |||
| 37abce4eab | |||
| a340afb6d1 | |||
| 18c5533b82 | |||
| 34f3935b71 | |||
| 904efda150 | |||
| af3e010b26 | |||
| 0001b2036e | |||
| 8aa2a2cb7c | |||
| 23890b6c94 | |||
| 5fc37c7c73 | |||
| f4895861db | |||
| 25cad28b99 | |||
| 454f5436ce | |||
| 2efd4e17fa | |||
| 9dcca24fb0 | |||
| 5660d0eafb | |||
| c624dc489d |
@@ -0,0 +1,100 @@
|
|||||||
|
name: GnuComment
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["GnuTests"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post-comment:
|
||||||
|
permissions:
|
||||||
|
actions: read # to list workflow runs artifacts
|
||||||
|
pull-requests: write # to comment on pr
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
github.event.workflow_run.event == 'pull_request'
|
||||||
|
steps:
|
||||||
|
- name: 'Download artifact'
|
||||||
|
uses: actions/github-script@v9
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
// List all artifacts from GnuTests
|
||||||
|
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: ${{ github.event.workflow_run.id }},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Download the "comment" artifact, which contains a PR number (NR) and result.txt
|
||||||
|
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
||||||
|
return artifact.name == "comment"
|
||||||
|
})[0];
|
||||||
|
|
||||||
|
if (!matchArtifact) {
|
||||||
|
console.log('No comment artifact found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var download = await github.rest.actions.downloadArtifact({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
artifact_id: matchArtifact.id,
|
||||||
|
archive_format: 'zip',
|
||||||
|
});
|
||||||
|
var fs = require('fs');
|
||||||
|
fs.writeFileSync('${{ github.workspace }}/comment.zip', Buffer.from(download.data));
|
||||||
|
|
||||||
|
- run: unzip comment.zip || echo "Failed to unzip comment artifact"
|
||||||
|
|
||||||
|
- name: 'Comment on PR'
|
||||||
|
uses: actions/github-script@v9
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
// Check if files exist
|
||||||
|
if (!fs.existsSync('./NR')) {
|
||||||
|
console.log('No NR file found, skipping comment');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!fs.existsSync('./result.txt')) {
|
||||||
|
console.log('No result.txt file found, skipping comment');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var issue_number = Number(fs.readFileSync('./NR'));
|
||||||
|
var content = fs.readFileSync('./result.txt');
|
||||||
|
|
||||||
|
if (content.toString().trim().length > 7) { // 7 because we have backquote + \n
|
||||||
|
// Update existing comment if present, otherwise create a new one
|
||||||
|
var marker = '<!-- gnu-tests-bot -->';
|
||||||
|
var body = marker + '\nGNU diffutils testsuite comparison:\n```\n' + content + '```';
|
||||||
|
var comments = await github.rest.issues.listComments({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue_number,
|
||||||
|
});
|
||||||
|
var existing = comments.data.filter(c => c.body.includes(marker))[0];
|
||||||
|
if (existing) {
|
||||||
|
await github.rest.issues.updateComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
comment_id: existing.id,
|
||||||
|
body: body,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue_number,
|
||||||
|
body: body,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('Comment content too short, skipping');
|
||||||
|
}
|
||||||
@@ -0,0 +1,231 @@
|
|||||||
|
name: GnuTests
|
||||||
|
|
||||||
|
# Run GNU diffutils testsuite against the Rust diffutils implementation
|
||||||
|
# and compare results against the main branch to catch regressions
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # Publish diffutils instead of discarding
|
||||||
|
|
||||||
|
# End the current execution if there is a new changeset in the PR
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
||||||
|
TEST_FULL_SUMMARY_FILE: 'diffutils-gnu-full-result.json'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
native:
|
||||||
|
name: Run GNU diffutils testsuite
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
### Build
|
||||||
|
- name: Build Rust diffutils binary
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
## Build Rust diffutils binary
|
||||||
|
cargo build --config=profile.release.strip=true --profile=release
|
||||||
|
zstd -19 target/release/diffutils -o diffutils-x86_64-unknown-linux-gnu.zst
|
||||||
|
|
||||||
|
- name: Publish latest commit
|
||||||
|
uses: softprops/action-gh-release@v3
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
with:
|
||||||
|
tag_name: latest-commit
|
||||||
|
body: |
|
||||||
|
commit: ${{ github.sha }}
|
||||||
|
draft: false
|
||||||
|
prerelease: true
|
||||||
|
files: |
|
||||||
|
diffutils-x86_64-unknown-linux-gnu.zst
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
### Run tests
|
||||||
|
- name: Run GNU diffutils testsuite
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
## Run GNU diffutils testsuite
|
||||||
|
./tests/run-upstream-testsuite.sh release || true
|
||||||
|
env:
|
||||||
|
TERM: xterm
|
||||||
|
|
||||||
|
- name: Upload full json results
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffutils-gnu-full-result
|
||||||
|
path: tests/test-results.json
|
||||||
|
if-no-files-found: warn
|
||||||
|
|
||||||
|
aggregate:
|
||||||
|
needs: [native]
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
name: Aggregate GNU test results
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Initialize workflow variables
|
||||||
|
id: vars
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
## VARs setup
|
||||||
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
|
|
||||||
|
TEST_SUMMARY_FILE='diffutils-gnu-result.json'
|
||||||
|
outputs TEST_SUMMARY_FILE
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Retrieve reference artifacts
|
||||||
|
uses: dawidd6/action-download-artifact@v21
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
workflow: GnuTests.yml
|
||||||
|
branch: "${{ env.DEFAULT_BRANCH }}"
|
||||||
|
workflow_conclusion: completed
|
||||||
|
path: "reference"
|
||||||
|
if_no_artifact_found: warn
|
||||||
|
|
||||||
|
- name: Download full json results
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffutils-gnu-full-result
|
||||||
|
path: results
|
||||||
|
|
||||||
|
- name: Extract/summarize testing info
|
||||||
|
id: summary
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
## Extract/summarize testing info
|
||||||
|
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||||
|
|
||||||
|
RESULT_FILE="results/test-results.json"
|
||||||
|
if [[ ! -f "$RESULT_FILE" ]]; then
|
||||||
|
echo "::error ::Missing test results at $RESULT_FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TOTAL=$(jq '[.tests[]] | length' "$RESULT_FILE")
|
||||||
|
PASS=$(jq '[.tests[] | select(.result=="PASS")] | length' "$RESULT_FILE")
|
||||||
|
FAIL=$(jq '[.tests[] | select(.result=="FAIL")] | length' "$RESULT_FILE")
|
||||||
|
SKIP=$(jq '[.tests[] | select(.result=="SKIP")] | length' "$RESULT_FILE")
|
||||||
|
ERROR=0
|
||||||
|
|
||||||
|
output="GNU diffutils tests summary = TOTAL: $TOTAL / PASS: $PASS / FAIL: $FAIL / SKIP: $SKIP"
|
||||||
|
echo "${output}"
|
||||||
|
|
||||||
|
if [[ "$FAIL" -gt 0 ]]; then
|
||||||
|
echo "::warning ::${output}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
jq -n \
|
||||||
|
--arg date "$(date --rfc-email)" \
|
||||||
|
--arg sha "$GITHUB_SHA" \
|
||||||
|
--arg total "$TOTAL" \
|
||||||
|
--arg pass "$PASS" \
|
||||||
|
--arg skip "$SKIP" \
|
||||||
|
--arg fail "$FAIL" \
|
||||||
|
--arg error "$ERROR" \
|
||||||
|
'{($date): { sha: $sha, total: $total, pass: $pass, skip: $skip, fail: $fail, error: $error }}' > '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}'
|
||||||
|
|
||||||
|
HASH=$(sha1sum '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' | cut --delim=" " -f 1)
|
||||||
|
outputs HASH TOTAL PASS FAIL SKIP
|
||||||
|
|
||||||
|
- name: Upload SHA1/ID of 'test-summary'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "${{ steps.summary.outputs.HASH }}"
|
||||||
|
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
|
||||||
|
|
||||||
|
- name: Upload test results summary
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: test-summary
|
||||||
|
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
|
||||||
|
|
||||||
|
- name: Compare test failures VS reference
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
## Compare test failures VS reference
|
||||||
|
REF_SUMMARY_FILE='reference/diffutils-gnu-full-result/test-results.json'
|
||||||
|
CURRENT_SUMMARY_FILE="results/test-results.json"
|
||||||
|
|
||||||
|
IGNORE_INTERMITTENT=".github/workflows/ignore-intermittent.txt"
|
||||||
|
|
||||||
|
COMMENT_DIR="reference/comment"
|
||||||
|
mkdir -p ${COMMENT_DIR}
|
||||||
|
echo ${{ github.event.number }} > ${COMMENT_DIR}/NR
|
||||||
|
COMMENT_LOG="${COMMENT_DIR}/result.txt"
|
||||||
|
|
||||||
|
COMPARISON_RESULT=0
|
||||||
|
if test -f "${CURRENT_SUMMARY_FILE}"; then
|
||||||
|
if test -f "${REF_SUMMARY_FILE}"; then
|
||||||
|
echo "Reference summary SHA1/ID: $(sha1sum -- "${REF_SUMMARY_FILE}")"
|
||||||
|
echo "Current summary SHA1/ID: $(sha1sum -- "${CURRENT_SUMMARY_FILE}")"
|
||||||
|
|
||||||
|
python3 util/compare_test_results.py \
|
||||||
|
--ignore-file "${IGNORE_INTERMITTENT}" \
|
||||||
|
--output "${COMMENT_LOG}" \
|
||||||
|
"${CURRENT_SUMMARY_FILE}" "${REF_SUMMARY_FILE}"
|
||||||
|
|
||||||
|
COMPARISON_RESULT=$?
|
||||||
|
else
|
||||||
|
echo "::warning ::Skipping test comparison; no prior reference summary is available at '${REF_SUMMARY_FILE}'."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "::error ::Failed to find summary of test results (missing '${CURRENT_SUMMARY_FILE}'); failing early"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${COMPARISON_RESULT} -eq 1 ]; then
|
||||||
|
echo "::error ::Found new non-intermittent test failures"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "::notice ::No new test failures detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload comparison log (for GnuComment workflow)
|
||||||
|
if: success() || failure()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: comment
|
||||||
|
path: reference/comment/
|
||||||
|
|
||||||
|
- name: Report test results
|
||||||
|
if: success() || failure()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
## Report final results
|
||||||
|
echo "::notice ::GNU diffutils testsuite results:"
|
||||||
|
echo "::notice :: Total tests: ${{ steps.summary.outputs.TOTAL }}"
|
||||||
|
echo "::notice :: Passed: ${{ steps.summary.outputs.PASS }}"
|
||||||
|
echo "::notice :: Failed: ${{ steps.summary.outputs.FAIL }}"
|
||||||
|
echo "::notice :: Skipped: ${{ steps.summary.outputs.SKIP }}"
|
||||||
|
|
||||||
|
if [[ "${{ steps.summary.outputs.FAIL }}" -gt 0 ]]; then
|
||||||
|
PASS_RATE=$(( ${{ steps.summary.outputs.PASS }} * 100 / (${{ steps.summary.outputs.PASS }} + ${{ steps.summary.outputs.FAIL }}) ))
|
||||||
|
echo "::notice :: Pass rate: ${PASS_RATE}%"
|
||||||
|
fi
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
name: Security audit
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
jobs:
|
||||||
|
audit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: rustsec/audit-check@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -31,7 +31,6 @@ jobs:
|
|||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
brew install gpatch
|
brew install gpatch
|
||||||
echo "/opt/homebrew/opt/gpatch/libexec/gnubin" >> "$GITHUB_PATH"
|
|
||||||
- name: set up PATH on Windows
|
- name: set up PATH on Windows
|
||||||
# Needed to use GNU's patch.exe instead of Strawberry Perl patch
|
# Needed to use GNU's patch.exe instead of Strawberry Perl patch
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -56,39 +55,10 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: cargo clippy -- -D warnings
|
- run: cargo clippy -- -D warnings
|
||||||
|
|
||||||
gnu-testsuite:
|
|
||||||
permissions:
|
|
||||||
contents: write # Publish diffutils instead of discarding
|
|
||||||
name: GNU test suite
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: |
|
|
||||||
cargo build --config=profile.release.strip=true --profile=release #-fast
|
|
||||||
zstd -19 target/release/diffutils -o diffutils-x86_64-unknown-linux-gnu.zst
|
|
||||||
# do not fail, the report is merely informative (at least until all tests pass reliably)
|
|
||||||
- run: ./tests/run-upstream-testsuite.sh release || true
|
|
||||||
env:
|
|
||||||
TERM: xterm
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: test-results.json
|
|
||||||
path: tests/test-results.json
|
|
||||||
- run: ./tests/print-test-results.sh tests/test-results.json
|
|
||||||
- name: Publish latest commit
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
||||||
with:
|
|
||||||
tag_name: latest-commit
|
|
||||||
draft: false
|
|
||||||
prerelease: true
|
|
||||||
files: |
|
|
||||||
diffutils-x86_64-unknown-linux-gnu.zst
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
name: Code Coverage
|
name: Code Coverage
|
||||||
|
env:
|
||||||
|
RUSTC_BOOTSTRAP: 1
|
||||||
runs-on: ${{ matrix.job.os }}
|
runs-on: ${{ matrix.job.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -100,9 +70,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
env:
|
|
||||||
# Use -Z
|
|
||||||
RUSTC_BOOTSTRAP: 1
|
|
||||||
id: vars
|
id: vars
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -117,7 +84,6 @@ jobs:
|
|||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
brew install gpatch
|
brew install gpatch
|
||||||
echo "/opt/homebrew/opt/gpatch/libexec/gnubin" >> "$GITHUB_PATH"
|
|
||||||
- name: set up PATH on Windows
|
- name: set up PATH on Windows
|
||||||
# Needed to use GNU's patch.exe instead of Strawberry Perl patch
|
# Needed to use GNU's patch.exe instead of Strawberry Perl patch
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -125,17 +91,11 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: cargo test --all-features --no-fail-fast
|
run: cargo test --all-features --no-fail-fast
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: "0"
|
|
||||||
RUSTC_WRAPPER: ""
|
RUSTC_WRAPPER: ""
|
||||||
RUSTFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
RUSTFLAGS: "-Cinstrument-coverage -Zcoverage-options=branch -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
||||||
RUSTDOCFLAGS: "-Cpanic=abort"
|
RUSTDOCFLAGS: "-Cpanic=abort"
|
||||||
LLVM_PROFILE_FILE: "diffutils-%p-%m.profraw"
|
LLVM_PROFILE_FILE: "diffutils-%p-%m.profraw"
|
||||||
# Use -Z
|
|
||||||
RUSTC_BOOTSTRAP: 1
|
|
||||||
- name: "`grcov` ~ install"
|
- name: "`grcov` ~ install"
|
||||||
env:
|
|
||||||
# Use -Z
|
|
||||||
RUSTC_BOOTSTRAP: 1
|
|
||||||
id: build_grcov
|
id: build_grcov
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -167,7 +127,7 @@ jobs:
|
|||||||
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --binary-path "${COVERAGE_REPORT_DIR}" --branch
|
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --binary-path "${COVERAGE_REPORT_DIR}" --branch
|
||||||
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
|
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
|
||||||
- name: Upload coverage results (to Codecov.io)
|
- name: Upload coverage results (to Codecov.io)
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v7
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
files: ${{ steps.coverage.outputs.report }}
|
files: ${{ steps.coverage.outputs.report }}
|
||||||
@@ -175,4 +135,3 @@ jobs:
|
|||||||
flags: ${{ steps.vars.outputs.CODECOV_FLAGS }}
|
flags: ${{ steps.vars.outputs.CODECOV_FLAGS }}
|
||||||
name: codecov-umbrella
|
name: codecov-umbrella
|
||||||
fail_ci_if_error: false
|
fail_ci_if_error: false
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup rust toolchain, cache and cargo-codspeed binary
|
- name: Setup rust toolchain, cache and cargo-codspeed binary
|
||||||
uses: moonrepo/setup-rust@v0
|
uses: moonrepo/setup-rust@v1
|
||||||
with:
|
with:
|
||||||
channel: stable
|
channel: stable
|
||||||
cache-target: release
|
cache-target: release
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ name: Fuzzing
|
|||||||
|
|
||||||
# spell-checker:ignore fuzzer
|
# spell-checker:ignore fuzzer
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
RUSTC_BOOTSTRAP: 1
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
@@ -23,8 +27,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install `cargo-fuzz`
|
- name: Install `cargo-fuzz`
|
||||||
run: |
|
run: |
|
||||||
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}"
|
|
||||||
echo "CARGO_INCREMENTAL=0" >> "${GITHUB_ENV}"
|
|
||||||
cargo install cargo-fuzz --locked
|
cargo install cargo-fuzz --locked
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
@@ -53,8 +55,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install `cargo-fuzz`
|
- name: Install `cargo-fuzz`
|
||||||
run: |
|
run: |
|
||||||
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}"
|
|
||||||
echo "CARGO_INCREMENTAL=0" >> "${GITHUB_ENV}"
|
|
||||||
cargo install cargo-fuzz --locked
|
cargo install cargo-fuzz --locked
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
fuzz/corpus/${{ matrix.test-target.name }}
|
fuzz/corpus/${{ matrix.test-target.name }}
|
||||||
- name: Run ${{ matrix.test-target.name }} for XX seconds
|
- name: Run ${{ matrix.test-target.name }} for XX seconds
|
||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: ${{ !matrix.test-target.name.should_pass }}
|
continue-on-error: ${{ !matrix.test-target.should_pass }}
|
||||||
run: |
|
run: |
|
||||||
cargo fuzz run ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
|
cargo fuzz run ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
|
||||||
- name: Save Corpus Cache
|
- name: Save Corpus Cache
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# spell-checker:ignore wasip
|
||||||
|
name: WASI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
# End the current execution if there is a new changeset in the PR.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test_wasi:
|
||||||
|
name: Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: wasm32-wasip1
|
||||||
|
- name: check
|
||||||
|
run: cargo check --target wasm32-wasip1
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
exclude: ^tests/fixtures/
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v6.0.0
|
||||||
|
hooks:
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-executables-have-shebangs
|
||||||
|
- id: check-json
|
||||||
|
exclude: '\.vscode/(cSpell|extensions)\.json' # cSpell.json and extensions.json use comments
|
||||||
|
- id: check-shebang-scripts-are-executable
|
||||||
|
exclude: '.+\.rs' # would be triggered by #![some_attribute]
|
||||||
|
- id: check-symlinks
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-yaml
|
||||||
|
args: [ --allow-multiple-documents ]
|
||||||
|
- id: destroyed-symlinks
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: mixed-line-ending
|
||||||
|
args: [ --fix=lf ]
|
||||||
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: rust-linting
|
||||||
|
name: Rust linting
|
||||||
|
description: Run cargo fmt on files included in the commit.
|
||||||
|
entry: cargo +stable fmt --
|
||||||
|
pass_filenames: true
|
||||||
|
types: [file, rust]
|
||||||
|
language: system
|
||||||
|
- id: rust-clippy
|
||||||
|
name: Rust clippy
|
||||||
|
description: Run cargo clippy on files included in the commit.
|
||||||
|
entry: cargo +stable clippy --workspace --all-targets --all-features -- -D warnings
|
||||||
|
pass_filenames: false
|
||||||
|
types: [file, rust]
|
||||||
|
language: system
|
||||||
|
- id: cspell
|
||||||
|
name: Code spell checker (cspell)
|
||||||
|
description: Run cspell to check for spelling errors (if available).
|
||||||
|
entry: bash -c 'if command -v cspell >/dev/null 2>&1; then cspell --no-must-find-files -- "$@"; else echo "cspell not found, skipping spell check"; exit 0; fi' --
|
||||||
|
pass_filenames: true
|
||||||
|
language: system
|
||||||
|
|
||||||
|
ci:
|
||||||
|
skip: [rust-linting, rust-clippy, cspell]
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Contributing to diffutils
|
||||||
|
|
||||||
|
Hi! Welcome to uutils/diffutils, and thanks for wanting to contribute!
|
||||||
|
|
||||||
|
This project follows the shared conventions of the [uutils](https://github.com/uutils)
|
||||||
|
organization. Before opening a pull request, please read:
|
||||||
|
|
||||||
|
- Our **[Review Guidelines](https://uutils.github.io/reviews/)** — what we expect
|
||||||
|
from a pull request and how reviews are carried out.
|
||||||
|
- Our community's [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md), if present.
|
||||||
|
|
||||||
|
Finally, feel free to join our [Discord](https://discord.gg/wQVJbvJ)!
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> uutils is original code and cannot contain any code from GNU or other
|
||||||
|
> strongly-licensed (GPL/LGPL) implementations. We **cannot** accept changes
|
||||||
|
> based on the GNU source code, and you **must not link** to it either. You may
|
||||||
|
> look at permissively-licensed implementations (MIT/BSD) and read the GNU
|
||||||
|
> *manuals* — never the GNU *source*.
|
||||||
|
|
||||||
|
## In short
|
||||||
|
|
||||||
|
- Discuss non-trivial changes in an issue **before** writing the code.
|
||||||
|
- Keep pull requests **small, self-contained, and descriptively titled**
|
||||||
|
(e.g. `diffutils: fix ...`).
|
||||||
|
- Make sure CI passes: tests are green, `rustfmt` is satisfied, and there are
|
||||||
|
no `clippy` warnings.
|
||||||
|
- Add tests for new behavior; don't let coverage regress.
|
||||||
|
- Write small, atomic commits annotated with the component you touched.
|
||||||
|
|
||||||
|
See the [Review Guidelines](https://uutils.github.io/reviews/) for the full
|
||||||
|
details.
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Copyright (c) Michael Howell
|
||||||
|
Copyright (c) uutils developers
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
<LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
option. All files in the project carrying such notice may not be
|
||||||
|
copied, modified, or distributed except according to those terms.
|
||||||
Generated
+201
-240
File diff suppressed because it is too large
Load Diff
+1
-5
@@ -33,15 +33,11 @@ tempfile = "3.26.0"
|
|||||||
[profile.release]
|
[profile.release]
|
||||||
lto = "thin"
|
lto = "thin"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
||||||
[profile.release-fast]
|
|
||||||
inherits = "release"
|
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
# The profile that 'dist' will build with
|
# alias profile for 'dist'
|
||||||
[profile.dist]
|
[profile.dist]
|
||||||
inherits = "release"
|
inherits = "release"
|
||||||
lto = "thin"
|
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "bench_diffutils"
|
name = "bench_diffutils"
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
Copyright (c) Michael Howell
|
|
||||||
Copyright (c) uutils developers
|
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
Copyright (c) Michael Howell
|
|
||||||
Copyright (c) uutils developers
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any
|
Permission is hereby granted, free of charge, to any
|
||||||
person obtaining a copy of this software and associated
|
person obtaining a copy of this software and associated
|
||||||
documentation files (the "Software"), to deal in the
|
documentation files (the "Software"), to deal in the
|
||||||
|
|||||||
@@ -54,4 +54,8 @@ $ cargo run -- -u fruits_old.txt fruits_new.txt
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
diffutils is licensed under the MIT and Apache Licenses - see the `LICENSE-MIT` or `LICENSE-APACHE` files for details
|
This project is distributed under the terms of both the MIT license and the
|
||||||
|
Apache License (Version 2.0).
|
||||||
|
|
||||||
|
See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and
|
||||||
|
[COPYRIGHT](COPYRIGHT) for details.
|
||||||
|
|||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
We provide security updates only for the latest released version of `uutils/diffutils`.
|
||||||
|
Older versions may not receive patches.
|
||||||
|
If you are using a version packaged by your Linux distribution, please check with your distribution maintainers for their update policy.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
**Do not open public GitHub issues for security vulnerabilities.**
|
||||||
|
This prevents accidental disclosure before a fix is available.
|
||||||
|
|
||||||
|
Instead, please use the following method:
|
||||||
|
|
||||||
|
- **Email:** [sylvestre@debian.org](mailto:Sylvestre@debian.org)
|
||||||
|
- **Encryption (optional):** You may encrypt your report using our PGP key:
|
||||||
|
Fingerprint: B60D B599 4D39 BEC4 D1A9 5CCF 7E65 28DA 752F 1BE1
|
||||||
|
---
|
||||||
|
|
||||||
|
### What to Include in Your Report
|
||||||
|
|
||||||
|
To help us investigate and resolve the issue quickly, please include as much detail as possible:
|
||||||
|
|
||||||
|
- **Type of issue:** e.g. privilege escalation, information disclosure.
|
||||||
|
- **Location in the source:** file path, commit hash, branch, or tag.
|
||||||
|
- **Steps to reproduce:** exact commands, test cases, or scripts.
|
||||||
|
- **Special configuration:** any flags, environment variables, or system setup required.
|
||||||
|
- **Affected systems:** OS/distribution and version(s) where the issue occurs.
|
||||||
|
- **Impact:** your assessment of the potential severity (DoS, RCE, data leak, etc.).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Disclosure Policy
|
||||||
|
|
||||||
|
We follow a **Coordinated Vulnerability Disclosure (CVD)** process:
|
||||||
|
|
||||||
|
1. We will acknowledge receipt of your report within **10 days**.
|
||||||
|
2. We will investigate, reproduce, and assess the issue.
|
||||||
|
3. We will provide a timeline for developing and releasing a fix.
|
||||||
|
4. Once a fix is available, we will publish a GitHub Security Advisory.
|
||||||
|
5. You will be credited in the advisory unless you request anonymity.
|
||||||
Generated
+48
-75
@@ -34,15 +34,15 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.19.1"
|
version = "3.20.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
|
checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.2.51"
|
version = "1.2.60"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203"
|
checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"find-msvc-tools",
|
"find-msvc-tools",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
@@ -58,9 +58,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.42"
|
version = "0.4.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
|
checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
@@ -69,26 +69,6 @@ dependencies = [
|
|||||||
"windows-link",
|
"windows-link",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "const_format"
|
|
||||||
version = "0.2.35"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad"
|
|
||||||
dependencies = [
|
|
||||||
"const_format_proc_macros",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "const_format_proc_macros"
|
|
||||||
version = "0.2.34"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"unicode-xid",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation-sys"
|
name = "core-foundation-sys"
|
||||||
version = "0.8.7"
|
version = "0.8.7"
|
||||||
@@ -106,7 +86,6 @@ name = "diffutils"
|
|||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"const_format",
|
|
||||||
"diff",
|
"diff",
|
||||||
"itoa",
|
"itoa",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -116,9 +95,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "find-msvc-tools"
|
name = "find-msvc-tools"
|
||||||
version = "0.1.6"
|
version = "0.1.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff"
|
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
@@ -134,9 +113,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iana-time-zone"
|
name = "iana-time-zone"
|
||||||
version = "0.1.64"
|
version = "0.1.65"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb"
|
checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_system_properties",
|
"android_system_properties",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
@@ -158,9 +137,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.17"
|
version = "1.0.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jobserver"
|
name = "jobserver"
|
||||||
@@ -174,9 +153,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.83"
|
version = "0.3.94"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8"
|
checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
@@ -184,15 +163,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.178"
|
version = "0.2.184"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
|
checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libfuzzer-sys"
|
name = "libfuzzer-sys"
|
||||||
version = "0.4.12"
|
version = "0.4.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d"
|
checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arbitrary",
|
"arbitrary",
|
||||||
"cc",
|
"cc",
|
||||||
@@ -206,9 +185,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.7.6"
|
version = "2.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
|
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
@@ -221,24 +200,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.21.3"
|
version = "1.21.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.104"
|
version = "1.0.106"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0"
|
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.42"
|
version = "1.0.45"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
|
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@@ -251,9 +230,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.12.2"
|
version = "1.12.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
|
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -263,9 +242,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-automata"
|
name = "regex-automata"
|
||||||
version = "0.4.13"
|
version = "0.4.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
|
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -274,9 +253,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.8.8"
|
version = "0.8.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustversion"
|
name = "rustversion"
|
||||||
@@ -301,9 +280,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.112"
|
version = "2.0.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4"
|
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -312,9 +291,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.22"
|
version = "1.0.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
@@ -322,12 +301,6 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unicode-xid"
|
|
||||||
version = "0.2.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unified-diff-fuzz"
|
name = "unified-diff-fuzz"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
@@ -338,18 +311,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasip2"
|
name = "wasip2"
|
||||||
version = "1.0.1+wasi-0.2.4"
|
version = "1.0.2+wasi-0.2.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
|
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wit-bindgen",
|
"wit-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.106"
|
version = "0.2.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd"
|
checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@@ -360,9 +333,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.106"
|
version = "0.2.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3"
|
checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
@@ -370,9 +343,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.106"
|
version = "0.2.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40"
|
checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -383,9 +356,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.106"
|
version = "0.2.117"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4"
|
checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@@ -469,6 +442,6 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wit-bindgen"
|
name = "wit-bindgen"
|
||||||
version = "0.46.0"
|
version = "0.51.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
|
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ extern crate libfuzzer_sys;
|
|||||||
use diffutilslib::cmp::{self, Cmp};
|
use diffutilslib::cmp::{self, Cmp};
|
||||||
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::fs::File;
|
use std::fs::{self, File};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
fn os(s: &str) -> OsString {
|
fn os(s: &str) -> OsString {
|
||||||
@@ -18,7 +18,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>)| {
|
|||||||
.peekable();
|
.peekable();
|
||||||
|
|
||||||
let (from, to) = x;
|
let (from, to) = x;
|
||||||
|
fs::create_dir_all("target").unwrap();
|
||||||
File::create("target/fuzz.cmp.a")
|
File::create("target/fuzz.cmp.a")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.write_all(&from)
|
.write_all(&from)
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ fn os(s: &str) -> OsString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fuzz_target!(|x: Vec<OsString>| -> Corpus {
|
fuzz_target!(|x: Vec<OsString>| -> Corpus {
|
||||||
|
if x.iter().any(|a| a == "--help") {
|
||||||
|
return Corpus::Reject;
|
||||||
|
}
|
||||||
if x.len() > 6 {
|
if x.len() > 6 {
|
||||||
// Make sure we try to parse an option when we get longer args. x[0] will be
|
// Make sure we try to parse an option when we get longer args. x[0] will be
|
||||||
// the executable name.
|
// the executable name.
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>)| {
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fs::create_dir_all("target").unwrap();
|
||||||
let diff = diff_w(&from, &to, "target/fuzz.file").unwrap();
|
let diff = diff_w(&from, &to, "target/fuzz.file").unwrap();
|
||||||
File::create("target/fuzz.file.original")
|
File::create("target/fuzz.file.original")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user