New issue
Advanced search Search tips

Issue 910430 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Dec 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Can't build CrOS: failure to emerge llvm due to file collisions

Project Member Reported by michae...@chromium.org, Nov 30

Issue description

setup_board and build_packages fail to emerge sys-devel/llvm early on.

Steps I'm using:

$ repo sync
$ ./setup_board --board=kevin --force

Also tried:

$ sudo rm -rf /build/kevin

before continuing.

Also tried with nocturne.

Discussion thread:
https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-os-dev/file$20collisions%7Csort:date/chromium-os-dev/DiSUhpdyjlI/YMNPn5y3BAAJ

Output excerpt:

17:24:06: INFO: RunCommand: /mnt/host/source/chromite/bin/parallel_emerge --oneshot --update --getbinpkg --usepkgonly sys-devel/clang sys-devel/llvm

Local copy of remote index is up-to-date and will be used.

Local copy of remote index is up-to-date and will be used.

Local copy of remote index is up-to-date and will be used.

Local copy of remote index is up-to-date and will be used.

Local copy of remote index is up-to-date and will be used.

Local copy of remote index is up-to-date and will be used.
Starting fast-emerge.
 Building package sys-devel/clang sys-devel/llvm on root
Calculating deps...
Deps calculated in 0m3.7s
[binary  NS    ] sys-devel/llvm-8.0_pre339409_p20180926-r6 [8.0_pre339409_p20180926-r3] USE="default-compiler-rt default-libcxx libffi multitarget ncurses python -debug -doc -libedit -llvm-next -llvm-tot -ocaml {-test} -xml" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7" VIDEO_CARDS="radeon" 
Pending 0/1, Fetching 1/1, [Time 17:24:11 | Elapsed 0m4.6s | Load 1.65 0.94 0.67]
Fetched sys-devel/llvm-8.0_pre339409_p20180926-r6 in 0.76s
Started sys-devel/llvm-8.0_pre339409_p20180926-r6 (logged in /tmp/llvm-8.0_pre339409_p20180926-r6-4OqdgH)
=== Start output for job llvm-8.0_pre339409_p20180926-r6 (0m6.9s) ===
llvm-8.0_pre339409_p20180926-r6: >>> Running pre-merge checks for sys-devel/llvm-8.0_pre339409_p20180926-r6
llvm-8.0_pre339409_p20180926-r6:  * llvm-8.0_pre339409_p20180926-r6.tbz2 MD5 SHA1 size ;-) ...            [ ok ]
llvm-8.0_pre339409_p20180926-r6: >>> Emerging binary (1 of 1) sys-devel/llvm-8.0_pre339409_p20180926-r6::chromiumos
llvm-8.0_pre339409_p20180926-r6:  * llvm-8.0_pre339409_p20180926-r6.tbz2 MD5 SHA1 size ;-) ...            [ ok ]
llvm-8.0_pre339409_p20180926-r6:  * Running stacked hooks for pre_pkg_setup
llvm-8.0_pre339409_p20180926-r6:  *    sysroot_build_bin_dir ...
llvm-8.0_pre339409_p20180926-r6:  [ ok ]
llvm-8.0_pre339409_p20180926-r6:  * Running stacked hooks for post_pkg_setup
llvm-8.0_pre339409_p20180926-r6:  *    python_eclass_hack ...
llvm-8.0_pre339409_p20180926-r6:  [ ok ]
llvm-8.0_pre339409_p20180926-r6: pbzip2: *WARNING: Trailing garbage after EOF ignored!
llvm-8.0_pre339409_p20180926-r6: >>> Installing (1 of 1) sys-devel/llvm-8.0_pre339409_p20180926-r6::chromiumos
llvm-8.0_pre339409_p20180926-r6:  * This package will overwrite one or more files that may belong to other
llvm-8.0_pre339409_p20180926-r6:  * packages (see list below). You can use a command such as `portageq
llvm-8.0_pre339409_p20180926-r6:  * owners / <filename>` to identify the installed package that owns a
llvm-8.0_pre339409_p20180926-r6:  * file. If portageq reports that only one package owns a file then do
llvm-8.0_pre339409_p20180926-r6:  * NOT file a bug report. A bug report is only useful if it identifies at
llvm-8.0_pre339409_p20180926-r6:  * least two or more packages that are known to install the same file(s).
llvm-8.0_pre339409_p20180926-r6:  * If a collision occurs and you can not explain where the file came from
llvm-8.0_pre339409_p20180926-r6:  * then you should simply ignore the collision since there is not enough
llvm-8.0_pre339409_p20180926-r6:  * information to determine if a real problem exists. Please do NOT file
llvm-8.0_pre339409_p20180926-r6:  * a bug report at http://bugs.gentoo.org unless you report exactly which
llvm-8.0_pre339409_p20180926-r6:  * two packages install the same file(s). See
llvm-8.0_pre339409_p20180926-r6:  * http://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how to
llvm-8.0_pre339409_p20180926-r6:  * solve the problem. And once again, please do NOT file a bug report
llvm-8.0_pre339409_p20180926-r6:  * unless you have completely understood the above message.
llvm-8.0_pre339409_p20180926-r6:  * 
llvm-8.0_pre339409_p20180926-r6:  * Detected file collision(s):
llvm-8.0_pre339409_p20180926-r6:  * 
llvm-8.0_pre339409_p20180926-r6:  * 	/usr/include/clang/ARCMigrate/ARCMTActions.h
llvm-8.0_pre339409_p20180926-r6:  * 	/usr/include/clang/ARCMigrate/ARCMT.h
llvm-8.0_pre339409_p20180926-r6:  * 	/usr/include/clang/ARCMigrate/FileRemapper.h
llvm-8.0_pre339409_p20180926-r6:  * 	/usr/include/clang/Lex/Preprocessor.h
llvm-8.0_pre339409_p20180926-r6:  * 	/usr/include/clang/Lex/Lexer.h
....
 
