New issue
Advanced search Search tips

Issue 789750 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

“cipd ensure” doesn’t prune empty directories when removing packages, leaving all sorts of litter behind

Project Member Reported by mark@chromium.org, Nov 29 2017

Issue description

When “cipd ensure” removes a package, it leaves the entire directory structure behind.

mark@mela zsh% cipd -version
Package name: infra/tools/cipd/mac-amd64
Instance ID:  d03de55ea4a0716c9b4bed4dd6a252d29b4631c8
mark@mela zsh% cat cipd.ensure 
@Subdir ${os}-${arch}
fuchsia/clang/${os}-${arch} latest
mark@mela zsh% cipd ensure -ensure-file cipd.ensure -root . -log-level error
mark@mela zsh% find mac-amd64 -type l | wc -l
     802
mark@mela zsh% find mac-amd64 -type d | wc -l
      64
mark@mela zsh% cat /dev/null > cipd.ensure
mark@mela zsh% cipd ensure -ensure-file cipd.ensure -root . -log-level error
mark@mela zsh% find mac-amd64 -type f | wc -l
       0
mark@mela zsh% find mac-amd64 -type d | wc -l
      64

Note that all of the symbolic links are gone, but the entire directory structure is still there.

In bug 789364 comment 2, Vadim said:

> "ensure" is named this way since it ensures the local state matches whatever is in
> .ensure file. If it starts leaving stuff behind, it is no longer "ensure", but
> something else...

which leads me to believe that the directory detritus is unintentional.
 
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/9b5cb92fa457c8f61a058c6584c3bec233088c3b

commit 9b5cb92fa457c8f61a058c6584c3bec233088c3b
Author: Vadim Shtayura <vadimsh@chromium.org>
Date: Wed Dec 20 19:41:02 2017

Update cipd client version.

Notable changes here:
 * 'cipd' binary is now statically linked and doesn't depend of libc.so.
 * New 'cipd instances <pkg>' subcommand that list recently uploaded instances
   of a package.
 * cipd now properly removes empty directory trees if they are left after
   uninstalling some files.

R=iannucci@chromium.org
BUG= 796320 ,  789750 

Change-Id: Iebc5655640defbbef4a5fb1850aeb852746e5ef3
Reviewed-on: https://chromium-review.googlesource.com/835657
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>

[modify] https://crrev.com/9b5cb92fa457c8f61a058c6584c3bec233088c3b/cipd_client_version

Owner: vadimsh@chromium.org
Status: Assigned (was: Untriaged)
Vadim, can this be closed now?
Status: Fixed (was: Assigned)
Yes

Sign in to add a comment