Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 626424 - sys-devel/clang-4.0.1: mv: target '/var/tmp/portage/sys-devel/clang-4.0.1/work/llvm' is not a directory
Summary: sys-devel/clang-4.0.1: mv: target '/var/tmp/portage/sys-devel/clang-4.0.1/wor...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2017-07-28 10:32 UTC by unhappy-ending
Modified: 2017-07-30 05:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixed sys-devel/clang-4.0.1.ebuild (clang-4.0.1.ebuild,9.03 KB, text/plain)
2017-07-28 10:32 UTC, unhappy-ending
Details
Updated sys-devel/clang-4.0.1.ebuild (clang-4.0.1.ebuild,9.01 KB, text/plain)
2017-07-28 10:42 UTC, unhappy-ending
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unhappy-ending 2017-07-28 10:32:49 UTC
Created attachment 487050 [details]
Fixed sys-devel/clang-4.0.1.ebuild

Please find attached an updated clang-4.0.1 ebuild to fix 3 issues.

Issue 1.

When USE=test is set, clang will fail the unpack phase.

>>> Unpacking llvm-4.0.1.src.tar.xz to /var/tmp/portage/sys-devel/clang-4.0.1/work/x/y                                                                                                
mv: target '/var/tmp/portage/sys-devel/clang-4.0.1/work/llvm' is not a directory  

For some reason it seems the llvm directory is not being created during mv. Adding "mkdir -p llvm || die" to section "src_unpack() {" seems to fix it.

Issue 2. 

Corrected line: 

multilib_is_native_abi && cmake-utils_src_make check-clang-tools 

to 

multilib_is_native_abi && cmake-utils_src_make check-clang-tooling

Otherwise clang will fail the test phase.

Issue 3.

If USE=-doc then clang will fail install phase since it can't stat a doc file that doesn't exist.

