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

Added CI jobs that use conda compilers #52

Merged
merged 3 commits into from
Oct 3, 2022

Conversation

astrofrog
Copy link
Member

This re-uses an approach we developed in extension-helpers - I wonder whether issues such as #48 are due to our C code not compiling properly with conda compilers - and in any case it's not a bad idea to have these jobs.

I do want to try and switch over the rest of the tests to the OA workflow but that's not urgent.

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2022

Codecov Report

Base: 46.04% // Head: 76.33% // Increases project coverage by +30.29% 🎉

Coverage data is based on head (95cb86c) compared to base (aae8c8c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #52       +/-   ##
===========================================
+ Coverage   46.04%   76.33%   +30.29%     
===========================================
  Files          18       17        -1     
  Lines        2235     1348      -887     
===========================================
  Hits         1029     1029               
+ Misses       1206      319      -887     
Impacted Files Coverage Δ
casa_formats_io/casa_low_level_io.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@astrofrog
Copy link
Member Author

Interestingly the compilation fails with the conda clang compiler:

clang-10 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/runner/work/casa-formats-io/casa-formats-io/.tox/py39-test-osxclang-conda/include -arch x86_64 -I/Users/runner/work/casa-formats-io/casa-formats-io/.tox/py39-test-osxclang-conda/include -fPIC -O2 -isystem /Users/runner/work/casa-formats-io/casa-formats-io/.tox/py39-test-osxclang-conda/include -arch x86_64 -I/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-l_cyc01w/overlay/lib/python3.9/site-packages/numpy/core/include -I/Users/runner/work/casa-formats-io/casa-formats-io/.tox/py39-test-osxclang-conda/include/python3.9 -c casa_formats_io/_casa_chunking.c -o build/temp.macosx-10.9-x86_64-cpython-39/casa_formats_io/_casa_chunking.o
[271](https://github.com/radio-astro-tools/casa-formats-io/actions/runs/3112828612/jobs/5046700184#step:9:272)
      In file included from casa_formats_io/_casa_chunking.c:4:
[272](https://github.com/radio-astro-tools/casa-formats-io/actions/runs/3112828612/jobs/5046700184#step:9:273)
      /Users/runner/work/casa-formats-io/casa-formats-io/.tox/py39-test-osxclang-conda/include/python3.9/Python.h:25:10: fatal error: 'stdio.h' file not found
[273](https://github.com/radio-astro-tools/casa-formats-io/actions/runs/3112828612/jobs/5046700184#step:9:274)
      #include <stdio.h>
[274](https://github.com/radio-astro-tools/casa-formats-io/actions/runs/3112828612/jobs/5046700184#step:9:275)
               ^~~~~~~~~
[275](https://github.com/radio-astro-tools/casa-formats-io/actions/runs/3112828612/jobs/5046700184#step:9:276)
      1 error generated.

which I don't really understand as I thought stdio.h was pretty standard and is being included by Python header files. But this does seem similar to the error in e.g. #23 (although there it was stdarg.h). Let's see what happens with the conda gcc build.

@astrofrog
Copy link
Member Author

The conda-forge gcc works fine, so it seems it's clang from the default anaconda channel which has issues. I've found other issues complaining of broken conda compilers (e.g. davisking/dlib#1525) so maybe this is beyond our control and not due to anything specifically in casa-formats-io.

With the v0.2 wheels, we should see fewer installation issues since fewer users will be installing from source, but users running into installation problems with the source build and using conda might need to switch what compiler they are using and report the issues to continuum?

I'll see if I can report the current clang failure here to the continuum folk.

@astrofrog
Copy link
Member Author

I've emailed the anaconda maintainers with a link to this PR.

@sumit0190
Copy link

There is nothing wrong with clang in this case; the problem is the missing sysroot. clang needs to know where to look at in order to find common headers. These headers usually reside in the SDK folders, commonly found by running xcrun -show-sdk-path -sdk macosx. For licensing reasons such files cannot be included as a part of clang or any other non-Apple package; see this link for details.

In order to fix this, you can explicitly point to the sysroot in your tox.ini file like so:
CC=clang-10 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

Of course, you'd have to point it to wherever your CI system installs the SDK for OSX. I verified that adding this line makes your error go away.

@astrofrog
Copy link
Member Author

@sumit0190 - thank you for the detailed explanation! I'll try and wrap up the PR along the lines you suggest.

@astrofrog astrofrog force-pushed the conda-compilers branch 2 times, most recently from 95cb86c to d61d69c Compare October 3, 2022 08:33
@astrofrog
Copy link
Member Author

Well this hasn't revealed any issues with our extension though no harm in merging it to safeguard against future issues

@astrofrog astrofrog marked this pull request as ready for review October 3, 2022 10:33
@astrofrog astrofrog merged commit c43a334 into radio-astro-tools:main Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants