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
105582ed
Unverified
Commit
105582ed
authored
Feb 05, 2020
by
Christopher Fujino
Committed by
GitHub
Feb 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test to verify binaries are signed on release branches (#50074)
parent
1c15cd86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
0 deletions
+76
-0
.cirrus.yml
.cirrus.yml
+9
-0
codesign.dart
dev/bots/codesign.dart
+67
-0
No files found.
.cirrus.yml
View file @
105582ed
...
@@ -652,6 +652,15 @@ task:
...
@@ -652,6 +652,15 @@ task:
-
ulimit -S -n 2048
# https://github.com/flutter/flutter/issues/2976
-
ulimit -S -n 2048
# https://github.com/flutter/flutter/issues/2976
-
./dev/bots/deploy_gallery.sh
-
./dev/bots/deploy_gallery.sh
-
name
:
verify_binaries_codesigned-macos
# macos-only
# TODO(fujino): remove this `only_if` after https://github.com/flutter/flutter/issues/44372
only_if
:
"
$CIRRUS_BRANCH
==
'dev'
||
$CIRRUS_BRANCH
==
'beta'
||
$CIRRUS_BRANCH
==
'stable'
||
$CIRRUS_BRANCH
=~
'.*hotfix.*'"
depends_on
:
-
analyze-linux
script
:
-
ulimit -S -n 2048
# https://github.com/flutter/flutter/issues/2976
-
dart --enable-asserts ./dev/bots/codesign.dart
docker_builder
:
docker_builder
:
# Only build a new docker image when we tag a release (for dev, beta, or
# Only build a new docker image when we tag a release (for dev, beta, or
# stable). Note: tagging a commit and pushing to a release branch are
# stable). Note: tagging a commit and pushing to a release branch are
...
...
dev/bots/codesign.dart
0 → 100644
View file @
105582ed
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
String
get
cacheDirectory
{
final
String
flutterRepoRoot
=
path
.
normalize
(
path
.
join
(
path
.
dirname
(
Platform
.
script
.
path
),
'..'
,
'..'
));
return
path
.
normalize
(
path
.
join
(
flutterRepoRoot
,
'bin'
,
'cache'
));
}
bool
isBinary
(
String
filePath
)
{
final
ProcessResult
result
=
Process
.
runSync
(
'file'
,
<
String
>[
'--mime-type'
,
'-b'
,
// is binary
filePath
,
],
);
return
(
result
.
stdout
as
String
).
contains
(
'application/x-mach-binary'
);
}
List
<
String
>
findBinaryPaths
()
{
final
ProcessResult
result
=
Process
.
runSync
(
'find'
,
<
String
>[
cacheDirectory
,
'-type'
,
'f'
,
'-perm'
,
'+111'
,
// is executable
],
);
final
List
<
String
>
allFiles
=
(
result
.
stdout
as
String
).
split
(
'
\n
'
).
where
((
String
s
)
=>
s
.
isNotEmpty
).
toList
();
return
allFiles
.
where
(
isBinary
).
toList
();
}
void
main
(
)
{
final
List
<
String
>
failures
=
<
String
>[];
for
(
final
String
binaryPath
in
findBinaryPaths
())
{
print
(
'Verifying the code signature of
$binaryPath
'
);
final
ProcessResult
result
=
Process
.
runSync
(
'codesign'
,
<
String
>[
'-vvv'
,
binaryPath
,
],
);
if
(
result
.
exitCode
!=
0
)
{
failures
.
add
(
binaryPath
);
print
(
'File "
$binaryPath
" does not appear to be codesigned.
\n
'
'The `codesign` command failed with exit code
${result.exitCode}
:
\n
'
'
${result.stderr}
\n
'
);
}
}
if
(
failures
.
isNotEmpty
)
{
print
(
'Found
${failures.length}
unsigned binaries.'
);
failures
.
forEach
(
print
);
exit
(
1
);
}
print
(
'Verified that binaries are codesigned.'
);
}
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