New issue
Advanced search Search tips

Issue 881783 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 30
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

[bisect-kit] repo's <linkfile> <copyfile> is not bisect friendly

Project Member Reported by kcwu@chromium.org, Sep 7

Issue description

Inside repo's manifest xml file, beside source code checkout, each project could perform additional actions like <linkfile> and <copyfile>. The extra files created by <linkfile> and <copyfile> will not be undone when repo sync with manifest without those tags. This may result in build break.

ChromeOS only uses <copyfile> for AUTHORS and LICENSE file and these files exist for all versions, no problem.

Android started to use <linkfile> to symlink build rules for some projects recently. For example, ag/4907502 added entries like

 <project path="vendor/xxx/oooo/proprietary/common" name="platform/vendor/xxx/oooo/proprietary/common" groups="vendor,xxx">
   <linkfile src="prop_pickup.mk" dest="vendor/xxx/oooo/Android.mk" />
   <linkfile src="prop_pickup.bp" dest="vendor/xxx/oooo/Android.bp" />
 </project>

In other words, repo sync to code after 4907502, a symlink Android.bp is created, pointing to prop_pickup.bp in the new folder. If then repo sync back to code before 4907502, Android.bp still exists but prop_pickup.bp disappeared.
This results in dangling symlink problem. "lunch" will fail when it is trying to parse build rules.

  FAILED: out/soong/.bootstrap/build.ninja 
  out/soong/.minibootstrap/minibp -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/.bootstrap/build.ninja.d -o out/soong/.bootstrap/build.ninja Android.bp
  internal error: could not open symlink vendor/xxx/oooo/Android.bp; its target (proprietary/common/prop_pickup.bp) cannot be opened
  internal error: could not open symlink hardware/xxx/oooo/Android.bp; its target (data/oooo/os_pickup.bp) cannot be opened
  15:33:15 soong minibootstrap failed with: exit status 1
  ninja: build stopped: subcommand failed.

Because we do repo sync back and forth during bisection, this problem blocks us bisecting Android P branch.
Fresh checkout the whole tree is too slow, we need lighter weight solution/workaround.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 4

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/bisect-kit/+/ea3abce087eb25af5bd94bc51f55abc6c657c1b1

commit ea3abce087eb25af5bd94bc51f55abc6c657c1b1
Author: Kuang-che Wu <kcwu@chromium.org>
Date: Thu Oct 04 12:41:15 2018

bisect-kit: delete repo generated files before sync

repo sync won't delete <copyfile> and <linkfile> generated file by
previous sync. This may leave stall files and make build broken.
See bug for detail analysis.

This CL works around this issue by deleting all generated files before
every repo sync.

BUG= chromium:881783 
TEST=bisect android P branch

Change-Id: Ia0b68c43389bc6e246743b498540d8b8c89876a5
Reviewed-on: https://chromium-review.googlesource.com/1261316
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>

[modify] https://crrev.com/ea3abce087eb25af5bd94bc51f55abc6c657c1b1/bisect_kit/repo_util.py

Status: Fixed (was: Untriaged)
close with the workaround.

Sign in to add a comment