Coder Social home page Coder Social logo

Comments (7)

alexcrichton avatar alexcrichton commented on September 21, 2024

I don't really follow this, could you be a little more specific as to what the problem is?

from curl-rust.

codyps avatar codyps commented on September 21, 2024

It's a few problems:

  1. non-blessed targets (those without a particular triple in curl-sys's Cargo.toml) are broken. Adding all targets is not possible (upstream) because some of them are generated by build scripts.
  2. curl-rust built with the feature unix depends on openssl-sys (it calls a function from it), but doesn't actually depend on it (via Cargo.toml), leaving that to curl-sys (which proceeds to depend on openssl based on triplets rather than features, a mismatch between the usage and dependency).

from curl-rust.

codyps avatar codyps commented on September 21, 2024

Also, on the pkg-config bit:

The normal operation with feature(unix) and target={i686,x86_64}-unknown-linux-gnu in curl-sys causes the openssl libraries to appear three times in the link command (pkg-config --static curl adds them twice, then depending on openssl-sys adds them again)

I'd argue that it may not be entirely correct to have curl-sys depend on openssl-sys: we're essentially writing out duplicate dependency information that already exists elsewhere, and having that dependency information be wrong some of the time.

My understanding is: the curl-sys -> openssl-sys dep exists so that in the case of a system lacking curl and openssl, we can have openssl automatically built. Unfortunately, that is not all that dependency does, and curl-rust presently reliese on it for more than that (improperly, as I argue above).

It's less clear what the right way to fix this is.

from curl-rust.

alexcrichton avatar alexcrichton commented on September 21, 2024

The lack of non-blessed targets sounds like a limitation of Cargo, not the usage here. This was an explicit drawback in the RFC that drafted this support.

Note that we really do need to depend on OpenSSL on unix because we're depending on that as part of the libcurl build process. If libcurl is found on the system, then it wasn't really up to use (so the openssl-sys dep doesn't do much), but if we build libcurl from source then we require OpenSSL to be available to enable https support.

I do agree that the lack of other platform support is somewhat worrisome, but I don't see how it's specific to this project or how it relates to pkg-config though. What do you mean that the openssl libraries appear three times? This sounds like a bug?

from curl-rust.

codyps avatar codyps commented on September 21, 2024

Thanks for the link to the RFC. I don't see it mentioning that target-based dependencies will make non-blessed targets unusable without patching within the cargo ecosystem, but yes, that is something we'll want to address in cargo. In this case, it could be solved by somehow having dependencies triggered by cfg(unix).

On the curl-sys -> openssl-sys dependency: the problem is that that real-world-dependency doesn't always exist. It only shows up when we need to build the c library that backs curl-sys. In the alternate where we have pkg-config & libcurl already, pkg-config indicates the c library dependencies that exist.
And in both cases, we don't need the ffi interface curl-sys provides. [And I'd argue that curl-rust, which needs that ffi interface, should be depending on it]

While I've thrown in some other complaints, I think for now this issue can be summarized as:

Missmatch between usage and dependence on openssl-sys breaks non-blessed triples

and it'll probably be blocking on a cargo issue for that support.

from curl-rust.

alexcrichton avatar alexcrichton commented on September 21, 2024

Oh wow, sorry about that! I misremembered and then didn't even read my own RFC! Would you be ok moving this issue to rust-lang/cargo instead of curl-rust?

from curl-rust.

codyps avatar codyps commented on September 21, 2024

Closing in favor of more specific ticket(s)

from curl-rust.

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.