flipper-io / flipper

Flipper is a development platform that can be controlled from any programming language.
https://www.flipper.io/
Apache License 2.0
70 stars 15 forks source link

WAF breaks on linux systems with properly configured cross compilers. #58

Closed TravisWhitaker closed 8 years ago

TravisWhitaker commented 8 years ago

Most Linux systems will have a family of environment variables of the form CC, CXX for each architecture for which a toolchain is installed. This causes WAF to invoke some opaque (i.e. not obvious from the waf source) set of special cases if these environment variables are present, causing the configure phase to choose the wrong compiler for non-native architectures. WAF has a similar set of heuristics for LD_FLAGS and friends. Hacking around this by saving and restoring the enclosing environment is error-prone and will require lots of special cases for different Linux distributions (and even then will break for anyone with an atypical setup). It is not clear from the WAF documentation or source how to prevent this behavior. I have been working around this by maintaining my own wscript files that have the relevant variables hard-coded; this is obviously not an OK way to work going forward.

This issue is high-priority, as flipper can't currently be built from source on Gentoo, Debian, or NixOS (or, notionally, any distro that correctly sets up cross compiler environments).

TravisWhitaker commented 8 years ago

A specific instance of this issue may be reproduced by doing something like:

$ export CC `which gcc`
$./waf wscript configure

And noting that WAF chooses the system GCC for the AVR and ARM targets.