Skip to content

Commit 4c47fdb

Browse files
sstricklcommit-bot@chromium.org
authored andcommitted
[gardening] Fix SDKArtifactSizes benchmark.
Compress the dart-sdk directory under the root, not the grandparent of the root which will be the SDK checkout. Also fix so dart2 version is 2.9 compatible and dart version is latest version compatible. Change-Id: I6e8875d9a3c9fdabf301db379340b2d8473a54cc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210440 Reviewed-by: Daco Harkes <[email protected]> Commit-Queue: Tess Strickland <[email protected]>
1 parent 19d12d1 commit 4c47fdb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

benchmarks/SDKArtifactSizes/dart/SDKArtifactSizes.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ Future<void> main() async {
6666

6767
// Measure the (compressed) sdk size.
6868
final tempDir = Directory.systemTemp.createTempSync('dartdev');
69-
final sdkArchive =
70-
compress(File(Platform.resolvedExecutable).parent.parent, tempDir);
71-
await reportArtifactSize(sdkArchive?.path, 'sdk');
69+
final sdkArchive = compress(Directory('$rootDir/dart-sdk'), tempDir);
70+
await reportArtifactSize(sdkArchive?.path ?? '', 'sdk');
7271
tempDir.deleteSync(recursive: true);
7372
}
7473

75-
File compress(Directory sourceDir, Directory targetDir) {
74+
File? compress(Directory sourceDir, Directory targetDir) {
7675
final outFile = File('${targetDir.path}/sdk.zip');
7776

7877
if (Platform.isMacOS || Platform.isLinux) {

benchmarks/SDKArtifactSizes/dart2/SDKArtifactSizes.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// @dart=2.9
6+
57
// Reports the sizes of binary artifacts shipped with the SDK.
68

79
import 'dart:io';
@@ -66,13 +68,12 @@ Future<void> main() async {
6668

6769
// Measure the (compressed) sdk size.
6870
final tempDir = Directory.systemTemp.createTempSync('dartdev');
69-
final sdkArchive =
70-
compress(File(Platform.resolvedExecutable).parent.parent, tempDir);
71+
final sdkArchive = compress(Directory('$rootDir/dart-sdk'), tempDir);
7172
await reportArtifactSize(sdkArchive?.path ?? '', 'sdk');
7273
tempDir.deleteSync(recursive: true);
7374
}
7475

75-
File? compress(Directory sourceDir, Directory targetDir) {
76+
File compress(Directory sourceDir, Directory targetDir) {
7677
final outFile = File('${targetDir.path}/sdk.zip');
7778

7879
if (Platform.isMacOS || Platform.isLinux) {

0 commit comments

Comments
 (0)