Don't write artifacts under staging
The staging dir (.../com.android.art/staging) is where odrefresh
creates artifacts before moving (well, copying) them to the final
target directory, typically .../com.android.art/dalvik-cache, or
compos-pending in our case).
But we were creating directories .../com.android.art/staging/staging
and .../com.android.art/staging/dalvik-cache instead.
So we need to pass the staging dir and the output dir separately, and
also specify the sub-directory name under the output directory where
the final artifacts should end up.
While I'm modifying the signature of odrefresh() I also made it return
just the odrefresh exit code.
Modified the implementation and callers to handle the new signature.
Also made a couple of small fixes.
Bug: 209572296
Bug: 210460516
Test: composd_cmd forced-odrefresh
Test: composd_cmd async-odrefresh
Test: (both with selinux in microdroid disabled)
Change-Id: I3dcdab7d9ae042e46f73d716f81f834de0f4c4f0
diff --git a/compos/composd/src/service.rs b/compos/composd/src/service.rs
index 3f31adb..6ce462c 100644
--- a/compos/composd/src/service.rs
+++ b/compos/composd/src/service.rs
@@ -108,7 +108,7 @@
) -> Result<Strong<dyn ICompilationTask>> {
let comp_os = self.instance_manager.start_test_instance().context("Starting CompOS")?;
- let target_dir_name = "test-instance".to_owned();
+ let target_dir_name = "test-artifacts".to_owned();
let task = OdrefreshTask::start(comp_os, target_dir_name, callback)?;
Ok(BnCompilationTask::new_binder(task, BinderFeatures::default()))