Code Monkey home page Code Monkey logo

Comments (3)

ryankurte avatar ryankurte commented on August 15, 2024

I was about to open an issue requesting the ability to set this via configuration, so we don't need to surprise users with environmental variables when building crates.

I am however unclear on why this couldn't be done automatically (and with sane defaults) if we detect the target to be different to the host?

Somewhat related issue about building *-sys crates: rust-embedded#481

from pkg-config-rs.

sdroege avatar sdroege commented on August 15, 2024

I was about to open an issue requesting the ability to set this via configuration

What configuration are you thinking of, ooc? Apart from environment variables there is nothing really or is there?

I agree that this should be documented better though. Someone wants to give it a try?

from pkg-config-rs.

kornelski avatar kornelski commented on August 15, 2024

I am however unclear on why this couldn't be done automatically

You mean setting "PKG_CONFIG_ALLOW_CROSS=1"? It's a totally artificial barrier added intentionally. It could be removed, but it would only lead to worse errors at later stages of the build.

The problem is that pkg-config doesn't support cross-compilation. User has to do some work first to trick pkg-config into doing the right thing for cross-compilation.

PKG_CONFIG_ALLOW_CROSS=1 is like a "ROAD CLOSED" sign. Yes, you can very easily remove the "ROAD CLOSED" sign! But it doesn't achieve anything, and only makes things worse.

The real instruction should be:

  1. Install libraries for the target system
  2. Configure pkg-config to use target system's sysroot
  3. Then try building again

Point (1) is a bit beyond scope of what Cargo crates should be doing, so it can't be automated.

Point (2) could be automated for some well-known setups.

from pkg-config-rs.

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.