Skip to content

Commit 3596806

Browse files
committed
Fix hardening workflow and libFuzzer probe
1 parent 9ef2175 commit 3596806

7 files changed

Lines changed: 19 additions & 105 deletions

File tree

.github/release-notes-instructions.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/hardening.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: parser-hardening
22

33
on:
44
pull_request:
5-
push:
6-
branches:
7-
- main
85
workflow_dispatch:
96

107
jobs:
@@ -19,10 +16,10 @@ jobs:
1916

2017
steps:
2118
- name: Checkout
22-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
2320

2421
- name: Setup Python
25-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2623
with:
2724
python-version: "3.x"
2825

.github/workflows/nightly.yml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -392,59 +392,6 @@ jobs:
392392
--commit-range "${{ needs.prepare.outputs.commit_range }}" \
393393
--output release_notes.md
394394
395-
- name: Check Copilot Release Notes Availability
396-
shell: bash
397-
env:
398-
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
399-
run: |
400-
if [[ -n "${COPILOT_GITHUB_TOKEN:-}" && -n "${{ needs.prepare.outputs.latest_nightly_tag }}" ]]; then
401-
echo "PAKFU_USE_COPILOT_RELEASE_NOTES=true" >> "$GITHUB_ENV"
402-
else
403-
echo "PAKFU_USE_COPILOT_RELEASE_NOTES=false" >> "$GITHUB_ENV"
404-
fi
405-
406-
- name: Generate Copilot Release Notes
407-
id: copilot-notes
408-
if: env.PAKFU_USE_COPILOT_RELEASE_NOTES == 'true'
409-
continue-on-error: true
410-
uses: github/copilot-release-notes@v1.0.1
411-
with:
412-
base-ref: ${{ needs.prepare.outputs.latest_nightly_tag }}
413-
head-ref: ${{ needs.prepare.outputs.head_sha }}
414-
instructions: .github/release-notes-instructions.md
415-
pr-strategy: github-api
416-
env:
417-
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
418-
GITHUB_TOKEN: ${{ github.token }}
419-
420-
- name: Use Copilot Release Notes
421-
if: env.PAKFU_USE_COPILOT_RELEASE_NOTES == 'true' && steps.copilot-notes.outputs.release-notes != ''
422-
shell: bash
423-
env:
424-
COPILOT_RELEASE_NOTES: ${{ steps.copilot-notes.outputs.release-notes }}
425-
PAKFU_COMMIT_RANGE: ${{ needs.prepare.outputs.commit_range }}
426-
PAKFU_VERSION: ${{ needs.prepare.outputs.version }}
427-
run: |
428-
python - <<'PY'
429-
import datetime as dt
430-
import os
431-
from pathlib import Path
432-
433-
body = os.environ["COPILOT_RELEASE_NOTES"].strip()
434-
version = os.environ["PAKFU_VERSION"]
435-
commit_range = os.environ.get("PAKFU_COMMIT_RANGE", "")
436-
generated = dt.datetime.now(dt.UTC).strftime("%Y-%m-%d %H:%M UTC")
437-
lines = [
438-
f"# PakFu Nightly v{version}",
439-
"",
440-
f"Generated: {generated}",
441-
]
442-
if commit_range:
443-
lines.append(f"Commit range: `{commit_range}`")
444-
lines.extend(["", body, ""])
445-
Path("release_notes.md").write_text("\n".join(lines), encoding="utf-8")
446-
PY
447-
448395
- name: Generate Distribution Manifest
449396
shell: bash
450397
run: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
# Clang
3535
.cache
3636

37+
# Python
38+
__pycache__/
39+
*.py[cod]
40+
3741
# Meson build outputs
3842
build/
3943
builddir/

docs/RELEASES.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ Stable/beta/dev manual version generation:
3030
behavior, or CLI workflows.
3131
- Related commits should be grouped into one user benefit instead of listed as
3232
separate implementation steps.
33-
- If the `COPILOT_GITHUB_TOKEN` secret is configured, nightly releases can use
34-
`github/copilot-release-notes` with `.github/release-notes-instructions.md` as
35-
an editorial pass. The deterministic local scripts remain the fallback path.
3633
- Changelog/release-note rendering scripts:
3734
1. `scripts/update_changelog.py`
3835
2. `scripts/nightly_release_notes.py`
-22 Bytes
Binary file not shown.

src/meson.build

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,21 @@ pakfu_includes = [include_directories('.')] + qt_rhi_includes
7777
fuzzing_opt = get_option('fuzzing')
7878
fuzz_compile_args = ['-fsanitize=fuzzer', '-fno-omit-frame-pointer']
7979
fuzz_link_args = ['-fsanitize=fuzzer']
80+
fuzz_link_probe = '''
81+
#include <cstddef>
82+
#include <cstdint>
83+
84+
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t*, std::size_t) {
85+
return 0;
86+
}
87+
'''
8088
fuzzing_supported = (
8189
cpp_compiler.has_multi_arguments(fuzz_compile_args) and
82-
cpp_compiler.has_multi_link_arguments(fuzz_link_args)
90+
cpp_compiler.links(
91+
fuzz_link_probe,
92+
args: fuzz_compile_args + fuzz_link_args,
93+
name: 'libFuzzer entrypoint',
94+
)
8395
)
8496
if fuzzing_opt.enabled() and not fuzzing_supported
8597
error('Parser fuzz targets require compiler support for -fsanitize=fuzzer.')

0 commit comments

Comments
 (0)