Project

General

Profile

Actions

Task #2404

closed

Incorrect compiler defaults on FreeBSD platform

Added by Alex Afanasyev about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Build
Target version:
Start date:
01/22/2015
Due date:
% Done:

100%

Estimated time:

Description

Our waf is not using correct compiler defaults on FreeBSD 10.1. It first checks for g++, which is actually symlinked to clang. When in our scripts we check versions, waf still thinks it uses gcc compiler and we incorrectly fail the compilation with the error that the compiler is too old.

The current workaround is to explicitly tell waf to detect clang compiler:

./waf configure --check-cxx-compiler=clang++

There are two ways how things can get improved:

  • We should set correct defaults for FreeBSD platform (e.g., compiler check order should be: clang++, g++)

  • We can make compiler version check an advisory. In other words, instead of failing the compilation, we can just warn that we expect the compilation to fail.


Related issues 1 (0 open1 closed)

Related to NFD - Task #2168: Jenkins: FreeBSD 10.1 slaveClosedAshlesh Gawande

Actions
Actions #1

Updated by Alex Afanasyev about 9 years ago

  • Related to Task #2168: Jenkins: FreeBSD 10.1 slave added
Actions #2

Updated by Alex Afanasyev about 9 years ago

  • Status changed from New to Code review
  • % Done changed from 0 to 100
Actions #3

Updated by Davide Pesavento about 9 years ago

Sounds like an upstream waf bug... it should not be relying on the executable name, instead it should parse the output of ${compiler} --version or something like that.

Actions #4

Updated by Davide Pesavento about 9 years ago

  • Description updated (diff)
Actions #5

Updated by Alex Afanasyev about 9 years ago

  • Description updated (diff)

It is not relying on the name. Inside waf, it has a number of "tools" for compiler detection and it tries them in specific order (there is a default one and can be overridden by --check-cxx-compiler=clang++ option. The specific compiler detection tool sets CXX_NAME variable (common name for the compiler), which we use to do other funky business in default-compiler-flags.

I would say it is correct behavior, as it is close to impossible to guess the compiler type and name neither based on file name nor version output. Waf is trying hard to properly guess version, but it is still kind of compiler-specific.

Actions #6

Updated by Alex Afanasyev about 9 years ago

  • Description updated (diff)
Actions #7

Updated by Alex Afanasyev about 9 years ago

  • Description updated (diff)
Actions #8

Updated by Alex Afanasyev about 9 years ago

In any case. I have already submitted a bug report with suggested path to waf issue tracker (the version in http://gerrit.named-data.net/#/c/1662/ is master branch plus few extra things, including the fix for this issue).

Actions #9

Updated by Davide Pesavento about 9 years ago

Alex Afanasyev wrote:

It is not relying on the name. Inside waf, it has a number of "tools" for compiler detection and it tries them in specific order (there is a default one and can be overridden by --check-cxx-compiler=clang++ option. The specific compiler detection tool sets CXX_NAME variable (common name for the compiler), which we use to do other funky business in default-compiler-flags.

Well, whatever the "gcc detection tool" is relying on is broken then. It's still a waf bug. I don't think we're doing anything particularly funky.

I would say it is correct behavior, as it is close to impossible to guess the compiler type and name neither based on file name nor version output. Waf is trying hard to properly guess version, but it is still kind of compiler-specific.

I find it hard to agree. First, by definition it cannot be correct behavior, since it's mis-detecting the compiler. Second, I've never had this kind of problem with other (more mature I guess) build systems. Anyway, this is beside the point. If change 1662 works I'm fine with it.

Actions #10

Updated by Alex Afanasyev about 9 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF