Closed astrofrog closed 2 years ago
Base: 46.04% // Head: 76.33% // Increases project coverage by +30.29%
:tada:
Coverage data is based on head (
95cb86c
) compared to base (aae8c8c
). Patch has no changes to coverable lines.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
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. https://github.com/radio-astro-tools/casa-formats-io/issues/23 (although there it was stdarg.h). Let's see what happens with the conda gcc build.
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. https://github.com/davisking/dlib/issues/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.
I've emailed the anaconda maintainers with a link to this PR.
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.
@sumit0190 - thank you for the detailed explanation! I'll try and wrap up the PR along the lines you suggest.
Well this hasn't revealed any issues with our extension though no harm in merging it to safeguard against future issues
This re-uses an approach we developed in extension-helpers - I wonder whether issues such as https://github.com/radio-astro-tools/casa-formats-io/issues/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.