@@ -682,10 +682,6 @@ ${e.message}
682
682
Uri workingDirectory,
683
683
bool includeParentEnvironment,
684
684
) async {
685
- final dartPathFile = File .fromUri (
686
- outputDirectory.resolve ('../hook.dill.dart_path.txt' ),
687
- );
688
-
689
685
final kernelFile = File .fromUri (
690
686
outputDirectory.resolve ('../hook.dill' ),
691
687
);
@@ -698,18 +694,9 @@ ${e.message}
698
694
final dependenciesHashes = DependenciesHashFile (file: dependenciesHashFile);
699
695
final lastModifiedCutoffTime = DateTime .now ();
700
696
var mustCompile = false ;
701
- if (! await dependenciesHashFile.exists () || ! await dartPathFile. exists () ) {
697
+ if (! await dependenciesHashFile.exists ()) {
702
698
mustCompile = true ;
703
699
} else {
704
- final previousDartExecutable =
705
- Uri .file (await dartPathFile.readAsString ());
706
- if (previousDartExecutable != dartExecutable) {
707
- mustCompile = true ;
708
- logger.info (
709
- 'Recompiling ${scriptUri .toFilePath ()}, Dart executable changed.' ,
710
- );
711
- }
712
-
713
700
final outdatedFile =
714
701
await dependenciesHashes.findOutdatedFileSystemEntity ();
715
702
if (outdatedFile != null ) {
@@ -744,12 +731,11 @@ ${e.message}
744
731
await dependenciesHashes.hashFilesAndDirectories (
745
732
[
746
733
...dartSources,
747
- // If the Dart executable is replaced in-place , recompile.
748
- dartExecutable,
734
+ // If the Dart version changed , recompile.
735
+ dartExecutable. resolve ( '../version' ) ,
749
736
],
750
737
validBeforeLastModified: lastModifiedCutoffTime,
751
738
);
752
- await dartPathFile.writeAsString (dartExecutable.toFilePath ());
753
739
if (modifiedDuringBuild != null ) {
754
740
logger.severe ('File modified during build. Build must be rerun.' );
755
741
}
0 commit comments