Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: pkg/compiler/lib/src/library_loader.dart

Issue 2991683002: Fix bots: partial support for --use-sdk (assumes (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 0c2adf2378fe03e8f3c1347ebcb71e3aae54f1a1..382e938ddfd7ee09f7f46450afb171706d540583 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -854,16 +854,19 @@ class KernelLibraryLoaderTask extends CompilerTask
program = new ir.Program();
new BinaryBuilder(input.data).readProgram(program);
} else {
+ // TODO(sigmund): remove this hack. Ship platform.dill with the SDK
+ // instead.
+ // Note: this logic only works on development and bot configurations,
+ // but will not work when using dart2js outside the repo.
+ var executableUri = new Uri.file(Platform.resolvedExecutable);
+ Uri platformFile = executableUri.path.endsWith('dart-sdk/bin/dart')
+ ? executableUri.resolve('../../patched_dart2js_sdk/platform.dill')
+ : executableUri.resolve('patched_dart2js_sdk/platform.dill');
var options = new fe.CompilerOptions()
..fileSystem = new CompilerFileSystem(compilerInput)
..target = new Dart2jsTarget(new TargetFlags())
..compileSdk = true
- ..linkedDependencies = [
- // TODO(sigmund): infer the location of platform.dill
- // once it is shipped as part of the sdk.
- new Uri.file(Platform.resolvedExecutable)
- .resolve('patched_dart2js_sdk/platform.dill')
- ]
+ ..linkedDependencies = [platformFile]
..onError = (e) => reportFrontEndMessage(reporter, e);
program = await fe.kernelForProgram(resolvedUri, options);
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698