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

WHL: Window x64 builds failing #1425

Closed
Tracked by #1439
snowman2 opened this issue Aug 13, 2024 · 16 comments · Fixed by #1440
Closed
Tracked by #1439

WHL: Window x64 builds failing #1425

snowman2 opened this issue Aug 13, 2024 · 16 comments · Fixed by #1440
Labels
cicd CICD Related help wanted windows Windows related issue
Milestone

Comments

@snowman2
Copy link
Member

https://github.com/pyproj4/pyproj/actions/runs/10307248459/job/28532125980

Error: Command pyproj -v && python -c "import pyproj; pyproj.Proj(init='epsg:4269')"  && cp -r D:\a\pyproj\pyproj/test . && python -m pytest test -v -s
 failed with code 3221225477. 
@snowman2 snowman2 added help wanted windows Windows related issue cicd CICD Related labels Aug 13, 2024
@snowman2 snowman2 added this to the 3.7.0 milestone Aug 13, 2024
@snowman2 snowman2 pinned this issue Aug 13, 2024
@jjimenezshaw
Copy link
Contributor

jjimenezshaw commented Aug 14, 2024

That are 4 commands chained. We do not know which one is failing.

@EwoutH
Copy link

EwoutH commented Aug 14, 2024

Seems like we need to untangle these commands:

CIBW_TEST_COMMAND: >
pyproj -v &&
python -c "import pyproj; pyproj.Proj(init='epsg:4269')" &&
cp -r {package}/test . &&
python -m pytest test -v -s

Edit: Since it fails after over 30s, I'm quite sure it's the last line with pytest itself.

@EwoutH
Copy link

EwoutH commented Aug 14, 2024

If you go to a failed run, like https://github.com/pyproj4/pyproj/actions/runs/10307248459/job/28532125980, then you should be able to rerun the failed job. You can checkmark the "run in debug" mode option, and then we might get some more information.

image

@jjimenezshaw
Copy link
Contributor

@EwoutH
Copy link

EwoutH commented Aug 14, 2024

Can we run the tests separately, without the whole cibuildwheel thing? Or are those tests explicitly about the wheels?

If so, maybe remove the tests steps temporarily, download some of the wheels, and run them manually though pytest.

Or remove the test steps from cibuildwheel, and run them separately afterwards.

@snowman2
Copy link
Member Author

Or are those tests explicitly about the wheels?

They are specifically for the wheels. They are meant to prevent publishing problematic wheels.

If so, maybe remove the tests steps temporarily, download some of the wheels, and run them manually though pytest.

I don't have a local Windows machine to test or debug with. The CI is how testing/debugging on Windows happens.

@snowman2
Copy link
Member Author

If so, maybe remove the tests steps temporarily, download some of the wheels, and run them manually though pytest.

I believe can do that with a fork. The artifacts should be available in the completed action.

@djhoese
Copy link
Contributor

djhoese commented Aug 28, 2024

FYI build is now called python-build in conda-forge so I had to update the release workflow. See:

djhoese@aa30fcd

@djhoese
Copy link
Contributor

djhoese commented Aug 28, 2024

Also, FYI the tests fail with just pyproj -v:

   + pyproj -v
  Error: Command pyproj -v failed with code 3221225477. 

@snowman2
Copy link
Member Author

Potential backup if Windows wheels issue is not addressed: https://github.com/cgohlke/geospatial-wheels

@m-richards
Copy link

Just thought I'd share that I have a windows machine to test with and I've been having a bit of a look into this. If I skip this CI check on my fork and download the wheels from the gitlab CI artifact, I get a segfault at import time (modifying the wheel and adjusting the __init__.py with wheel unpack and wheel pack seems to suggest this happens for any of the calls into cython modules.

I can't replicate this locally though - building wheels myself using a similar setup vcpkg for proj deps, proj source code and msvc compiler produces a valid wheel which doesn't segfault. Happy to test other things if there are useful suggestions.

@rcomer
Copy link

rcomer commented Sep 12, 2024

Talk of segfaults reminds me of this recent Matplotlib issue matplotlib/matplotlib#28551

I have no idea if the causes could be related though - I’m afraid that discussion went over my head.

@tacaswell
Copy link

I agree this sounds very similar.

The very short summary is that visual studio made a change to the c++ stdlibary. Things compiled before the change work with the new library, things compiled after change segfault when used with the old library. To try and be self-contained many wheels will bundle the c++ runtime. If you then have a wheel that bundles the old one, import it so that the old runtime gets loaded, and then use something compiled with the new version of visual studio you will get this segfault.

We also found that as part of the bundling process we would sometimes grab the wrong (and old) version of the dll.

@greglucas
Copy link
Contributor

I was trying to add Python 3.13 wheels for Cartopy and are unable to do that because of the missing pyproj wheels for 3.13.

What was the recommended fix in that issue? Several different things were going on and I also did not follow the final recommendation on what wheel builders should be doing. Is it to statically link the msvc runtime?
contourpy/contourpy#427
or to do something with the PATH searching?
matplotlib/matplotlib#28551 (comment)
something else entirely?

@snowman2
Copy link
Member Author

See #1439

@QuLogic
Copy link

QuLogic commented Sep 24, 2024

What was the recommended fix in that issue? Several different things were going on and I also did not follow the final recommendation on what wheel builders should be doing. Is it to statically link the msvc runtime?

Yes, we statically linked the runtime: matplotlib/matplotlib#28687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd CICD Related help wanted windows Windows related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants