Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
632526aa
Unverified
Commit
632526aa
authored
Aug 29, 2019
by
Dan Field
Committed by
GitHub
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update validation to support Xcode11 version (#39463)
parent
d2f70a6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
6 deletions
+81
-6
build_aot.dart
packages/flutter_tools/lib/src/commands/build_aot.dart
+7
-6
build_aot_test.dart
...ter_tools/test/general.shard/commands/build_aot_test.dart
+74
-0
No files found.
packages/flutter_tools/lib/src/commands/build_aot.dart
View file @
632526aa
...
...
@@ -226,19 +226,20 @@ Future<void> validateBitcode(BuildMode buildMode, TargetPlatform targetPlatform)
}
Version
_parseVersionFromClang
(
String
clangVersion
)
{
const
String
prefix
=
'Apple LLVM version '
;
final
RegExp
pattern
=
RegExp
(
r'Apple (LLVM|clang) version (\d+\.\d+\.\d+) '
)
;
void
_invalid
()
{
throwToolExit
(
'Unable to parse Clang version from "
$clangVersion
". '
'Expected a string like "
$prefix
#.#.# (clang-####.#.##.#)".'
);
'Expected a string like "
Apple (LLVM|clang)
#.#.# (clang-####.#.##.#)".'
);
}
if
(
clangVersion
==
null
||
clangVersion
.
length
<=
prefix
.
length
||
!
clangVersion
.
startsWith
(
prefix
))
{
if
(
clangVersion
==
null
||
clangVersion
.
isEmpty
)
{
_invalid
();
}
final
int
lastSpace
=
clangVersion
.
lastIndexOf
(
' '
);
if
(
lastSpace
==
-
1
)
{
final
RegExpMatch
match
=
pattern
.
firstMatch
(
clangVersion
);
if
(
match
==
null
||
match
.
groupCount
!=
2
)
{
_invalid
();
}
final
Version
version
=
Version
.
parse
(
clangVersion
.
substring
(
prefix
.
length
,
lastSpace
));
final
Version
version
=
Version
.
parse
(
match
.
group
(
2
));
if
(
version
==
null
)
{
_invalid
();
}
...
...
packages/flutter_tools/test/general.shard/commands/build_aot_test.dart
View file @
632526aa
...
...
@@ -43,6 +43,80 @@ void main() {
FileSystem:
()
=>
memoryFileSystem
,
});
testUsingContext
(
'build aot prints error if Clang version invalid'
,
()
async
{
final
Directory
flutterFramework
=
memoryFileSystem
.
directory
(
'ios_profile/Flutter.framework'
)
..
createSync
(
recursive:
true
);
flutterFramework
.
childFile
(
'Flutter'
).
createSync
();
final
File
infoPlist
=
flutterFramework
.
childFile
(
'Info.plist'
)..
createSync
();
final
RunResult
clangResult
=
RunResult
(
FakeProcessResult
(
stdout:
'Apple pie version 10.1.0 (clang-4567.1.1.1)
\n
BlahBlah
\n
'
,
stderr:
''
),
const
<
String
>[
'foo'
],
);
when
(
mockXcode
.
clang
(
any
)).
thenAnswer
((
_
)
=>
Future
<
RunResult
>.
value
(
clangResult
));
when
(
mockPlistUtils
.
getValueFromFile
(
infoPlist
.
path
,
'ClangVersion'
)).
thenReturn
(
'Apple LLVM version 10.0.1 (clang-1234.1.12.1)'
);
await
expectToolExitLater
(
validateBitcode
(
BuildMode
.
profile
,
TargetPlatform
.
ios
),
equals
(
'Unable to parse Clang version from "Apple pie version 10.1.0 (clang-4567.1.1.1)". '
'Expected a string like "Apple (LLVM|clang) #.#.# (clang-####.#.##.#)".'
),
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
LocalEngineArtifacts
(
'/engine'
,
'ios_profile'
,
'host_profile'
),
FileSystem:
()
=>
memoryFileSystem
,
ProcessManager:
()
=>
mockProcessManager
,
Xcode:
()
=>
mockXcode
,
Logger:
()
=>
bufferLogger
,
PlistParser:
()
=>
mockPlistUtils
,
});
testUsingContext
(
'build aot can parse valid Xcode Clang version (10)'
,
()
async
{
final
Directory
flutterFramework
=
memoryFileSystem
.
directory
(
'ios_profile/Flutter.framework'
)
..
createSync
(
recursive:
true
);
flutterFramework
.
childFile
(
'Flutter'
).
createSync
();
final
File
infoPlist
=
flutterFramework
.
childFile
(
'Info.plist'
)..
createSync
();
final
RunResult
clangResult
=
RunResult
(
FakeProcessResult
(
stdout:
'Apple LLVM version 10.1.0 (clang-4567.1.1.1)
\n
BlahBlah
\n
'
,
stderr:
''
),
const
<
String
>[
'foo'
],
);
when
(
mockXcode
.
clang
(
any
)).
thenAnswer
((
_
)
=>
Future
<
RunResult
>.
value
(
clangResult
));
when
(
mockPlistUtils
.
getValueFromFile
(
infoPlist
.
path
,
'ClangVersion'
)).
thenReturn
(
'Apple LLVM version 10.0.1 (clang-1234.1.12.1)'
);
await
validateBitcode
(
BuildMode
.
profile
,
TargetPlatform
.
ios
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
LocalEngineArtifacts
(
'/engine'
,
'ios_profile'
,
'host_profile'
),
FileSystem:
()
=>
memoryFileSystem
,
ProcessManager:
()
=>
mockProcessManager
,
Xcode:
()
=>
mockXcode
,
Logger:
()
=>
bufferLogger
,
PlistParser:
()
=>
mockPlistUtils
,
});
testUsingContext
(
'build aot can parse valid Xcode Clang version (11)'
,
()
async
{
final
Directory
flutterFramework
=
memoryFileSystem
.
directory
(
'ios_profile/Flutter.framework'
)
..
createSync
(
recursive:
true
);
flutterFramework
.
childFile
(
'Flutter'
).
createSync
();
final
File
infoPlist
=
flutterFramework
.
childFile
(
'Info.plist'
)..
createSync
();
final
RunResult
clangResult
=
RunResult
(
FakeProcessResult
(
stdout:
'Apple clang version 11.0.0 (clang-4567.1.1.1)
\n
BlahBlah
\n
'
,
stderr:
''
),
const
<
String
>[
'foo'
],
);
when
(
mockXcode
.
clang
(
any
)).
thenAnswer
((
_
)
=>
Future
<
RunResult
>.
value
(
clangResult
));
when
(
mockPlistUtils
.
getValueFromFile
(
infoPlist
.
path
,
'ClangVersion'
)).
thenReturn
(
'Apple LLVM version 10.0.1 (clang-1234.1.12.1)'
);
await
validateBitcode
(
BuildMode
.
profile
,
TargetPlatform
.
ios
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
LocalEngineArtifacts
(
'/engine'
,
'ios_profile'
,
'host_profile'
),
FileSystem:
()
=>
memoryFileSystem
,
ProcessManager:
()
=>
mockProcessManager
,
Xcode:
()
=>
mockXcode
,
Logger:
()
=>
bufferLogger
,
PlistParser:
()
=>
mockPlistUtils
,
});
testUsingContext
(
'build aot validates Flutter.framework/Flutter was built with same toolchain'
,
()
async
{
final
Directory
flutterFramework
=
memoryFileSystem
.
directory
(
'ios_profile/Flutter.framework'
)
..
createSync
(
recursive:
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment