containers / build

another build tool for container images (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
342 stars 80 forks source link

Acbuild begin - Errors from beginFromLocalDirectory are being swallowed in Begin #270

Closed tjabell closed 7 years ago

tjabell commented 7 years ago

Hi,

I was trying to start a new build from a directory with acbuild begin /path/to/rootfs and it was only creating about half of the directories under .acbuild/currentaci/rootfs that had existed in the source directory. After a little debugging, it looks like any errors that occur in beginFromLocalDirectory https://github.com/containers/build/blob/master/lib/begin.go#L161 are swallowed in Begin https://github.com/containers/build/blob/master/lib/begin.go#L96. In this case it was swallowing a permission error when trying to copy the directory.

My Go-fu is pretty weak, but perhaps https://github.com/containers/build/blob/master/lib/begin.go#L96 should look like:

err = a.beginFromLocalDirectory(start)

if err != nil {
    return err
}

Thanks!

jonboulle commented 7 years ago

Great find! By my reading, that line should actually be return a.beginFromLocalDirectory(start) (since we don't want to continue on to the empty directory start).

Would you be interested in submitting a patch for this?