Skip to content

[FastDeploy2] Copy staged files into private storage - #12417

Closed
simonrozsival wants to merge 1 commit into
mainfrom
dev/simonrozsival/fastdeploy2-private-copy
Closed

[FastDeploy2] Copy staged files into private storage#12417
simonrozsival wants to merge 1 commit into
mainfrom
dev/simonrozsival/fastdeploy2-private-copy

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

Alternative to #12310:

  • push changed FastDeploy2 files to transient /data/local/tmp/fastdeploy2/<package>/<user> staging
  • copy them into the app-private override directory with run-as cp -p
  • remove staging after every deployment attempt, including failures
  • store regular private files instead of persistent symlinks, so uninstall removes the deployed files with the application's data
  • remove the symlink/copy mode and orphan-staging cleanup machinery
  • invalidate the previous configuration-cache shape so existing symlink-based installations are recreated safely

Existing destination files are removed before copying so cp cannot follow symlinks left by an older FastDeploy2 deployment.

Performance

Head-to-head measurements on emulator-5554 (arm64-v8a), alternating implementation order:

ScenarioRunsPrevious symlinkPrivate copyDifference
Assembly-only incremental install12 each3.821 s4.074 s+0.253 s (+6.6%)
Forced full FastDeploy redeploy6 each7.098 s7.390 s+0.292 s (+4.1%)

The corresponding median FastDeploy2 task times increased by 220 ms for an assembly-only update and 356 ms for a full redeploy. This is the cost of the additional private copy and staging cleanup commands.

Validation

  • dotnet build src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Build.Debugging.Tasks.csproj
  • dotnet test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter 'Name~FastDeploy2' — 2 passed
  • FastDeploy2RemovesRemoteStagingDirectory device test — passed
  • FastDeploymentStrategyCanBeChanged device test — passed
  • verified deployed override assemblies are regular files and transient staging is absent after initial and incremental installs
  • git diff --check

Use transient adb-writable staging, copy changed files into the app-private override directory with run-as, and remove staging after every deployment attempt. This replaces persistent symlinks and avoids needing orphan staging cleanup.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6229e450-fd9b-4a58-b016-d8218995998c
CopilotAI lite review requested due to automatic review settings August 18, 2026 10:41

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes the FastDeploy2 implementation to stage updated files under /data/local/tmp/fastdeploy2/<package>/<user> and then copy them into the app-private override directory using run-as cp -p, removing the previous symlink/copy mode split. It also ensures staging is removed after every deployment attempt and invalidates the prior configuration-cache shape so existing symlink-based installs are safely recreated as regular private files.

Changes:

  • Switch FastDeploy2 from symlink-based override updates to copying regular files into app-private storage and always cleaning up transient staging.
  • Remove the _AndroidFastDeployAppFileTransferMode property surface area (targets, task parameter, tests, and docs) and update the configuration-cache key accordingly.
  • Update device/integration tests and documentation to reflect the new “regular file” override behavior and transient staging lifecycle.
Show a summary per file
FileDescription
tests/MSBuildDeviceIntegration/Tests/FastDevTest.csUpdate device integration assertions from symlink to regular files; validate transient staging directory is removed after installs.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.csAdjust FastDeploy2 warm-state probe parsing tests to match removed remote-staging hash tagging.
src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Common.Debugging.targetsRemove transfer-mode property/validation, update configuration-cache shape, and pass ResetOverrideDirectory into FastDeploy2.
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/FastDeploy2.WarmState.csRemove remote-staging marker checks from the warm-state probe and associated parsed state.
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/FastDeploy2.Manifest.csRework deployment flow to always reset transient staging, copy into private override storage, and remove staging in a finally cleanup.
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/FastDeploy2.csRemove transfer-mode plumbing and simplify override update logic to “delete then cp -p” for changed files plus manifest marker handling.
Documentation/release-notes/11795.mdUpdate release notes to reflect removal of the transfer-mode property and the new copy-to-private approach.
Documentation/guides/FastDeploy2.mdUpdate guide for transient staging + private copy flow and revise marker/configuration behavior and command compatibility notes.

Review details

  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Lite

@simonrozsival
simonrozsival marked this pull request as draft August 18, 2026 15:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@simonrozsival