Comments (3)
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.
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.
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:
- Install libraries for the target system
- Configure pkg-config to use target system's sysroot
- 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)
- Dependency being constantly rebuilt due to 'env_metadata' being set to 'true' HOT 8
- Should we parse -isystem Cflags? HOT 2
- customized pkg-config is incomplete? HOT 1
- Bug: Missing support for `pkgconf` for Fedora HOT 3
- v0.3.21 raised MSRV to 1.47.0 HOT 4
- Placing pkg-config.exe file to this git if possible HOT 3
- Libraries linked in incorrect order HOT 3
- Incorrect parse result for raw archive path HOT 3
- [Feature Request] Add configurable linking modifiers HOT 6
- `PKG_CONFIG_PATH_FOR_BUILD` env var HOT 4
- Allow disabling pkg-config altogether HOT 7
- static-nobundle option
- Unable to correctly identify a type of Windows static library name, such as `foo.lib` HOT 7
- Cargo build say "library name must not be empty" while using statik(true) HOT 4
- fails with pkgconf 2.0.0 breaking changes HOT 1
- Cannot link static libraries on Windows MinGW because the Libs.private flags are ignored
- Reduce -L flag pollution by resolving -L -l flags to on-disk files
- Rustdoc docs are missing information about environment variables present in README HOT 2
- Cannot link statically against `alsa` library HOT 2
- Add tag for 0.3.30 release? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkg-config-rs.