setup_board.txt
767 KB View Download
Cc: vapier@chromium.org manojgupta@chromium.org
This is related to
https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1351315, that uprevs llvm -r6 to -r7 and moves the slot from 0 to 8.

So, if you have an old chroot with sys-devel/llvm-8.0_pre339409_p20180926-r3 installed (slot 0/8.0), then the profile update hook will update it to slot 8/8.0:

# equery l llvm clang
 * Searching for llvm ...
[I--] [??] sys-devel/llvm-8.0_pre339409_p20180926-r3:8/8.0

Then, ./update_chroot will update the SDK, and still try to install binary package for sys-devel/llvm-8.0_pre339409_p20180926-r6, which still has slot 0/8.0, so it'll try to install both -r3 and -r6.

This is not a problem if you have a more recent chroot that already has -r6:0/8.0 (=> -r6:8/8.0), as ./update_chroot won't try to install the same version in 2 different slots.

How do we tell ./update_chroot to install sys-devel/llvm-8.0_pre339409_p20180926-r7 instead of sys-devel/llvm-8.0_pre339409_p20180926-r6?
A chroot hook that does the following might work:

1: Check if the llvm version installed is < sys-devel/llvm-8.0_pre339409_p20180926-r6 
2. Force uninstall the old clang and llvm.
3. Force install llvm and clang .
I tried to manually rename -r7 to -r3:
mv llvm-8.0_pre339409_p20180926-r7.ebuild llvm-8.0_pre339409_p20180926-r3.ebuild
sudo emerge llvm

So that I would get a -r3 with slot 8, but then ./update_chroot does the right thing and gets the -r7 binary package:

# ./update_chroot 
INFO    : Updating chroot
INFO    : Clearing shadow utils lockfiles under /
INFO    : Updating cross-compilers
10:33:35: INFO: Determining required toolchain updates...
10:33:35: INFO: Nothing to update!
INFO    : Bootstrapping depot_tools
INFO    : Updating the SDK
Starting fast-emerge.
 Building package virtual/target-sdk world on root
Calculating deps...
Deps calculated in 0m16.5s
[binary     U  ] sys-devel/llvm-8.0_pre339409_p20180926-r7:8::chromiumos [8.0_pre339409_p20180926-r3:8::chromiumos] USE="default-compiler-rt default-libcxx libffi multitarget ncurses python -debug -doc -libedit -llvm-next -llvm-tot -ocaml {-test} -xml" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7" VIDEO_CARDS="radeon" 0 KiB
#3: Nevermind, those steps can definitely reproduce the issue.

The issue here is that update_chroot uses --usepkgonly, so it'll only use the latest prebuilt binkpg (-r6).

The issue will fix itself as soon as we get a prebuilt binpkg for -r7.

#2: Yes, a hook seems to one way, as update_chroot won't try to downgrade to -r6. One slight issue is that we don't have a prebuilt to -r7, so the hook would force a build from source (until we get the prebuilt, which would fix the issue...).
If a new binpkg will resolve it, lets just wait for current SDK builder run to finish (https://cros-goldeneye.corp.google.com/chromeos/healthmonitoring/buildDetails?buildbucketId=8928465942339034816). 
Builder completed, prebuilt updated, so I think this is fixed.

kerrnel/michaelpg: can you confirm the problem is gone after another repo sync / setup_board?
Yes, looks good. This time ./setup_board --force fetched the prebuilts and merged "sys-devel/llvm-8.0_pre339409_p20180926-r6". The rest of the step completed successfully.

Is this something that's likely to happen again?
Status: Verified (was: Untriaged)
No, that should be a one-off (LLVM 8 to 9 transition may end up having similar issues in the future, filed crbug.com/910805 for the toolchain team to track).
And thanks for the confirmation ,-)
Cc: js...@chromium.org
I still have this problem. I deleted cros_sdk and started with a fresh copy of cros_sdk, but setup_board with or without --force resulted in this issue (clang cannot be updated and update_chroot fails). 

$ equery l llvm clang
 * Searching for llvm ...
[I--] [??] sys-devel/llvm-7.0_pre328903_p20180425-r4:0/7.0

 * Searching for clang ...
[I--] [??] sys-devel/clang-7.0_pre328903_p20180425:0

-----------

The clang version is older than what's mentioned in this bug. I did run 'repo sync' and it succeeded after a few tries (platform/mtplot gave me hard time). 

I also tried manually updating clang with "sudo emerge -av llvm clang", but it also  failed with a file collision errors. 

Is there anything I can do to move forward with setup_board?  I need that to verify my CL ( https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1387603 ). 

Thanks 

Can you try uninstalling the existing llvm/clang packages and run update_chroot again.

$ sudo emerge -C llvm clang
$ ./update_chroot
Thanks a lot. Yeah, that works (how could I have not thought of that? ) 

Sign in to add a comment