Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721074 - golang-vcs.eclass: cp: target 'Unable to copy sources to ... is not a directory
Summary: golang-vcs.eclass: cp: target 'Unable to copy sources to ... is not a directory
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-05 10:50 UTC by Erik Dannenberg
Modified: 2020-05-10 00:05 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 Erik Dannenberg 2020-05-05 10:50:32 UTC
Weird issue with a ebuild for a go project, the relevant error:

mkdir -p /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb
cp -r /distfiles/go-src/src/github.com/influxdata/influxdb /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb/..
cp: target 'Unable to copy sources to /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb' is not a directory


The target directory does exist with proper permissions:

ls -lah /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb/
total 0
drwxr-xr-x 1 portage portage  0 May  5 10:28 .
drwxr-xr-x 1 portage portage 16 May  5 10:28 ..


Running the exact cp command manually also works:

cp -r /distfiles/go-src/src/github.com/influxdata/influxdb /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb/..
ls -lah /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb/
total 608K
drwxr-xr-x 1 portage portage 2.4K May  5 10:35 .
drwxr-xr-x 1 portage portage   16 May  5 10:28 ..
-rw-r--r-- 1 root    root     198 May  5 10:35 api-compat.Jenkinsfile
.
.
.

After fixing the owner i can continue the build via ebuild without error:

chown -R portage:portage /var/tmp/portage/dev-db/influxdb-1.8.0/work/influxdb-1.8.0/src/github.com/influxdata/influxdb/..
ebuild dev-db/influxdb/influxdb-1.8.0.ebuild merge
>>> dev-db/influxdb-1.8.0 merged.

I'm a bit at a loss what the problem is, the build is executed in a docker container if that makes any difference. The ebuild in question, though I'm sure the error is not in the ebuild as it worked before and had no changes with the latest bump:

https://github.com/edannenberg/kubler-overlay/blob/e39c890d7a9a0ad483389829ab493cf0fd097f76/dev-db/influxdb/influxdb-1.8.0.ebuild
Comment 1 Erik Dannenberg 2020-05-06 15:46:49 UTC
Tracked down the problem to golang-vcs.eclass, changing _golang-vcs_fetch() from:

set -- cp -r    "${EGO_STORE_DIR}/src/${EGO_PN%/...}" \
                "${go_srcpath}/.."


to:

cp -r    "${EGO_STORE_DIR}/src/${EGO_PN%/...}" \
                "${go_srcpath}/.."

fixed the issue.
Comment 2 Erik Dannenberg 2020-05-06 15:50:21 UTC
The function could also use some error handling, if a command fails the build should also fail.