Stop using/generating spec.sum file.

For some time now, this file has had the same contents as strong.sum.
There's no point in keeping it around.

Change-Id: I793a41ca6cb1c47c68357f549d299fa95b96c4c5
Reviewed-on: https://dart-review.googlesource.com/71701
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2018-08-30 12:32:52 +00:00 committed by commit-bot@chromium.org
parent b9a2e1026b
commit d04d304909
9 changed files with 24 additions and 50 deletions

View file

@ -300,8 +300,6 @@ const Map<String, LibraryInfo> libraries = const {
librariesContent);
if (generateSummaryFiles) {
List<int> bytes = _computeLinkedBundleBytes();
provider.newFileWithBytes(
provider.convertPath('/lib/_internal/spec.sum'), bytes);
provider.newFileWithBytes(
provider.convertPath('/lib/_internal/strong.sum'), bytes);
}
@ -369,7 +367,7 @@ const Map<String, LibraryInfo> libraries = const {
PackageBundle getLinkedBundle() {
if (_bundle == null) {
resource.File summaryFile =
provider.getFile(provider.convertPath('/lib/_internal/spec.sum'));
provider.getFile(provider.convertPath('/lib/_internal/strong.sum'));
List<int> bytes;
if (summaryFile.exists) {
bytes = summaryFile.readAsBytesSync();

View file

@ -163,9 +163,7 @@ abstract class AbstractDartSdk implements DartSdk {
@override
PackageBundle getLinkedBundle() {
if (_useSummary) {
// TODO(brianwilkerson) 'strongMode' should probably always be 'true'.
bool strongMode = _analysisOptions != null;
_sdkBundle ??= getSummarySdkBundle(strongMode);
_sdkBundle ??= getSummarySdkBundle();
return _sdkBundle;
}
return null;
@ -181,7 +179,7 @@ abstract class AbstractDartSdk implements DartSdk {
* This method should not be used outside of `analyzer` and `analyzer_cli`
* packages.
*/
PackageBundle getSummarySdkBundle(bool strongMode);
PackageBundle getSummarySdkBundle();
Source internalMapDartUri(String dartUri) {
// TODO(brianwilkerson) Figure out how to unify the implementations in the
@ -300,8 +298,8 @@ class EmbedderSdk extends AbstractDartSdk {
String getRelativePathFromFile(File file) => file.path;
@override
PackageBundle getSummarySdkBundle(bool strongMode) {
String name = strongMode ? 'strong.sum' : 'spec.sum';
PackageBundle getSummarySdkBundle() {
String name = 'strong.sum';
File file = _embedderYamlLibFolder.parent.getChildAssumingFile(name);
try {
if (file.exists) {
@ -584,7 +582,7 @@ class FolderBasedDartSdk extends AbstractDartSdk {
* This method should not be used outside of `analyzer` and `analyzer_cli`
* packages.
*/
PackageBundle getSummarySdkBundle(bool _) {
PackageBundle getSummarySdkBundle() {
String rootPath = directory.path;
String name = 'strong.sum';
String path =

View file

@ -510,8 +510,6 @@ class MockSdk implements DartSdk {
librariesContent);
if (generateSummaryFiles) {
List<int> bytes = _computeLinkedBundleBytes();
provider.newFileWithBytes(
provider.convertPath('/lib/_internal/spec.sum'), bytes);
provider.newFileWithBytes(
provider.convertPath('/lib/_internal/strong.sum'), bytes);
}
@ -572,7 +570,7 @@ class MockSdk implements DartSdk {
PackageBundle getLinkedBundle() {
if (_bundle == null) {
resource.File summaryFile =
provider.getFile(provider.convertPath('/lib/_internal/spec.sum'));
provider.getFile(provider.convertPath('/lib/_internal/strong.sum'));
List<int> bytes;
if (summaryFile.exists) {
bytes = summaryFile.readAsBytesSync();

View file

@ -404,7 +404,7 @@ class BuildMode extends Object with HasContextMixin {
createAnalysisOptionsForCommandLineOptions(options, rootPath);
dartSdk.useSummary = !options.buildSummaryOnly;
sdk = dartSdk;
sdkBundle = dartSdk.getSummarySdkBundle(true);
sdkBundle = dartSdk.getSummarySdkBundle();
}
// Include SDK bundle to avoid parsing SDK sources.

View file

@ -527,7 +527,7 @@ var b = new B();
Set<String> triedDirectories = new Set<String>();
bool isSuitable(String sdkDir) {
triedDirectories.add(sdkDir);
return new File(path.join(sdkDir, 'lib', '_internal', 'spec.sum'))
return new File(path.join(sdkDir, 'lib', '_internal', 'strong.sum'))
.existsSync();
}

View file

@ -287,8 +287,6 @@ const Map<String, LibraryInfo> libraries = const {
librariesContent);
if (generateSummaryFiles) {
List<int> bytes = _computeLinkedBundleBytes();
provider.newFileWithBytes(
provider.convertPath('/lib/_internal/spec.sum'), bytes);
provider.newFileWithBytes(
provider.convertPath('/lib/_internal/strong.sum'), bytes);
}
@ -356,7 +354,7 @@ const Map<String, LibraryInfo> libraries = const {
PackageBundle getLinkedBundle() {
if (_bundle == null) {
resource.File summaryFile =
provider.getFile(provider.convertPath('/lib/_internal/spec.sum'));
provider.getFile(provider.convertPath('/lib/_internal/strong.sum'));
List<int> bytes;
if (summaryFile.exists) {
bytes = summaryFile.readAsBytesSync();

View file

@ -309,7 +309,7 @@ class CodeGenerator extends Object
null,
sdk is SummaryBasedDartSdk
? sdk.bundle
: (sdk as FolderBasedDartSdk).getSummarySdkBundle(true));
: (sdk as FolderBasedDartSdk).getSummarySdkBundle());
}
var assembler = PackageBundleAssembler();

View file

@ -62,7 +62,6 @@ declare_args() {
# ......dart_server.platform
# ......dart_shared.platform
# ......_internal/
#.........spec.sum
#.........strong.sum
#.........dart2js_platform.dill
#.........dart2js_server_platform.dill
@ -483,11 +482,9 @@ copy("copy_analysis_summaries") {
visibility = [ ":create_common_sdk" ]
deps = [
":copy_libraries",
"../utils/dartanalyzer:generate_summary_spec",
"../utils/dartanalyzer:generate_summary_strong",
]
sources = [
"$root_gen_dir/spec.sum",
"$root_gen_dir/strong.sum",
]
outputs = [

View file

@ -8,7 +8,6 @@ import("../application_snapshot.gni")
group("dartanalyzer") {
deps = [
":generate_dartanalyzer_snapshot",
":generate_summary_spec",
":generate_summary_strong",
]
}
@ -54,31 +53,17 @@ sdk_lib_files = exec_script("../../tools/list_dart_files.py",
],
"list lines")
template("generate_summary") {
assert(defined(invoker.type), "Must specify the summary type")
type = invoker.type
assert(type == "spec" || type == "strong")
prebuilt_dart_action(target_name) {
script = "../../pkg/analyzer/tool/summary/build_sdk_summaries.dart"
packages = "../../.packages"
inputs = sdk_lib_files + analyzer_files
output = "$root_gen_dir/$type.sum"
outputs = [
output,
]
args = [
"build-$type",
rebase_path(output),
rebase_path("../../sdk"),
]
}
}
generate_summary("generate_summary_spec") {
type = "spec"
}
generate_summary("generate_summary_strong") {
type = "strong"
prebuilt_dart_action("generate_summary_strong") {
script = "../../pkg/analyzer/tool/summary/build_sdk_summaries.dart"
packages = "../../.packages"
inputs = sdk_lib_files + analyzer_files
output = "$root_gen_dir/strong.sum"
outputs = [
output,
]
args = [
"build-strong",
rebase_path(output),
rebase_path("../../sdk"),
]
}