"/usr/bin/install: cannot stat '/var/tmp/portage/sys-devel/clang-4.0.1/work/x/y/llvm-manpages-4.0.1/clang/*.1': No such file or directory
!!! doins: /var/tmp/portage/sys-devel/clang-4.0.1/work/x/y/llvm-manpages-4.0.1/clang/*.1 does not exist"


Changed:

if ! use doc; then

to

if use doc; then

~~~~

Ebuild compiles, passes tests, and installs when compiled with gcc. Please feel free to adjust the ebuild as needed. Thank you.
Comment 1 unhappy-ending 2017-07-28 10:42:04 UTC
Created attachment 487052 [details]
Updated sys-devel/clang-4.0.1.ebuild

Sorry, accidentally left a # on one of the lines so I could grab the error code from one of the failed logs. Fixed now.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-28 22:03:24 UTC
There's something seriously wrong with your system that causes the unpack phase not to work correctly. Do you use PORTAGE_TMPDIR on NFS or some weird filesystem? Did you run/resume the build via 'ebuild ...'? What is your package manager? Please include your full 'emerge --info' or equivalent.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-28 22:27:33 UTC
Now I recall this. It's a kernel bug causing that 'is a directory' error. Please upgrade your kernel.
Comment 4 unhappy-ending 2017-07-28 23:47:21 UTC
Portage 2.3.6 (python 3.5.3-final-0, default/linux/amd64/13.0, gcc-6.3.0, glibc-2.24-r3, 4.12.3-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.12.3-gentoo-x86_64-AMD_FX-tm-9590_Eight-Core_Processor-with-gentoo-2.4.1
KiB Mem:    16420296 total,  13894972 free
KiB Swap:          0 total,         0 free
sh bash 4.4_p12
ld GNU ld (Gentoo 2.28 p1.2) 2.28
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.2::gentoo
dev-lang/python:          2.7.13::gentoo, 3.5.3::gentoo
dev-util/cmake:           3.9.0::gentoo
sys-apps/baselayout:      2.4.1::gentoo
sys-apps/openrc:          0.28::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r3::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.15.1::gentoo
sys-devel/binutils:       2.28-r2::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo, 6.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.24-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

libressl
    location: /var/lib/layman/libressl
    sync-type: laymansync
    sync-uri: https://github.com/gentoo/libressl.git
    masters: gentoo
    priority: 50

local
    location: /etc/portage/local
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs=8 --load-average=8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 acl acpi aes alsa amd64 avx berkdb bluetooth bluray boost bzip2 cacert cairo caps cdda cddb cdparanoia cdr cdrom cgroups cjk clang cli consolekit cracklib crypt css cups curl custom-cflags cxx dbus dri drm dts dvb dvd dvdr dvdread encode exif f16c ffmpeg fftw filecaps flac fma3 fma4 fontconfig fortran gif git glamor gme gmp gpg iconv icu introspection jit jpeg jpeg2k lcms ldap libass libedit libinput libnotify libressl libsamplerate lm_sensors lzma lzo matroska midi mmx mmxext modules mp3 mpeg mpg123 mtp multilib ncurses nls nptl numa ogg openal opencl openexr opengl openldap openmp openssh pam pcre pdf perl pmutils png policykit popcnt python qml qt5 rar ruby sdl seccomp smp sndfile sqlite sse sse2 sse3 sse4_1 sse4_2 sse4a ssh ssse3 suid svg taglib tar tcpd theora threads tiff tools truetype udev udisks unicode upower usb utils uuid v4l vaapi vorbis vpx win32codecs x264 x265 xattr xcb xcomposite xinerama xml xop xrandr xvfb zip zlib" ABI_X86="64" ALSA_CARDS="ice1712" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" CURL_SSL="libressl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="NVPTX BPF" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 5 unhappy-ending 2017-07-28 23:52:18 UTC
Package manager is portage. Most recent kernel so there is nothing to update to. I have portage using tmpfs which clears on every reboot and I've done this on a fresh reboot with no left over distfiles or cache. No emerge -r or anything like that, just a straight clean emerge of clang.

I've compiled a little over 900 other packages when I emerge -e world and this is the only one to have an issue unpacking.

On top of that, this can't be resolved because clang is still going to complain during test phase about check-clang-tools when it needs to be check-clang-tooling. At the very least, that needs to be updated. The double negative doc check also needs addressed.

I've tried building clang using the gentoo ebuild on a laptop that was a fresh install off sysrescuecd and built entirely with gcc up to that point with a default set of CFLAGS with nothing crazy going on, and the same issue happened on that computer as well.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-29 08:18:22 UTC
Include the original build log too.

However, I still believe it's a kernel bug that has been brought to my attention already. Your info says 4.12.3, I see 4.12.4 in gentoo-sources. Alternatively, you can downgrade.
Comment 7 unhappy-ending 2017-07-29 10:09:16 UTC
 * Package:    sys-devel/clang-4.0.1
 * Repository: gentoo
 * Maintainer: llvm@gentoo.org
 * USE:        abi_x86_64 amd64 default-compiler-rt default-libcxx elibc_glibc kernel_linux llvm_targets_BPF llvm_targets_NVPTX llvm_targets_X86 python_targets_python2_7 test userland_GNU xml
 * FEATURES:   preserve-libs sandbox test userpriv usersandbox
>>> Unpacking source...
>>> Unpacking cfe-4.0.1.src.tar.xz to /var/tmp/portage/sys-devel/clang-4.0.1/work/x/y
>>> Unpacking clang-tools-extra-4.0.1.src.tar.xz to /var/tmp/portage/sys-devel/clang-4.0.1/work/x/y
>>> Unpacking llvm-manpages-4.0.1.tar.bz2 to /var/tmp/portage/sys-devel/clang-4.0.1/work/x/y
>>> Unpacking llvm-4.0.1.src.tar.xz to /var/tmp/portage/sys-devel/clang-4.0.1/work/x/y
mv: target '/var/tmp/portage/sys-devel/clang-4.0.1/work/llvm' is not a directory
 * ERROR: sys-devel/clang-4.0.1::gentoo failed (unpack phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 115:  Called src_unpack
 *   environment, line 4725:  Called die
 * The specific snippet of code:
 *           mv llvm-* "${WORKDIR}"/llvm || die;
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/clang-4.0.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/clang-4.0.1::gentoo'`.
 * The complete build log is located at '/etc/portage/log/build/sys-devel/clang-4.0.1:20170728-225204.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-devel/clang-4.0.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/clang-4.0.1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/clang-4.0.1/work/x/y'
 * S: '/var/tmp/portage/sys-devel/clang-4.0.1/work/x/y/cfe-4.0.1.src'
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-29 11:03:15 UTC
Does /var/tmp/portage/sys-devel/clang-4.0.1/work/llvm exist?
Comment 9 unhappy-ending 2017-07-29 23:24:34 UTC
No, which is why I had to edit the ebuild to make the directory.
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-30 05:40:56 UTC
Ok, I found the culprit. It's accidentally globbing a second directory.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-30 05:50:43 UTC
commit 5b9b2f7b7a7ddd267b5021d1099a33332bbda438
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: Sun Jul 30 07:45:10 2017
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: Sun Jul 30 07:46:35 2017

    sys-devel/clang: Fix mv accidentally catching manpages, #626424