Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934461 - savedconfig.eclass: restore_config() fails on cp -p warning, even when the operation was actually successful
Summary: savedconfig.eclass: restore_config() fails on cp -p warning, even when the op...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-17 13:34 UTC by Johannes Penßel
Modified: 2024-06-17 19:55 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Penßel 2024-06-17 13:34:44 UTC
When attempting to merge sys-kernel/gentoo-kernel-6.9.5[savedconfig], I get the following error:

>>> Configuring source in /var/tmp/portage/sys-kernel/gentoo-kernel-6.9.5/work/linux-6.9 ...
 * Checking existence of "/etc/portage/savedconfig/sys-kernel/gentoo-kernel-6.9.5" ...
 * Checking existence of "/etc/portage/savedconfig/sys-kernel/gentoo-kernel" ...
 * Found "/etc/portage/savedconfig/sys-kernel/gentoo-kernel"
 * Building using saved configfile "/etc/portage/savedconfig/sys-kernel/gentoo-kernel"
cp: preserving permissions for ‘.config’: Operation not supported
 * ERROR: sys-kernel/gentoo-kernel-6.9.5::gentoo failed (configure phase):
 *   Failed to restore /etc/portage/savedconfig/sys-kernel/gentoo-kernel to .config
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_configure
 *   environment, line 3149:  Called kernel-build_src_configure
 *   environment, line 1763:  Called restore_config '.config'
 *   environment, line 3001:  Called die
 * The specific snippet of code:
 *               cp -pPR "${found}" "$1" || die "Failed to restore ${found} to $1";

The problem is, that "cp: preserving permissions for ‘.config’: Operation not supported" is just a warning. The file still gets copied. Thus, bailing out here is not actually necessary.

With the <<|| die "Failed to restore ${found} to $1";>> snippet removed from the eclass, everything works fine.
Comment 1 Johannes Penßel 2024-06-17 13:35:34 UTC
Portage 3.0.65 (python 3.12.4-final-0, default/linux/amd64/23.0/no-multilib/systemd, gcc-14, glibc-2.39-r9, 6.9.5-gentoo x86_64)
=================================================================
System uname: Linux-6.9.5-gentoo-x86_64-12th_Gen_Intel-R-_Core-TM-_i5-1240P-with-glibc2.39
KiB Mem:    32709216 total,  15413288 free
KiB Swap:   25165816 total,  25165816 free
Timestamp of repository gentoo: Mon, 17 Jun 2024 10:19:13 +0000
Head commit of repository gentoo: fcfbaeb7df2ee99ee276a1ab3b9db51abe85e133

Timestamp of repository guru: Mon, 17 Jun 2024 09:48:59 +0000
Head commit of repository guru: bc7aab5adefafc16d0e7a5067ee7c35a82c4ca86

Timestamp of repository steam-overlay: Mon, 17 Jun 2024 09:48:55 +0000
Head commit of repository steam-overlay: 35b2e4df390d79636ff6480e802f556814085aa2

sh bash 5.2_p26-r4
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r4::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.29.3::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.1::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.4_p1::gentoo
dev-lang/rust:             1.78.0::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255.7::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           18.1.7::gentoo
sys-devel/gcc:             14.1.1_p20240615::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.7::gentoo
sys-devel/llvm:            18.1.7::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r9::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    priority: 10
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -Wall -g1 -fno-omit-frame-pointer -march=x86-64-v3 -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-O2 -pipe -Wall -g1 -fno-omit-frame-pointer -march=x86-64-v3 -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS=" --binpkg-respect-use=y --with-bdeps=y --rebuilt-binaries=y --buildpkg-exclude 'acct-*/* sys-kernel/*-sources virtual/* */*-bin sec-keys/*'"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
F77FLAGS="-O2 -pipe -Wall -g1 -fno-omit-frame-pointer -march=x86-64-v3 -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FCFLAGS="-O2 -pipe -Wall -g1 -fno-omit-frame-pointer -march=x86-64-v3 -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news nodoc noinfo parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -Wall -g1 -fno-omit-frame-pointer -march=x86-64-v3 -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/share/locale/a* /usr/share/locale/b* /usr/share/locale/c* /usr/share/locale/da* /usr/share/locale/dv* /usr/share/locale/dz* /usr/share/locale/ee* /usr/share/locale/el* /usr/share/locale/en_C* /usr/share/locale/en_A* /usr/share/locale/eo* /usr/share/locale/es* /usr/share/locale/et* /usr/share/locale/eu* /usr/share/locale/f* /usr/share/locale/g* /usr/share/locale/h* /usr/share/locale/i* /usr/share/locale/j* /usr/share/locale/k* /usr/share/locale/la /usr/share/locale/lg /usr/share/locale/li /usr/share/locale/ln /usr/share/locale/lo /usr/share/locale/lt* /usr/share/locale/lv* /usr/share/locale/m* /usr/share/locale/n* /usr/share/locale/o* /usr/share/locale/p* /usr/share/locale/q* /usr/share/locale/r* /usr/share/locale/s* /usr/share/locale/t* /usr/share/locale/u* /usr/share/locale/v* /usr/share/locale/w* /usr/share/locale/x* /usr/share/locale/y* /usr/share/locale/z* /usr/share/man/a* /usr/share/man/b* /usr/share/man/c* /usr/share/man/da* /usr/share/man/es* /usr/share/man/f* /usr/share/man/h* /usr/share/man/i* /usr/share/man/j* /usr/share/man/p* /usr/share/man/r* /usr/share/man/t*"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--build-id=sha1"
LEX="flex"
LINGUAS="en en_GB en_US de de_DE"
MAKEOPTS="-j16"
PKGDIR="/var/cache/binpkgs"
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"
RUSTFLAGS="-Ctarget-cpu=x86-64-v3 -Clink-arg=-Wl,-z,pack-relative-relocs -Clink-arg=-Wl,--build-id=sha1 -Copt-level=3 -Cdebuginfo=1 -Cforce-frame-pointers=yes -Ccodegen-units=1"
SHELL="/bin/zsh"
USE="X a52 aac acl acpi alsa amd64 apparmor audit bluetooth branding bzip2 cairo caps cdda cdr cet colord crypt cups dbus dri dts dvd dvdr eds encode evo exif flac flatpak gdbm gif gnome gnome-keyring gnome-online-accounts gnome-shell gpm gstreamer gtk gui iconv icu introspection io-uring ios ipv6 jpeg jpegxl keyring kf6compat lcms libnotify libtirpc lto mad mng mp3 mp4 mpeg nautilus ncurses networkmanager nls ogg opencl opengl openmp pam pango pcre pdf pgo pipewire png policykit ppds pulseaudio readline sdl seccomp secureboot sound spell ssl startup-notification stemmer svg sysprof systemd test-rust tiff tpm tracker truetype udev udisks uki ukify unicode unwind upower usb vaapi verify-sig vorbis vulkan wayland wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64 pc coreboot" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US en-GB de de-DE" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby33" VIDEO_CARDS="amdgpu intel radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, FC, GCOV, GPROF, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 Mike Gilbert gentoo-dev 2024-06-17 16:58:16 UTC
Why is cp failing to preserve permissions on your system?
Comment 3 Johannes Penßel 2024-06-17 19:55:09 UTC
(In reply to Mike Gilbert from comment #2)
> Why is cp failing to preserve permissions on your system?

My /etc/portage is located on an NFS4 share, but my portage build directory is on the local disk. This seems to mangle some file attributes when copying from one to the other. At least the coreutils manual suggests as much:

https://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html#cp-invocation

After spending way too much time this weekend trying to figure this out, I have no better explanation.