[Boost-bugs] [Boost C++ Libraries] #4667: boost-build: configuration of toolset gcc does not enforce requested versions and accepts non-existing commands

Subject: [Boost-bugs] [Boost C++ Libraries] #4667: boost-build: configuration of toolset gcc does not enforce requested versions and accepts non-existing commands
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-09-21 13:35:45


#4667: boost-build: configuration of toolset gcc does not enforce requested
versions and accepts non-existing commands
-----------------------------------------------------------------------+----
 Reporter: mhassert@… | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: build
  Version: Boost Development Trunk | Severity: Problem
 Keywords: bjam boost build boost-build gcc toolset version compiler |
-----------------------------------------------------------------------+----
 When one configures toolset gcc with a non-existing command it is accepted
 and an error is not reported until compilation starts.

 When one configures toolset gcc with a version but no command (e.g. from
 the command line), boost build silently uses default command g++ without
 any version checking.

 Examples:

 a)
 - in ~/user-config.jam insert "using gcc : 4.1 : gcc-4.1-FORCE-ERROR ;"
 - run bjam --toolset=gcc-4.1 --debug-configuration -d+2
 result: configuration of gcc-4.1 notices the not-found command but
 contuinues and later all compilations fail due to a "command not found"

 b)
 - add "using gcc : 9.9 ;" to ~/user-config.jam and run "bjam"
 OR
 - run bjam --toolset=gcc-9.9 --debug-configuration -d+2
 result: auto configuration silently uses command "g++" but the version
 "9.9" is nontheless used in build paths tricking the user into thinking
 the requested compiler version was actually used.
 This is especially dangerous as any typo in the version on the command
 line does result in using the default compiler instead of a previously
 configured one.

 What should happen:
 - If only a version is given, boost build should try to deduce the correct
 command:
 "g++-VERSION" and "g++" with matching version should be considered in that
 order.
 - boost build should inform the user if the requested compiler
 command/version is not available and stop with an error.

 I have attached a patch that changes tools/gcc.jam into what I think it
 should look like.

 Note:
 Several mails on the mailing list suggest that a similar problem exists
 with toolset msvc and probably other toolsets, too. For example using
 toolset=msvc-8 instead of toolset=msvc-8.0 seems to use some default
 version instead of using 8.0 or failing. As msvc configuration code seems
 quite different, I have not looked further into this.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4667>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC