Commit Graph
23 Commits
Author SHA1 Message Date
Misty De Meo 5863f8af89 Compiler priority: fix llvm-gcc priority
llvm-gcc should still get priority over non-Apple GCCs.

Fixes #22424.
2013-09-10 08:17:28 -07:00
Misty De Meo acee7d04db Remove attr_rw for CompilerFailure version attribute
This reverts commit 7db9ef9650.
2013-09-01 22:37:03 -07:00
Misty De Meo 7db9ef9650 CompilerFailure: specify attr_rw for version 2013-09-01 21:26:30 -07:00
Misty De Meo 733076ec22 Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:

fails_with :gcc => '4.8.1' do
  cause 'Foo'
end

Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings instead.

Internally non-Apple compilers can be distinguished because they are
passed around as strings instead of symbols.

In addition, this alters the priority list for compilers, with the
following changes:

* Apple GCC 4.2 and LLVM-GCC swap positions, with GCC now taking
  priority. (Maybe LLVM-GCC should just go away.)
* Non-Apple GCC compilers are ranked below GCC 4.2 but above LLVM-GCC
  and Apple GCC 4.0.
2013-09-01 13:19:13 -07:00
Jack Nagel 5f032942ed Remove unused variable 2013-06-12 17:25:29 -05:00
Jack Nagel 0759cce3c2 Extract attr_rw from Formula for reuse
Closes #20239.
2013-06-04 11:06:18 -05:00
Misty De Meo f35724c20a Add gcc 4.0 to CompilerSelector compiler queue 2013-05-20 23:25:15 -05:00
Misty De Meo 7780e13182 CompilerSelector: raise when no compatible compiler
This replaces the old behaviour of falling back to the original
compiler with no messaging.

Fixes #19170.
Fixes mistydemeo/tigerbrew#45.
2013-05-20 23:25:15 -05:00
Misty De Meo 733058f24f Add gcc-4.0 to fails_with 2013-05-08 09:38:15 -05:00
Jack Nagel 725704f7fb Isolate compiler selector tests 2013-04-02 13:19:04 -05:00
Jack Nagel e4cbfe11ec CompilerSelector: don't use non-existent compilers 2013-04-02 13:19:04 -05:00
Jack Nagel 2ccca70dc3 Bump useable clang version to 318
Build 211 can build most things, but I've seen intermittent
miscompilation and slower code. Also it comes from Xcode 4.2, so most
people don't have it anyway. Let's use 218 as the minimum viable
version.
2013-04-02 13:19:04 -05:00
Jack Nagel 6ab348ea0a Decouple CompilerSelector from ENV 2013-03-16 13:05:02 -05:00
Jack Nagel aa69b671b3 Use a priority queue to select compilers
The existing case-statement with nested if-statements is gross and hard
to extend. Replacing it with a priority queue simplifies the logic and
makes it very easy to add new compilers to the fails_with system, which
we will likely want to do in the future.
2013-03-16 13:05:02 -05:00
Jack Nagel f91df69127 Replace custom collection with Set
The original constraints that led to using a custom collection rather
than Array or Set here no longer exist, so let's avoid the pointless
abstraction here.
2013-03-16 13:05:02 -05:00
Jack Nagel 5ddd40b844 Switch compilers when no build is specified
Given the current state of OS X compilers, the original fails_with
behavior is becoming less useful, mostly resulting in build failures
each time the compiler is updated. So make the following changes:

When a build is specified, we retain the old behavior: switch compilers
if the available compiler is <= the build, don't switch if it is > the
build.

When no build is specified, unconditionally switch compilers, and don't
output the advice message. This allows us to mark formulae as
perpetually failing, avoiding the need to update formulae each time a
new compiler build is made available.

As a bonus, this makes the logic much easier to reason about.

Closes #18175.
2013-03-12 13:55:15 -05:00
Mike McQuaid c0793d5296 Only fails_with compiler version for developers.
Actually works properly now.

This reverts commit a0e56345ea.
2013-02-21 21:40:15 +00:00
Mike McQuaid a0e56345ea Revert "Only fails_with compiler version for developers."
This reverts commit c98d504952.
2013-02-20 16:39:04 +00:00
Mike McQuaid c98d504952 Only fails_with compiler version for developers.
Closes #17618.
Closes #17813.
2013-02-18 19:37:44 +00:00
Jack Nagel 4d341f2115 Don't shadow outer local variables 2013-02-18 12:13:36 -06:00
Jack Nagel c48c568a3e Remove Array subclassing
Inheriting from Array (and other core types) is problematic:

  - It exposes a very wide interface with many methods that are not
    really relevant to the subclass.
  - It can cause some weird side effects, as many Array operations are
    in C and have hardcoded return values; for example, combining two
    array subclasses returns a new Array instead of the subclass.

Avoid these problems using delegation and the Enumerable module where
applicable.
2013-01-07 14:32:14 -06:00
Mike McQuaid b435c79ce0 Don't warn uses on :fails_with compiler blocks.
Fixes #14121.
2012-08-11 17:19:43 +01:00
Jack Nagel b36f59dd3c New fails_with infrastructure
- Formulae can now declare failures on any compiler.
 - FailsWithLLVM and associated formula elements have been moved to
   compat.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-01 12:39:59 -05:00