New issue
Advanced search Search tips

Issue 911229 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 780980



Sign in to add a comment

CIPD screws up in-place update of Xcode package

Project Member Reported by vadimsh@chromium.org, Dec 3

Issue description

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8928771526502315520/+/steps/gclient_runhooks__with_patch_/0/stdout

To reproduce locally:

mkdir /tmp/x
cd /tmp/x
cipd pkg-fetch infra_internal/ios/xcode/mac -version f3a2ba35264a8c8826d86b5c66c1a61517481ca7 -out old.zip
cipd pkg-fetch infra_internal/ios/xcode/mac -version 1aa30da92a60645974187fd9de89beb48061eef3 -out new.zip
cipd pkg-deploy old.zip -root r
cipd pkg-deploy new.zip -root r


 
Here's what is happening:

1. In old.zip, *.nib files are just files.
2. In new.zip, same *.nib are actually directories.
3. When doing an in-place update, CIPD client first installs all new files, then removes all old files:
  a. Installing new files: it installs .../MainMenu.nib/keyedobjects.nib, which replaces MainMenu.nib file to be a directory as a side effect.
  b. Removing old files: MainMenu.nib file no longer exists in the new package version, so CIPD tries to remove it, oblivious that it is now actually a directory. It succeeds in removing it.

There are two issues here:
1. EnsureFileGone should fail when used against a directory. This would have ensures that in-place update fails, rather than succeeds with broken tree.
2. The deployer should be smart enough to realize that files can transform into directories, and shouldn't be deleted.
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 4

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/8125d9a18703f0d5b804e487c4d9f384f1dca0e8

commit 8125d9a18703f0d5b804e487c4d9f384f1dca0e8
Author: Vadim Shtayura <vadimsh@chromium.org>
Date: Tue Dec 04 23:08:06 2018

[cipd] Make EnsureFileGone fail if it tries to delete a non-empty directory.

It mistakenly engaged "move to trash" logic, which was supposed to be used only
for locked files, not for directories.

R=iannucci@chromium.org, tandrii@chromium.org
BUG= 911229 

Change-Id: I92b7ed63f8699052cf9533c9d1b2ab3115810833
Reviewed-on: https://chromium-review.googlesource.com/c/1359672
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>

[modify] https://crrev.com/8125d9a18703f0d5b804e487c4d9f384f1dca0e8/cipd/client/cipd/fs/fs.go
[modify] https://crrev.com/8125d9a18703f0d5b804e487c4d9f384f1dca0e8/cipd/client/cipd/fs/fs_posix.go
[modify] https://crrev.com/8125d9a18703f0d5b804e487c4d9f384f1dca0e8/cipd/client/cipd/fs/fs_test.go
[modify] https://crrev.com/8125d9a18703f0d5b804e487c4d9f384f1dca0e8/cipd/client/cipd/fs/fs_windows.go

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 4

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/d052999e151be2c42b8e464270d7f2f483a260d5

commit d052999e151be2c42b8e464270d7f2f483a260d5
Author: Vadim Shtayura <vadimsh@chromium.org>
Date: Tue Dec 04 23:57:14 2018

[cipd] Handle in-place upgrade of files into directories.

Consider a package instance v1 that has only one file "a/b/c", and a package
instance v2 that has only one file "a/b/c/d". Before this CL, when upgrading
v1 to v2, CIPD would first create "a/b/c/d" as a new file (converting "a/b/c" to
a directory as a side effect), and then attempt to remove "a/b/c" (since it's
no longer in the package), and hit an error.

This situation is now recognized properly and CIPD doesn't try to remove such
directories.

R=iannucci@chromium.org, tandrii@chromium.org
BUG= 911229 

Change-Id: I86b73a2746c2af89cc6b39644d25b629697fa8a8
Reviewed-on: https://chromium-review.googlesource.com/c/1359722
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/d052999e151be2c42b8e464270d7f2f483a260d5/cipd/client/cipd/client.go
[modify] https://crrev.com/d052999e151be2c42b8e464270d7f2f483a260d5/cipd/client/cipd/deployer/deployer.go
[modify] https://crrev.com/d052999e151be2c42b8e464270d7f2f483a260d5/cipd/client/cipd/deployer/deployer_test.go

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 5

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/infradata/config/+/fe513f0066c093fb18601d0e3617f585502758b4

commit fe513f0066c093fb18601d0e3617f585502758b4
Author: Vadim Shtayura <vadimsh@chromium.org>
Date: Wed Dec 05 00:53:12 2018

Status: Fixed (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a9e0cd51f3d7bc6927d332966ab734d8045b2d2d

commit a9e0cd51f3d7bc6927d332966ab734d8045b2d2d
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Thu Dec 06 03:31:33 2018

Roll src/third_party/depot_tools 9875e180e5fd..2e00228777c0 (1 commits)

https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/9875e180e5fd..2e00228777c0


git log 9875e180e5fd..2e00228777c0 --date=short --no-merges --format='%ad %ae %s'
2018-12-06 vadimsh@chromium.org [cipd] Update CIPD client to v2.2.13.


Created with:
  gclient setdep -r src/third_party/depot_tools@2e00228777c0

The AutoRoll server is located here: https://autoroll.skia.org/r/depot-tools-chromium-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



BUG= chromium:911229 
TBR=agable@chromium.org

Change-Id: Ibce76fcee0243f3df875ac171c9b84663e2e4bf4
Reviewed-on: https://chromium-review.googlesource.com/c/1364018
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#614263}
[modify] https://crrev.com/a9e0cd51f3d7bc6927d332966ab734d8045b2d2d/DEPS

Sign in to add a comment