Compiling mesa, emerge does a 'mv -f "${x}" "${x/dri/mesa}"' during the install. Unfortunately I was building in a subdirectory like /mnt/drive-xx/var/.../dri/... and it tried to mv -f /mnt/drive-xx/var/... -> /mnt/mesave-xx/var/... Line <https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/mesa/mesa-18.0.0_rc2.ebuild#n431> Now I'm bind mounting /var instead of symlinking, so I can't repeat it (well, I guess I could set the portage tmpdir somewhere with a "dri" in the path)
Something like this should work: mv -f "${x}" "${x%/*/*}/mesa/${x##*/}"
Fixed in 18.1+ with the removal of eselect-mesa.
18.1.6 is being stablized in bug 664002 and has been stabilized on amd64. Going to mark as resolved.