GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107652: Fix CIFuzz build by sobolevn · Pull Request #110576 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Oct 9, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

When CI job was skipped the job was failing: https://github.com/python/cpython/actions/runs/6459321247/job/17536559744?pr=110573

Error: The template is not valid. .github/workflows/build.yml (Line: 620, Col: 24): Error reading JToken from JsonReader. Path '', line 0, position 0.

This happened because run_cifuzz was not set. Now we use the same logic as for other tools by setting it to false

Refs #107653
Refs #107652

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
Fix CIFuzz build
b3a66d3
@sobolevn
sobolevn requested review from ezio-melotti and hugovk as code owners October 9, 2023 17:35
@bedevere-app bedevere-app Bot added the awaiting review label Oct 9, 2023
hugovk
hugovk approved these changes Oct 9, 2023
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Oct 9, 2023
hugovk
hugovk requested changes Oct 9, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

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.

There's an error with this, please could you check?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk

hugovk commented Oct 9, 2023

Copy link
Copy Markdown
Member

cc @illia-v

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Fix CI
0348cbc
@sobolevn sobolevn added skip issue skip news labels Oct 9, 2023
illia-v
illia-v approved these changes Oct 9, 2023
View reviewed changes

@illia-v illia-v left a comment

Copy link
Copy Markdown
Contributor

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'm sorry for the error. Thank you for the fix!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn reacted with heart emoji
All reactions
  • ❤️ 1 reaction
hugovk
hugovk reviewed Oct 9, 2023
View reviewed changes
Comment thread .github/workflows/build.yml Outdated
# be broken.
if [ "$GITHUB_BASE_REF" = "main" ]; then
FUZZ_RELEVANT_FILES='(\.c$|\.h$|\.cpp$|^configure$|^\.github/workflows/build\.yml$|^Modules/_xxtestfuzz)'
if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE $FUZZ_RELEVANT_FILES; echo $?)" -eq 1 ]; then

@hugovk hugovk Oct 9, 2023

Copy link
Copy Markdown
Member

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.

Do I get this logic right?

First part:

  • [ "$GITHUB_BASE_REF" = "main" ] - this is a PR

Second part:

  • git diff --name-only origin/$GITHUB_BASE_REF.. - lists files changed compared with main

  • grep -qvE $FUZZ_RELEVANT_FILES - checks the changed files are NOT of the relevant type

  • -eq 1 - error code 1, so true only when the files ARE found


Instead of checking no match is false: (...; echo $?)" -eq 1

Can we check for a match, something along the lines of this?

Suggested change
if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE $FUZZ_RELEVANT_FILES; echo $?)" -eq 1 ]; then
if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE $FUZZ_RELEVANT_FILES)" ]; then

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sobolevn sobolevn Oct 9, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.

When using grep -q in $(), we have to rely on exit code, because no output is produced.

So:

(.venv) ~/Desktop/cpython  fix-ci-fuzz-build ✔                                            
» echo 'abc' | grep -qE 'b'; echo $?
0
                                                                                           
(.venv) ~/Desktop/cpython  fix-ci-fuzz-build ✔                                            
» echo 'abc' | grep -qE 'y'; echo $?
1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@sobolevn
Address review
3a5a449
hugovk
hugovk approved these changes Oct 10, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

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.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk
hugovk merged commit def7ea5 into python:main Oct 10, 2023
@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 10, 2023
@sobolevn

sobolevn commented Oct 10, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Btw, I use https://explainshell.com/explain?cmd=grep+-qE all the time, can recommend for bash reviews :)

Thanks, everyone!

hugovk reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Oct 10, 2023

Copy link
Copy Markdown
Member Author

I can verify that my C changes now trigger CIFuzz: #110573

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Oct 10, 2023

Copy link
Copy Markdown
Member

#109854 was created before merging CIFuzz, it changed .pre-commit-config.yaml and Tools/patchcheck/patchcheck.py.

I updated it from main, and it did the CIFuzz checks, somewhat surprisingly.

Do you know why?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk mentioned this pull request Oct 10, 2023
gh-107652: Fix CIFuzz typo #110602
Merged
@hugovk hugovk changed the title Fix CIFuzz build gh-107652: Fix CIFuzz build Oct 10, 2023
@illia-v

illia-v commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

@hugovk I guess it happened because the merge commit contained changes to the relevant files

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@sobolevn @Glyphack
Fix CIFuzz build (python#110576)
794d3cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes
@ezio-melotti ezio-melotti Awaiting requested review from ezio-melotti ezio-melotti is a code owner
+1 more reviewer
@illia-v illia-v illia-v approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@sobolevn @hugovk @illia-v
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.