Gentoo Archives: gentoo-musl

From: Stuart Longland <stuartl@×××××××××××××××.au>
To: gentoo-musl@l.g.o
Subject: [gentoo-musl] cp -a having problems with broken links… anyone seen this?
Date: Sun, 27 May 2018 11:29:22
Message-Id: 9dc99582-78e5-f3ba-a495-13ea81cf7018@longlandclan.id.au
1 Hi all,
2
3 Having an interesting problem with musl on armv5 at the moment. Yes,
4 I'm still trying to bootstrap it. I ran across an issue trying to merge
5 dev-python/setuputils. Basically it would get to near the end of the
6 build, then bail out with `cp` complaining that preserving ownership was
7 "not supported".
8
9 Everything I looked at, regarding that error pointed to the filesystem,
10 and in particular, FATs inability to support Unix permissions. However
11 I'm using btrfs, so it's not that.
12
13 I finally tried running the ebuild with `ebuild --debug ${EBUILD}
14 install`, and captured this:
15
16 > + local cp_args
17 > + cp -a --version
18 > + cp_args+=(-a)
19 > + cp --reflink=auto --version
20 > + cp_args+=(--reflink=auto)
21 > + cp -a --reflink=auto /var/tmp/portage/dev-python/setuptools-36.7.2/image/_python2.7/. /var/tmp/portage/dev-python/setuptools-36.7.2/image//
22 > cp: failed to preserve ownership for /var/tmp/portage/dev-python/setuptools-36.7.2/image/./usr/bin/easy_install: Not supported
23 > + ret=1
24 > + [[ 1 -ne 0 ]]
25 > + die 'python2_7: merging image failed.'
26 > + [[ -n '' ]]
27 > + set +x
28 > * ERROR: dev-python/setuptools-36.7.2::gentoo failed (install phase):
29 > * python2_7: merging image failed.
30 > *
31 > * Call stack:
32 > * ebuild.sh, line 124: Called src_install
33 > * environment, line 2564: Called distutils-r1_src_install
34 > * environment, line 785: Called _distutils-r1_run_foreach_impl 'python_install'
35 > * environment, line 281: Called python_foreach_impl 'distutils-r1_run_phase' 'python_install'
36 > * environment, line 2103: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_install'
37 > * environment, line 1478: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_install'
38 > * environment, line 1476: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_install'
39 > * environment, line 498: Called distutils-r1_run_phase 'python_install'
40 > * environment, line 755: Called python_install
41 > * environment, line 2265: Called distutils-r1_python_install
42 > * environment, line 687: Called multibuild_merge_root '/var/tmp/portage/dev-python/setuptools-36.7.2/image/_python2.7' '/var/tmp/portage/dev-python/setuptools-36.7.2/image/'
43 > * environment, line 1507: Called die
44 > * The specific snippet of code:
45 > * die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed.";
46 > *
47 > * If you need support, post the output of `emerge --info '=dev-python/setuptools-36.7.2::gentoo'`,
48 > * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-36.7.2::gentoo'`.
49 > * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-36.7.2/temp/build.log'.
50 > * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-36.7.2/temp/environment'.
51 > * Working directory: '/var/tmp/portage/dev-python/setuptools-36.7.2/work/setuptools-36.7.2-python2_7'
52 > * S: '/var/tmp/portage/dev-python/setuptools-36.7.2/work/setuptools-36.7.2'
53
54 As it happens,
55 /var/tmp/portage/dev-python/setuptools-36.7.2/image/./usr/bin/easy_install
56 is a broken link to python-exec2. When I look at multibuild_merge_root
57 I see this:
58
59 > multibuild_merge_root() {
60 > local src=${1}
61 > local dest=${2}
62 >
63 > local ret
64 >
65 > if use userland_BSD; then
66 > # Most of BSD variants fail to copy broken symlinks, #447370
67 > # also, they do not support --version
68 >
69 > tar -C "${src}" -f - -c . \
70 > | tar -x -f - -C "${dest}"
71 > [[ ${PIPESTATUS[*]} == '0 0' ]]
72 > ret=${?}
73 > else
74 > local cp_args=()
75 >
76 > if cp -a --version &>/dev/null; then
77 > cp_args+=( -a )
78 > else
79 > cp_args+=( -P -R -p )
80 > fi
81 >
82 > if cp --reflink=auto --version &>/dev/null; then
83 > # enable reflinking if possible to make this faster
84 > cp_args+=( --reflink=auto )
85 > fi
86 >
87 > cp "${cp_args[@]}" "${src}"/. "${dest}"/
88 > ret=${?}
89 > fi
90 >
91 > if [[ ${ret} -ne 0 ]]; then
92 > die "${MULTIBUILD_VARIANT:-(unknown)}: merging image failed."
93 > fi
94 >
95 > rm -rf "${src}"
96 > }
97
98 The comment "Most of BSD variants fail to copy broken symlinks" jumped
99 out at me. Commenting out the other bits of that `if` statement so the
100 BSD version runs, works. Has anyone else noticed such peculiarities?
101 --
102 Stuart Longland (aka Redhatter, VK4MSL)
103
104 I haven't lost my mind...
105 ...it's backed up on a tape somewhere.

Attachments

File name MIME type
signature.asc application/pgp-signature