Skip to content
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

gh-128446: Skip Windows CI for configure/Makefile changes #128450

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

srinivasreddy
Copy link
Contributor

@srinivasreddy srinivasreddy commented Jan 3, 2025

@srinivasreddy
Copy link
Contributor Author

cc @erlend-aasland

@erlend-aasland erlend-aasland added skip news needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Jan 3, 2025
@erlend-aasland
Copy link
Contributor

Looks good. Can you add a bogus to-be-reverted-before-merge change to the *nix build system and verify that the Windows CI does not run?

@erlend-aasland erlend-aasland linked an issue Jan 5, 2025 that may be closed by this pull request
Modified the logic to use two conditions:
First check if there ARE configure/Makefile files (grep -qE)
Then check if there are NO other files (! grep -qvE)
Only skip Windows CI when BOTH conditions are true (only configure-related files changed)
This way, Windows CI will be skipped only when ALL changed files are configure/Makefile related, and will run if there are any other changes
@erlend-aasland
Copy link
Contributor

Let's put this into draft while you test out the change. Mark it as ready for review when you've got it working.

@erlend-aasland erlend-aasland marked this pull request as draft January 6, 2025 08:29
@srinivasreddy
Copy link
Contributor Author

srinivasreddy commented Jan 6, 2025

Please check here, Windows build is skipped

https://github.com/python/cpython/actions/runs/12633496189?pr=128450

image

@srinivasreddy
Copy link
Contributor Author

srinivasreddy commented Jan 6, 2025

The changes that are required to skip the windows build are reverted from here e3c15ca

@srinivasreddy srinivasreddy marked this pull request as ready for review January 6, 2025 13:50
@srinivasreddy
Copy link
Contributor Author

@erlend-aasland done 👍

@@ -111,6 +116,18 @@ jobs:
echo "Branch too old for CIFuzz tests; or no C files were changed"
echo "run-cifuzz=false" >> "$GITHUB_OUTPUT"
fi

CHANGED_FILES=$(git diff --name-only "origin/$GITHUB_BASE_REF..")
Copy link
Member

Choose a reason for hiding this comment

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

I pushed this branch to my fork's main and it failed:

main
Run hypothesis tests
Branch too old for CIFuzz tests; or no C files were changed
fatal: ambiguous argument 'origin/..': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: Process completed with exit code 128.

https://github.com/hugovk/cpython/actions/runs/12670020811/job/35308768214

Here's an older push that passed:

main
Run hypothesis tests
Branch too old for CIFuzz tests; or no C files were changed

https://github.com/hugovk/cpython/actions/runs/12382188860/job/34562372543

I think you need to check if [ "$GITHUB_BASE_REF" = "main" ] before doing this git diff. Compare the previous block.

Copy link
Contributor Author

@srinivasreddy srinivasreddy Jan 9, 2025

Choose a reason for hiding this comment

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

Done in d1f1d61

@srinivasreddy srinivasreddy requested a review from hugovk January 9, 2025 14:43
@hugovk
Copy link
Member

hugovk commented Jan 28, 2025

Hmm, one thing I noticed, if I want to run the CI on my branch in my fork before opening a PR (for example, by prefixing the branch with 3.14-), then Windows is skipped, and that causes the whole build to fail:

image

https://github.com/hugovk/cpython/actions/runs/12698006947

I would much prefer to still be able to test Windows on the CI on my fork because I develop on macOS and often things are different on Windows, and I'd like to make sure they're working before opening a PR.

Can we retain this behaviour?

@srinivasreddy
Copy link
Contributor Author

srinivasreddy commented Jan 28, 2025

@hugovk I have addressed in 10a113b. Pls let me know what do you think?

@hugovk
Copy link
Member

hugovk commented Jan 28, 2025

This also skips Windows because a push to a fork isn't a PR: https://github.com/hugovk/cpython/actions/runs/13012655642

@srinivasreddy
Copy link
Contributor Author

I think it is a good idea to change the default to true instead of false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip Windows CI for configure/Makefile changes
3 participants