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

Fix musl linux build #603

Conversation

milesgranger
Copy link
Contributor

@milesgranger milesgranger commented Apr 24, 2024

Will close #602

Seems this is the idiom to check for musl libc and appears happy on blosc2-rs' end using this branch.

Not sure if you want the added trouble of a musl build in your CI as well, but I'll be happy to complain if mine breaks down the line. ;-)

@FrancescAlted
Copy link
Member

It looks like there are several failures in CI. I am not too worried about the builds for Ubuntu (temporary failure in upstream repos?), but the one with fuzzer seems significant: https://github.com/Blosc/c-blosc2/actions/runs/8814267732/job/24194115220?pr=603

Would you be able to see what it is happening there?

@milesgranger
Copy link
Contributor Author

Interesting, I should have some time tomorrow to try and figure it out. 👍

@milesgranger milesgranger force-pushed the milesgranger/602-fix-musllinux-__cpu_model-ref branch from b8bc9dc to 5fceb36 Compare April 25, 2024 03:56
@milesgranger
Copy link
Contributor Author

Alrighty, it appears adding logic to identify musl is bad practice which after some digging found that to resolve the undefined __cpu_model refs is to link libgcc. I think technically...maybe, this ought to be in c-blosc2 configuration somewhere if the target env is musl but I'm happy to configure this in the rust bindings.

I added one commit here to call __builtin_cpu_init() as I thought initially this was needed from reading the docs, but I think it's not needed given the caveat there:

...only when used in a function that is executed before any constructors are called. The CPU detection code is automatically executed in a very high priority constructor.

So I think there is nothing to do here now, closing it. Thanks for the help. :)

@milesgranger milesgranger deleted the milesgranger/602-fix-musllinux-__cpu_model-ref branch April 25, 2024 04:14
@FrancescAlted
Copy link
Member

Sounds good. FWIW, we are building binary wheels for blosc2 and musl, including binaries for libs and include files:

faltet@Mac-mini-de-Francesc ~/b/c-blosc2 (main)> python -c "import blosc2; print(blosc2.__path__)"       (python-blosc2)
['/Users/faltet/miniconda3/envs/python-blosc2/lib/python3.12/site-packages/blosc2']
faltet@Mac-mini-de-Francesc ~/b/c-blosc2 (main)> ls /Users/faltet/miniconda3/envs/python-blosc2/lib/libblosc2*
/Users/faltet/miniconda3/envs/python-blosc2/lib/libblosc2.2.14.3.dylib*
/Users/faltet/miniconda3/envs/python-blosc2/lib/libblosc2.2.dylib*
/Users/faltet/miniconda3/envs/python-blosc2/lib/libblosc2.a
/Users/faltet/miniconda3/envs/python-blosc2/lib/libblosc2.dylib*
faltet@Mac-mini-de-Francesc ~/b/c-blosc2 (main)> ls /Users/faltet/miniconda3/envs/python-blosc2/include/blosc2*
/Users/faltet/miniconda3/envs/python-blosc2/include/blosc2.h

/Users/faltet/miniconda3/envs/python-blosc2/include/blosc2:
blosc2-common.h     blosc2-export.h     blosc2-stdio.h      codecs-registry.h   filters-registry.h  tuners-registry.h

so having access to a development environment for Blosc2 is just a pip install blosc2 away.

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.

Feature Request: Opt ouf of blosc_get_cpu_features
2 participants