From c4d1c3a3e831e252fdd4b9317a8d16f3a727113d Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 26 May 2026 10:13:34 -0700 Subject: [PATCH] DAS plugins: Fix entrypoint deletion bug I recently introduced this deletion logic but was deleting the wrong file; this was deleting the `plugin.dart` file that `plugin.aot` is compiled from. Over the weekend I found this issue with manual testing. I've also verified this fix with manual testing. Change-Id: I3f570368068117e6bb952ada0707a09ee97b765c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506320 Auto-Submit: Samuel Rawlins Reviewed-by: Brian Wilkerson Commit-Queue: Brian Wilkerson --- pkg/analysis_server/lib/src/plugin/plugin_manager.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart index 113303e5c2b..baf545a2133 100644 --- a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart +++ b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart @@ -540,16 +540,17 @@ class PluginManager { var stopwatch = Stopwatch()..start(); var depfile = entrypoint.parent.getChildAssumingFile('depfile.txt'); - if (entrypoint.exists) { + var aotSnapshotFile = entrypoint.parent.getChildAssumingFile('plugin.aot'); + if (aotSnapshotFile.exists) { try { // Delete any existing AOT snapshot. On MacOS, sometimes this file // becomes quarantined due to a race condition with codesigning and // overwriting the file. - entrypoint.delete(); + aotSnapshotFile.delete(); } catch (e) { instrumentationService.logInfo( - 'Could not delete existing AOT plugin entrypoint at "$entrypoint": ' - '$e.', + 'Could not delete existing AOT plugin entrypoint at ' + '"$aotSnapshotFile": $e.', ); } }