Coder Social home page Coder Social logo

musl-libc compatibility about libsolv HOT 16 CLOSED

opensuse avatar opensuse commented on June 13, 2024
musl-libc compatibility

from libsolv.

Comments (16)

mlschroe avatar mlschroe commented on June 13, 2024

Oh well. Does MUSL-libc have anything similar to fopencookie/funopen?

from libsolv.

jmiahman avatar jmiahman commented on June 13, 2024

No it wouldn't seem that way.

http://www.openwall.com/lists/musl/2014/11/11/2

I apologize as I am just reporting this and don't understand its complexities, but is this function critical it looks as though it has to do with compression could I just return 0 instead of the error message and have it go on, without breaking any major functionality?

from libsolv.

mlschroe avatar mlschroe commented on June 13, 2024

Sure, you can do that. The basic functionality will work. The testcases use compressed data, though, so they won't succeed.

from libsolv.

jmiahman avatar jmiahman commented on June 13, 2024

Yes the test cases were failing, so that's what I was wondering. I'm using it with libhif, hoping I can get the basic functionality of libhif working and use it as a package manager.

from libsolv.

Conan-Kudo avatar Conan-Kudo commented on June 13, 2024

@mlschroe Could you please write a fallback implementation that works without funopen() or fopencookie() from libc?

from libsolv.

Conan-Kudo avatar Conan-Kudo commented on June 13, 2024

@mlschroe This issue will be fixed if PR #112 is merged into libsolv.

from libsolv.

mlschroe avatar mlschroe commented on June 13, 2024

Maybe, but creating a new thread is really something I don't like (I already told you that on IRC). Remember that libsolv is a library, so it shouldn't do things that the library user does not expect.

from libsolv.

Conan-Kudo avatar Conan-Kudo commented on June 13, 2024

@mlschroe If there is an alternate feasible approach to dealing with the lack of fopencookie(), then by all means, implement it.

The musl-libc guys do not believe that fopencookie() nor funopen() are well-defined enough to be properly implemented, and as "non-standard" functions, they don't feel compelled to implement it.

Unless you have a strong argument in favor of them implementing it, I don't see how this will get fixed without some kind of fallback implementation in libsolv.

from libsolv.

richfelker avatar richfelker commented on June 13, 2024

Is there a reason this functionality can't be provided by popen or pipe+fdopen and a child process or thread to do the decompression? This approach or a variant should be completely portable and likely simpler.

from libsolv.

Conan-Kudo avatar Conan-Kudo commented on June 13, 2024

@mlschroe Would an approach like @richfelker is suggesting be possible for you to implement as a portable fallback mechanism for libsolv instead of using the fopencookie stuff?

from libsolv.

mlschroe avatar mlschroe commented on June 13, 2024

How's that different from using the pthread library?

from libsolv.

richfelker avatar richfelker commented on June 13, 2024

The difference is between emulating the fopencookie/funopen API, which isn't actually possible in general and which just happens to work for special cases that are hard to state rigorously, and using a simpler, less-powerful API directly in the way it was intended to be used. I prefer the latter because the constraints are clear and there's no risk that changes to the calling code might break the assumptions being made in the fake fopencookie.

from libsolv.

Conan-Kudo avatar Conan-Kudo commented on June 13, 2024

@mlschroe From my perspective, it seems like @richfelker may have a point.

While you've stated that you don't like the idea of libsolv creating threads/processes on its own, it seems that there's no way around that for this. Is it because you want to guarantee libsolv is thread-safe?

from libsolv.

sebcat avatar sebcat commented on June 13, 2024

Hello,

Came across this issue entry by accident. Thought I'd mention that musl added support for fopencookie(3) Dec-2017: https://git.musl-libc.org/cgit/musl/commit/src/stdio/fopencookie.c?id=061843340fbf2493bb615e20e66f60c5d1ef0455

from libsolv.

Conan-Kudo avatar Conan-Kudo commented on June 13, 2024

@sebcat Yeah, once that makes it to a released version of musl, this issue will be effectively resolved.

from libsolv.

ignatenkobrain avatar ignatenkobrain commented on June 13, 2024

Nothing to do from libsolv side.

from libsolv.

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.