Giter Club home page Giter Club logo

Comments (7)

HadrienG2 avatar HadrienG2 commented on August 15, 2024 1

I have cross-checked the musl source code, and it turns out that their pthread_t definition is made of as much insanity as the rest of their threading support...

#ifdef __cplusplus
TYPEDEF unsigned long pthread_t;
#else
TYPEDEF struct __pthread * pthread_t;
#endif

...so I guess I'll just redefine ThreadId to be c_ulong on musl and call it a day. 🤷

from hwlocality.

HadrienG2 avatar HadrienG2 commented on August 15, 2024 1

Should be good now.

from hwlocality.

HadrienG2 avatar HadrienG2 commented on August 15, 2024

Do we know why libc::pthread_t is void* on Alpine ? Is it a general musl thing ?

from hwlocality.

HoKim98 avatar HoKim98 commented on August 15, 2024

Wow, musl is so amazing. I've never seen such an inconvenient and insane implementation.

from hwlocality.

HadrienG2 avatar HadrienG2 commented on August 15, 2024

Try to update to the freshly released hwlocality-sys v0.4.1 and you should hopefully be good to go.

from hwlocality.

HoKim98 avatar HoKim98 commented on August 15, 2024

Sorry for necrobumping, but there is one remaining error

error[E0308]: mismatched types
   --> src/lib.rs:266:14
    |
264 | pub fn current_thread_id() -> ThreadId {
    |                               -------- expected `u64` because of return type
265 |     // SAFETY: Should be always safe to call
266 |     unsafe { libc::pthread_self() }
    |              ^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `*mut c_void`
    |
    = note:     expected type `u64`
            found raw pointer `*mut c_void`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `hwlocality` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

from hwlocality.

HadrienG2 avatar HadrienG2 commented on August 15, 2024

This should be resolved by #116, and the hwlocality 1.0.0-alpha.2 release that I'll push which integrates it.

Long-term, I should set up a musl build in CI to avoid this sort of issues, but I do not have the time for this right now.

from hwlocality.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.