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

CI: Add a Cygwin run to GitHub Actions #5878

Merged
merged 76 commits into from May 12, 2022

Conversation

DWesl
Copy link
Contributor

@DWesl DWesl commented Dec 10, 2021

Requested for the _imagingtk fix.

Changes proposed in this pull request:

  • Add a Cygwin run to the GitHub Actions Suite

Requested for the _imagingtk fix.
I think this is how specifying the shell works.  The documentation
isn't terribly clear.
For some reason wheel wasn't installed properly.
setup.py bdist_wheel goes to dist/*.whl
pip wheel goes to *.whl
I'm using selftest.py to check whether I've installed everything.
Pytest actually finds and runs the tests.  For some reason that wasn't
running earlier.
@radarhere radarhere changed the title CI: Add a cygwin run to GitHub Actions. CI: Add a cygwin run to GitHub Actions Dec 11, 2021
@radarhere radarhere changed the title CI: Add a cygwin run to GitHub Actions CI: Add a Cygwin run to GitHub Actions Dec 11, 2021
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.

Thanks for the PR!

Please could you also add this to the "Continuous Integration Targets" table in docs/installation.rst?

https://pillow.readthedocs.io/en/latest/installation.html#continuous-integration-targets

And not necessary for this PR, but do you think it's possible to include test coverage and upload to Codecov?

.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
Upload coverage information, add Cygwin to the list of systems with CI,
space out entries.

- name: Upload coverage
run: |
C:\tools\cygwin\bin\bash -c 'bash <(curl -s https://codecov.io/bash) -F'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the current version better? The Windows and Linux codecov uploaders will also need to be updated, but that's a separate PR, I think.

The actual test step wasn't running, so try to run that as a shell
script rather than an executable.  Also get more of the dependencies
installed.
The old bash downloader will be removed soon.
@DWesl
Copy link
Contributor Author

DWesl commented Dec 11, 2021

Is there some way to tell GitHub Actions "I'm trying to set up a Workflow; only run the Workflows that have actually changed"?

@radarhere
Copy link
Member

I would create a separate branch to this one (just to keep things neater here) and remove any workflow files you don't want to run. Then when you push, you should only the workflow you want to run at https://github.com/DWesl/Pillow/actions

Cygwin is trying to use the highest-available Python version.
One of the Python packages has scripts in /usr/bin that should be in the python39- subpackage.
@DWesl
Copy link
Contributor Author

DWesl commented Dec 11, 2021

I can do that, though it's probably fine now, and will report the two or three ImageTk errors from #5795 just fine. If not, off I go to a new branch to tinker with things.

@@ -460,6 +460,8 @@ These platforms are built and tested for every change.
+----------------------------------+----------------------------+---------------------+
| CentOS Stream 8 | 3.9 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Cygwin | 3.8 | x86-64 |
Copy link
Contributor

Choose a reason for hiding this comment

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

Could move this under Windows 2019 below, like there is a separate line for MinGW?

@DWesl
Copy link
Contributor Author

DWesl commented May 3, 2022

32-bit Cygwin Python 3.8 seems to have started failing between 3453b0e and 143e57b. Specifying precisely which version of python to use shouldn't cause problems, and it definitely shouldn't cause a GCC crash.

There are Cygwin updates around that time, but neomutt, perl, and pcre2 seem unlikely to cause GCC to fail with signal 11.

DWesl#5 assumes this is some kind of new fork failure (it doesn't look like the usual ones), but the usual fix for that doesn't seem to be working.

Oh, and now the failure has migrated to Python 3.9, and 3.8 works fine. Is this a new manifestation of the old "sometimes Windows decides it hates how Cygwin works" problems, or is this another bug that depends on the architecture of the CI runner?

This is such a weirdly specific failure, and reproduced somewhat consistently whenever the workflow managed to get that far, but there's no apparent cause in the code, nor in the part of the environment I can control. The change in the length of the command line, or of the template generating the file that the CI runner actually runs, is about the only thing similar between the start and end of the run of failures; however, I saw similar failures on the test branch where I ironed out the syntax for alternatives. None of this should be causing any problems, but any problems I can think of should be producing at least three failures, not merely one. I have no idea how to go about debugging this.

The best idea I have is that roughly a third of the 32-bit Windows GitHub Actions runners are older machines than Cygwin's GCC maintainer assumed when compiling 11.2, but I don't think there's been that many updates to 32-bit processors recently, and I don't know if there's a way to convince cygwin-install-action to install old versions of GCC to test the theory.

@hugovk
Copy link
Member

hugovk commented May 4, 2022

Would it make sense to only test 64-bit Cygwin?

Or at least to get this PR merged, and 32-bit could be investigated in a new PR?

@DWesl
Copy link
Contributor Author

DWesl commented May 4, 2022

Given that the Cygwin website recommends not using 32-bit Cygwin if possible, and that the Cygwin 3.3.0 announcement said 3.4.0 will not include a 32-bit component, it would probably make sense to omit regular testing for 32-bit Cygwin. Should I update the matrix?

@hugovk
Copy link
Member

hugovk commented May 4, 2022

That's quite a warning!

32 bit Cygwin: Address space is a very limiting factor for Cygwin. These days, a full 32 bit Cygwin distro is not feasible anymore, and will in all likelihood fail in random places due to an issue with the fork(2) system call. Therefore we recommend using 32 bit Cygwin only in limited scenarios, with only a minimum of necessary packages installed, and only if there's no way to run 64 bit Cygwin instead. You have been warned. If you're still sure you really need a 32 bit Cygwin, and there's absolutely no way around it, you may run the setup-x86.exe installer. The signature can be used to verify the validity of this binary.

Yeah, let's just ditch 32 bit.

The community is gradually dropping support for 32 bit anyway, for example see NumPy.

Cygwin recommends using 64-bit if at all possible, and will discontinue support entirely within the next year or so.  

This also reduces CI load, which I suppose is polite to those who provide it at no cost.
.ci/install.sh Outdated
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
fi

if [[ $(uname -mo) != i*86" Cygwin" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Is this a 32-bit check? If so, let's revert it.

.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
.github/workflows/test-cygwin.yml Outdated Show resolved Hide resolved
docs/installation.rst Outdated Show resolved Hide resolved
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.

Thank you!

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
DWesl and others added 6 commits May 7, 2022 07:42
Install seems to be working now.

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
Removed steps that are currently unnecessary.  Hopefully they stay that way.
Let's see if this works.

Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
@hugovk hugovk merged commit c4325c8 into python-pillow:main May 12, 2022
@hugovk
Copy link
Member

hugovk commented May 12, 2022

@DWesl Thank you for your work on this, and everyone else for the reviews!

@DWesl DWesl deleted the add-cygwin-to-ci branch May 13, 2022 15:02
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.

None yet

5 participants