Skip to content

Conversation

@sethmlarson
Copy link
Contributor

@sethmlarson sethmlarson commented Jan 12, 2026

Created a list of files and directories that should trigger a re-run of the python3-libraries fuzzers. Now that the Python repository is the home for this fuzzer it should be easier for Python core developers to fix issues with the fuzzer in case there are issues.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could also rename most of the "library"/"libraries"/"LIBRARY" to "stdlib"/"STDLIB" and it'd be clearer this is running on the standard library and not any third-party library code.

@sethmlarson
Copy link
Contributor Author

I think we could also rename most of the "library"/"libraries"/"LIBRARY" to "stdlib"/"STDLIB" and it'd be clearer this is running on the standard library and not any third-party library code.

I agree with this, we can change most of our uses to "stdlib" within this PR except for oss-fuzz-project-name. I can handle that in a separate PR since we'll have to wait for OSS-Fuzz maintainers to rename the project.

@sethmlarson
Copy link
Contributor Author

Thanks @StanFromIreland and @hugovk for the reviews! I've moved to a reusable workflows approach. I'll try pushing a commit modifying one of the libraries to check that the workflow fires correctly.

Comment on lines 642 to 647
uses: ./.github/workflows/reusable-cifuzz.yml
with:
oss-fuzz-project-name: cpython3
cifuzz-stdlib:
needs: build-context
if: needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: ./.github/workflows/reusable-cifuzz.yml
with:
oss-fuzz-project-name: cpython3
cifuzz-stdlib:
needs: build-context
if: needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
permissions:
security-events: write
uses: ./.github/workflows/reusable-cifuzz.yml
with:
oss-fuzz-project-name: cpython3
cifuzz-stdlib:
needs: build-context
if: needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
permissions:
security-events: write

(https://github.com/python/cpython/pull/143749/files#r2686916751)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, looks like it is needed the calling jobs in build.yml, because the CI didn't start:

The workflow is not valid. .github/workflows/build.yml (Line: 639, Col: 3): Error calling workflow 'python/cpython/.github/workflows/reusable-cifuzz.yml@98b701b'. The workflow is requesting 'security-events: write', but is only allowed 'security-events: none'.

https://github.com/python/cpython/actions/runs/20936855037?pr=143749

Maybe we try this smaller change to validate the permissions, before refactoring the matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm attempting the large matrix approach here: 3958c5d

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to have mostly worked? I don't understand why the matrix values are empty, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look but will likely have more clarity tomorrow.

@hugovk
Copy link
Member

hugovk commented Jan 13, 2026

(I resolved the conflict)

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@sethmlarson
Copy link
Contributor Author

@webknjaz I'm not sure why actionlint is refusing the contains([...], 'true') syntax used, checking on the allowed function definitions it seemed like this would be allowed?

@sethmlarson
Copy link
Contributor Author

With the latest commit we got a run, but the values of oss-fuzz-project-name and sanitizer aren't being forwarded (the reusable workflow is seeing an empty string?) from the job matrix into the reusable workflow. I don't think I'm doing anything different than any of the other reusable workflows that use a matrix and forward parameters?

@webknjaz
Copy link
Contributor

@webknjaz I'm not sure why actionlint is refusing the contains([...], 'true') syntax used, checking on the allowed function definitions it seemed like this would be allowed?

Not sure. Might be a bug in actionlint. Or maybe I misunderstood that this'd work from the docs 🤷‍♂️

@webknjaz
Copy link
Contributor

With the latest commit we got a run, but the values of oss-fuzz-project-name and sanitizer aren't being forwarded (the reusable workflow is seeing an empty string?) from the job matrix into the reusable workflow. I don't think I'm doing anything different than any of the other reusable workflows that use a matrix and forward parameters?

Sounds like maybe I messed up the suggested conditionals or something. I'll double-check the current diff.

Comment on lines +648 to +651
(
needs.build-context.outputs.run-ci-fuzz == 'true'
|| needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parens are redundant here:

Suggested change
(
needs.build-context.outputs.run-ci-fuzz == 'true'
|| needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
)
needs.build-context.outputs.run-ci-fuzz == 'true'
|| needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'

# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
cifuzz:
name: CIFuzz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need the same treatment as other matrices.

Suggested change
name: CIFuzz
# ${{ '' } is a hack to nest jobs under the same sidebar category.
name: CIFuzz${{ '' }} # zizmor: ignore[obfuscation]

Comment on lines +668 to +674
&& ''
|| 'cpython3'
}}
- oss-fuzz-project-name: >-
${{
needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
&& ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I can think of is that maybe empty strings mess up exclusions in GHA (is it possible they exclude all the matrix factors?). Let's try my initial suggestion first and go from there...

Suggested change
&& ''
|| 'cpython3'
}}
- oss-fuzz-project-name: >-
${{
needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
&& ''
&& 'dummy sentinel 🤪'
|| 'cpython3'
}}
- oss-fuzz-project-name: >-
${{
needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
&& 'dummy sentinel 🤪'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another difference is that the original trick uses interpolation in the main matrix definition and here we use it in exclusions.

@webknjaz
Copy link
Contributor

@sethmlarson I'm logging off now but meanwhile, could you restart the entire workflow ticking that debug checkbox in the rerun modal? I don't have privileges to do this myself yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants