Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646412 - sys-devel/gdb: CCACHE_HARDLINK=1 - mv: '.deps/amd64-linux.Tpo' and '.deps/amd64-linux.Po' are the same file
Summary: sys-devel/gdb: CCACHE_HARDLINK=1 - mv: '.deps/amd64-linux.Tpo' and '.deps/amd...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-02 12:31 UTC by Xuefer
Modified: 2019-07-26 18:42 UTC (History)
1 user (show)

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


Attachments
build.log.xz (build.log.xz,87.20 KB, application/x-xz)
2018-02-04 18:11 UTC, Xuefer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xuefer 2018-02-02 12:31:47 UTC
i have no idea why it try to move '.deps/amd64-linux.Tpo' to '.deps/amd64-linux.Po' given it's already there and are of same file
CCACHE_HARDLINK=1 make ccache generate output by hard-linking the file to the one in the cache. these two file are the same but gdb Makefile rule try to override it by another

but i don't think overwriting the same file should raise error unless it's "realpath" is the same. i'm not sure if this should be fixed in gdb build rule or mv util, anyone know if this is the right behavior of mv?

i suppose:
if (inode(target) == inode(source)) {
  if (realpath(target) == realpth(source)) {
     throw "same file"
  }
  unlink(source); // this is what i expected in the above case
}

Reproducible: Always

Steps to Reproduce:
1. export CCACHE_HARDLINK=1
2. emerge sys-devel/gdb
Actual Results:  
mv: '.deps/amd64-linux.Tpo' and '.deps/amd64-linux.Po' are the same file
make[4]: *** [Makefile:546: amd64-linux.o] Error 1
make[4]: *** Waiting for unfinished jobs....

Expected Results:  
no build error

sys-devel/gdb-8.0.1
ccache version 3.2.4
Comment 1 Jonas Stein gentoo-dev 2018-02-04 17:22:15 UTC
Thank you for the report. Please recompile and *attach* the logfiles,
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
and reopen this ticket (Status:unconfirmed).
Comment 2 Xuefer 2018-02-04 17:36:03 UTC
Portage 2.3.19 (python 2.7.14-final-0, default/linux/amd64/17.1, gcc-6.4.0, glibc-2.25-r9, 4.14.15-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.15-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E3-1230_V2_@_3.30GHz-with-gentoo-2.4.1
KiB Mem:    10195960 total,     88536 free
KiB Swap:   15353832 total,  15352032 free
Timestamp of repository gentoo: Sun, 28 Jan 2018 02:45:01 +0000
Head commit of repository gentoo: aaad91ed7cc052c556eb2b097a89659dc67e0f62
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
ccache version 3.2.4 [enabled]
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo, 3.6.3-r1::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://mirrors.163.com/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:  --exclude-from=/etc/portage/rsync_excludes --progress

local
    location: /usr/local/portage/local
    masters: gentoo
    priority: 0

xuefer
    location: /usr/local/portage/xuefer
    masters: gentoo
    priority: 1

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

dwfreed
    location: /var/lib/layman/dwfreed
    sync-type: laymansync
    sync-uri: https://bitbucket.org/dwfreed/dwfreed.gentoo
    masters: gentoo
    priority: 50

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

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

java
    location: /var/lib/layman/java
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/java.git
    masters: gentoo
    priority: 50

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

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

lmiphay
    location: /var/lib/layman/lmiphay
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/user/lmiphay.git
    masters: gentoo
    priority: 50

mv
    location: /var/lib/layman/mv
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/user/mv.git
    masters: gentoo
    priority: 50

mva
    location: /var/lib/layman/mva
    sync-type: laymansync
    sync-uri: git://github.com/msva/mva-overlay
    masters: gentoo
    priority: 50

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

sunrise
    location: /var/lib/layman/sunrise
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/sunrise-reviewed.git
    masters: gentoo
    priority: 50

yutetsu
    location: /var/lib/layman/yutetsu
    sync-type: laymansync
    sync-uri: git://github.com/ytakatsukasa/portage.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-O2 -pipe -pipe -O2 -march=ivybridge -Wno-error=varargs -Wno-error=parentheses-equality -flto=thin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXX="clang++"
CXXFLAGS="-O2 -pipe -Wno-error=varargs -Wno-error=parentheses-equality -flto=thin"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch prelink-checksums preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" http://mirrors.163.com/gentoo/ #http://mirrors.sohu.com/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--enable-new-dtags -Wl,--sort-common -Wl,-O2 -Wl,--as-needed -flto=thin -fuse-ld=gold"
MAKEOPTS=" -j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS=" --exclude-from=/etc/portage/rsync_excludes --progress"
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="/usr/src/portage"
USE="# acc acl aiglx alsa amd64 apache ares avi bash-completion berkdb bitmap-fonts bittorrent bzip2 cgi cjk cli crypt cscope curl cxx dbus enscript expat extensions fam fastcgi fbcon fontconfig fpm gba gd gdbm glib gpm headless-awt i18n icedtea iconv idn imap ipv6 javascript jikes jpeg libssh2 maildir modules mp mp3 mpeg multilib multislot mysqli ncurses nds nethack nls nodejs nptl nptlonly nvidia ogg openmp pam patch pcre pdo perlsuid php png python quicktime readline real rrdcgi sdk seccomp sed server silvercity soap sockets spamassassin sqlite ssl subversion suid svg sync-plugin-portage tcpd termcap-compat threads tinfo toolbar transmitter truetype unicode urandom utf-8 utf8 vim-pager vim-syntax webdav-neon win32codecs withsamplescripts wma xattr xcomposite xml xml2 zlib" ABI_X86="64" ALSA_CARDS="ens1371" APACHE2_MODULES="actions alias auth_basic authn_core authn_file authz_core authz_host unixd socache_shmcb autoindex dav dir env expires headers info log_config mime setenvif status" APACHE2_MPMS="event" 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 mabm mcx16 mlzcnt msahf popcnt sse4.1 sse4.2" 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" GRUB_PLATFORMS="coreboot efi-64 pc multiboot" INPUT_DEVICES="keyboard mouse joystick" KERNEL="linux" L10N="en-US en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="serial" LLVM_TARGETS="X86 ARM AArch64" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="vmware fbdev vesa vga 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================

sys-devel/gdb-8.0.1::gentoo was built with the following:
USE="client nls python server xml -lzma -multitarget -test -vanilla" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_5 -python2_7 -python3_4 -python3_6" PYTHON_TARGETS="python2_7 python3_5 -python3_4 -python3_6"
Comment 3 Xuefer 2018-02-04 18:11:56 UTC
Created attachment 517810 [details]
build.log.xz
Comment 4 Joel Rosdahl 2019-07-20 12:05:26 UTC
FYI: ccache 3.7 and newer includes a workaround for this.

From https://ccache.dev/releasenotes.html#_ccache_3_7: "Worked around a problem with Automake related to .d files when using the hard link mode."
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-20 12:46:57 UTC
Can anyone confirm the problem is reproducible against ccache-3.7?
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 17:52:38 UTC
I did not succeed reproducing the bug locally on ccache-3.6 and gdb-8 (or gdb-8.3). I suspect I need full ccache config to do it.

Meanwhile filed coreutils bug as http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36818 as the behaviour is an least surprising.
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 18:42:41 UTC
(In reply to Sergei Trofimovich from comment #6)
> I did not succeed reproducing the bug locally on ccache-3.6 and gdb-8 (or
> gdb-8.3). I suspect I need full ccache config to do it.
> 
> Meanwhile filed coreutils bug as
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36818 as the behaviour is an
> least surprising.

Eric explained it's one of conformant (although surprising) behaviours of POSIX 'mv': https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36818#8. ccache/gdb would have to (and did) adapt to handle it.

Let's consider ccache-3.7 as a fix for this bug.