Repository navigation
pkc%test(bls): add the programs that write the BLS corpora #112
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
Merged
+2,914
−68
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e8ce915
pkc%test(bls): add the reference implementation as a submodule
PastaPastaPasta 76704ec
sdk%build(nix): add `corpora.nix` with CMake, Boost and GMP
PastaPastaPasta 4feb192
pkc%test(bls): add programs that write the BLS corpora
PastaPastaPasta 5e0c21a
sdk%ci(gha): build the corpus generators weekly
PastaPastaPasta 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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| .cache | ||
| .venv | ||
| docs/.site | ||
| pkgs/pkc/contrib/dash | ||
| public | ||
| 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,131 @@ | ||
| name: Build corpus generators | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: [develop] | ||
| pull_request: | ||
| schedule: | ||
| - cron: "0 6 * * 1" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| changes: | ||
| name: Detect changes | ||
| runs-on: ubuntu-slim | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| outputs: | ||
| run: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || steps.filter.outputs.corpora == 'true' }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
| filter: blob:none | ||
| sparse-checkout: .github/paths.yml | ||
| sparse-checkout-cone-mode: false | ||
| persist-credentials: false | ||
|
|
||
| - name: Filter paths | ||
| id: filter | ||
| if: github.event_name == 'pull_request' || github.event_name == 'push' | ||
| uses: dorny/paths-filter@v4 | ||
| env: | ||
| GIT_CONFIG_COUNT: "1" | ||
| GIT_CONFIG_KEY_0: fetch.recurseSubmodules | ||
| GIT_CONFIG_VALUE_0: "false" | ||
| with: | ||
| filters: .github/paths.yml | ||
|
|
||
| build: | ||
| name: Build and check the corpora | ||
| needs: changes | ||
| if: needs.changes.outputs.run == 'true' | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: nix develop ./contrib/nix#ci --command bash -eo pipefail {0} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
|
|
||
| - name: Check cache write access | ||
| id: cache_write | ||
| uses: $/.github/actions/cache_write | ||
|
|
||
| - name: Free disk space | ||
| uses: jlumbroso/free-disk-space@v2 | ||
| with: | ||
| large-packages: false | ||
|
|
||
| - name: Allow unprivileged user namespaces | ||
| shell: bash | ||
| run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | ||
|
|
||
| - name: Install Nix | ||
| uses: DeterminateSystems/nix-installer-action@v23 | ||
|
|
||
| - name: Cache Nix | ||
| uses: Mic92/niks3-action@v1 | ||
| if: vars.CACHE_NIX_URL != '' | ||
| with: | ||
| server-url: ${{ vars.CACHE_NIX_URL }} | ||
| skip-push: ${{ steps.cache_write.outputs.allowed != 'true' }} | ||
|
|
||
| - name: Manage CodeQL packs | ||
| uses: $/.github/actions/gha_cache | ||
| with: | ||
| path: ~/.codeql | ||
| key: codeql-packs-${{ hashFiles('maint/codeql/*/codeql-pack.lock.yml') }} | ||
| restore-only: "true" | ||
| url: ${{ vars.CACHE_GHA_URL }} | ||
| bucket: ${{ vars.CACHE_GHA_BUCKET }} | ||
| region: ${{ vars.CACHE_GHA_REGION }} | ||
| key-id: ${{ vars.CACHE_GHA_KEY_ID }} | ||
| auth: ${{ steps.cache_write.outputs.allowed == 'true' && secrets.CACHE_GHA_AUTH || '' }} | ||
|
|
||
| - name: Write the corpora | ||
| run: pkgs/pkc/contrib/regen.py | ||
|
|
||
| - name: Show the build log | ||
| if: failure() | ||
| shell: bash | ||
| run: cat target/bls-corpus/*-*/build.log | ||
|
|
||
| - name: Check the corpora are unchanged | ||
| run: | | ||
| git diff --exit-code -- pkgs/pkc/corpus | ||
| test -z "$(git status --porcelain -- pkgs/pkc/corpus)" | ||
|
|
||
| - name: Lint the programs against the build | ||
| run: | | ||
| python3 maint/lint/lint_clang.py 2>&1 | tee "${RUNNER_TEMP}/lint_clang.log" | ||
| if grep -qF 'skipping the lint of pkgs/pkc/contrib' "${RUNNER_TEMP}/lint_clang.log"; then | ||
| echo '::error::the programs were not linted' | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Analyse the programs against the build | ||
| run: | | ||
| python3 maint/lint/lint_codeql.py run --lang=cpp --with-suite=cpp-security-and-quality 2>&1 | tee "${RUNNER_TEMP}/lint_codeql.log" | ||
|
kwvg marked this conversation as resolved.
Resolved
|
||
| if grep -qF 'skipping the analysis of pkgs/pkc/contrib' "${RUNNER_TEMP}/lint_codeql.log"; then | ||
| echo '::error::the programs were not analysed' | ||
| exit 1 | ||
| fi | ||
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,3 +1,8 @@ | ||
| [submodule "fuzz/pow/sphlib"] | ||
| path = fuzz/pow/sphlib | ||
| url = https://github.com/pornin/sphlib | ||
| [submodule "pkgs/pkc/contrib/dash"] | ||
| path = pkgs/pkc/contrib/dash | ||
| url = https://github.com/dashpay/dash | ||
| shallow = true | ||
| update = none |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 @@ | ||
| # Build dependencies of the C++ programs that write test corpora | ||
|
|
||
| { pkgs }: | ||
|
|
||
| { | ||
| packages = [ | ||
| pkgs.boost | ||
| pkgs.cmake | ||
| pkgs.gmp | ||
| ]; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # The corpus programs link a stand-in for the release's strong random source | ||
| # that aborts, so a program that draws random bytes stops rather than writing | ||
| # a corpus that differs from run to run. | ||
| [[finding]] | ||
| path = "pkgs/pkc/contrib/util/no_random.cpp" | ||
| message = "Explicit termination of the program" |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.