Skip to content

assemble_cvd: Skip rebuilding OS composite disk on snapshot restore - #3143

Open
Elie-Kh wants to merge 1 commit into
google:mainfrom
Elie-Kh:skip_rebuilding_os_disk_on_restore
Open

assemble_cvd: Skip rebuilding OS composite disk on snapshot restore#3143
Elie-Kh wants to merge 1 commit into
google:mainfrom
Elie-Kh:skip_rebuilding_os_disk_on_restore

Conversation

@Elie-Kh

@Elie-Kh Elie-Kh commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

When restoring from a snapshot, the base images and instance disks have already been restored from the snapshot directory by RestoreHostFiles(). Checking filesystem timestamps to determine whether to rebuild composite disks during snapshot restore can lead to creating_os_disk becoming true, which causes assemble_cvd to abort with 'Restoring from snapshot requires not creating OS disks'.

Only evaluate WillRebuildCompositeDisk() and set creating_os_disk when snapshot_path is empty.

Bug: 554545294

@Elie-Kh
Elie-Kh force-pushed the skip_rebuilding_os_disk_on_restore branch from 7d8cdd9 to c148b7d Compare September 4, 2026 16:21
@Databean Databean added the kokoro:run Run e2e tests. label Sep 5, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Sep 5, 2026
@Databean
Databean force-pushed the skip_rebuilding_os_disk_on_restore branch from c148b7d to c8c59a5 Compare September 8, 2026 20:52
@Databean Databean added the kokoro:run Run e2e tests. label Sep 8, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Sep 8, 2026
@Databean

Databean commented Sep 8, 2026

Copy link
Copy Markdown
Member

There are build failures reported on this change:

ERROR: /mnt/build/base/cvd/cuttlefish/host/commands/assemble_cvd/BUILD.bazel:24:13: Compiling cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target //cuttlefish/host/commands/assemble_cvd:assemble_cvd) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 304 arguments skipped)
  cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc:444:11: error: non-object type 'char *(const char *, int) noexcept(true)' is not assignable
    444 |     index = 0;
        |     ~~~~~ ^
  cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc:447:44: error: no matching member function for call to 'ForIndex'
    447 |       AndroidBuild& build = android_builds.ForIndex(index);
        |                             ~~~~~~~~~~~~~~~^~~~~~~~
  ./cuttlefish/host/commands/assemble_cvd/android_build/android_builds.h:35:17: note: candidate function not viable: no known conversion from 'char *(const char *, int) noexcept(true)' to 'size_t' (aka 'unsigned long') for 1st argument
     35 |   AndroidBuild& ForIndex(size_t index);
        |                 ^        ~~~~~~~~~~~~
  ./cuttlefish/host/commands/assemble_cvd/android_build/android_builds.h:36:23: note: candidate function not viable: no known conversion from 'char *(const char *, int) noexcept(true)' to 'size_t' (aka 'unsigned long') for 1st argument
     36 |   const AndroidBuild& ForIndex(size_t index) const;
        |                       ^        ~~~~~~~~~~~~
  cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc:449:12: error: cannot increment value of type 'char *(const char *, int) noexcept(true)'
    449 |       index++;
        |       ~~~~~^

I was able to reproduce it locally by fetching the change. You can run bazel test //... in the base/cvd directory to build everything and run the unit tests and linters.

@Elie-Kh
Elie-Kh force-pushed the skip_rebuilding_os_disk_on_restore branch from c8c59a5 to ea53591 Compare September 8, 2026 21:09
@Databean Databean added the kokoro:run Run e2e tests. label Sep 8, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Sep 8, 2026

@Databean Databean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Failing on a clang-format validation test

INFO: Build completed, 1 test FAILED, 45435 total actions
  //cuttlefish/host/commands/assemble_cvd:assemble_cvd_format_test_C++_with_clang-format FAILED in 0.2s

@Elie-Kh
Elie-Kh force-pushed the skip_rebuilding_os_disk_on_restore branch from ea53591 to 1ae73b3 Compare September 8, 2026 22:35

@Elie-Kh Elie-Kh left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done, PTAL

When restoring from a snapshot, the base images and instance disks
have already been restored from the snapshot directory by
RestoreHostFiles(). Checking filesystem timestamps to determine whether
to rebuild composite disks during snapshot restore can lead to
creating_os_disk becoming true, which causes assemble_cvd to abort
with 'Restoring from snapshot requires not creating OS disks'.

Only evaluate WillRebuildCompositeDisk() and set creating_os_disk when
snapshot_path is empty.

Bug: 554545294
@Elie-Kh
Elie-Kh force-pushed the skip_rebuilding_os_disk_on_restore branch from 1ae73b3 to 8018643 Compare September 9, 2026 00:34
Sign up for free to 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.

3 participants