Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
a55fa2c3
Commit
a55fa2c3
authored
12 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Decouple CompilerSelector from ENV
parent
f8b49597
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Library/Homebrew/build.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/build.rb
Library/Homebrew/compilers.rb
+2
-2
2 additions, 2 deletions
Library/Homebrew/compilers.rb
Library/Homebrew/test/test_compilers.rb
+7
-36
7 additions, 36 deletions
Library/Homebrew/test/test_compilers.rb
with
10 additions
and
39 deletions
Library/Homebrew/build.rb
+
1
−
1
View file @
a55fa2c3
...
...
@@ -114,7 +114,7 @@ def install f
end
end
CompilerSelector
.
new
(
f
).
select_
compiler
if
f
.
fails_with?
ENV
.
compiler
ENV
.
send
(
CompilerSelector
.
new
(
f
).
compiler
)
if
f
.
fails_with?
ENV
.
compiler
f
.
brew
do
if
ARGV
.
flag?
'--git'
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/compilers.rb
+
2
−
2
View file @
a55fa2c3
...
...
@@ -56,11 +56,11 @@ class CompilerSelector
end
end
def
select_
compiler
def
compiler
begin
cc
=
@compilers
.
pop
end
while
@f
.
fails_with?
(
cc
)
ENV
.
send
(
cc
.
name
)
unless
cc
.
n
il?
cc
.
nil?
?
@old_compiler
:
cc
.
n
ame
end
private
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/test_compilers.rb
+
7
−
36
View file @
a55fa2c3
...
...
@@ -2,14 +2,6 @@ require 'testing_env'
require
'test/testball'
class
CompilerTests
<
Test
::
Unit
::
TestCase
def
setup
%w{HOMEBREW_USE_CLANG HOMEBREW_USE_LLVM HOMEBREW_USE_GCC}
.
each
{
|
v
|
ENV
.
delete
(
v
)
}
end
def
teardown
ENV
.
send
MacOS
.
default_compiler
end
def
test_llvm_failure
f
=
TestLLVMFailure
.
new
cs
=
CompilerSelector
.
new
(
f
)
...
...
@@ -17,13 +9,10 @@ class CompilerTests < Test::Unit::TestCase
assert
!
(
f
.
fails_with?
:clang
)
assert
f
.
fails_with?
:llvm
assert
!
(
f
.
fails_with?
:gcc
)
cs
.
select_compiler
assert_equal
case
MacOS
.
clang_build_version
when
0
..
210
then
:gcc
else
:clang
end
,
ENV
.
compiler
end
,
cs
.
compiler
end
def
test_all_compiler_failures
...
...
@@ -33,10 +22,7 @@ class CompilerTests < Test::Unit::TestCase
assert
f
.
fails_with?
:clang
assert
f
.
fails_with?
:llvm
assert
f
.
fails_with?
:gcc
cs
.
select_compiler
assert_equal
MacOS
.
default_compiler
,
ENV
.
compiler
assert_equal
MacOS
.
default_compiler
,
cs
.
compiler
end
def
test_no_compiler_failures
...
...
@@ -49,10 +35,7 @@ class CompilerTests < Test::Unit::TestCase
when
nil
then
f
.
fails_with?
:gcc
else
!
(
f
.
fails_with?
:gcc
)
end
cs
.
select_compiler
assert_equal
MacOS
.
default_compiler
,
ENV
.
compiler
assert_equal
MacOS
.
default_compiler
,
cs
.
compiler
end
def
test_mixed_compiler_failures
...
...
@@ -62,10 +45,7 @@ class CompilerTests < Test::Unit::TestCase
assert
f
.
fails_with?
:clang
assert
!
(
f
.
fails_with?
:llvm
)
assert
f
.
fails_with?
:gcc
cs
.
select_compiler
assert_equal
:llvm
,
ENV
.
compiler
assert_equal
:llvm
,
cs
.
compiler
end
def
test_more_mixed_compiler_failures
...
...
@@ -75,10 +55,7 @@ class CompilerTests < Test::Unit::TestCase
assert
!
(
f
.
fails_with?
:clang
)
assert
f
.
fails_with?
:llvm
assert
f
.
fails_with?
:gcc
cs
.
select_compiler
assert_equal
:clang
,
ENV
.
compiler
assert_equal
:clang
,
cs
.
compiler
end
def
test_even_more_mixed_compiler_failures
...
...
@@ -91,13 +68,10 @@ class CompilerTests < Test::Unit::TestCase
when
nil
then
f
.
fails_with?
:gcc
else
!
(
f
.
fails_with?
:gcc
)
end
cs
.
select_compiler
assert_equal
case
MacOS
.
gcc_42_build_version
when
nil
then
:llvm
else
:gcc
end
,
ENV
.
compiler
end
,
cs
.
compiler
end
def
test_block_with_no_build_compiler_failures
...
...
@@ -107,9 +81,6 @@ class CompilerTests < Test::Unit::TestCase
assert
f
.
fails_with?
:clang
assert
!
(
f
.
fails_with?
:llvm
)
assert
!
(
f
.
fails_with?
:gcc
)
cs
.
select_compiler
assert_not_equal
:clang
,
ENV
.
compiler
assert_not_equal
:clang
,
cs
.
compiler
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment