From bbd372d00ee775bc26430ccde62e29e8881ebbc8 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Sun, 1 Mar 2020 21:24:45 +1100 Subject: [PATCH 1/3] Correctly build forks in Travis The CI script goes looking for the branch to which a commit was pushed, but was applying the branch name to moby/buildkit even if being built on a different fork. Signed-off-by: Paul "TBBle" Hampson --- hack/util | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/util b/hack/util index 778995850b85..7b68d75e4d72 100755 --- a/hack/util +++ b/hack/util @@ -32,7 +32,7 @@ if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then currentref="git://github.com/moby/buildkit#refs/pull/$TRAVIS_PULL_REQUEST/merge" cacheref="cicache.buildk.it/moby/buildkit/pr$TRAVIS_BUILD_ID" elif [ -n "$TRAVIS_BRANCH" ]; then - currentref="git://github.com/moby/buildkit#$TRAVIS_BRANCH" + currentref="git://github.com/$TRAVIS_REPO_SLUG#$TRAVIS_BRANCH" fi From 25f50eb711efed90929a636db6597c22afa14a0b Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Sun, 1 Mar 2020 22:41:47 +1100 Subject: [PATCH 2/3] Wrap original error when failing to read download context Signed-off-by: Paul "TBBle" Hampson --- frontend/dockerfile/builder/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/dockerfile/builder/build.go b/frontend/dockerfile/builder/build.go index a91b46dd9df1..6d959d9deb4c 100644 --- a/frontend/dockerfile/builder/build.go +++ b/frontend/dockerfile/builder/build.go @@ -164,7 +164,7 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) { }, }) if err != nil { - return nil, errors.Errorf("failed to read downloaded context") + return nil, errors.Wrapf(err, "failed to read downloaded context") } if isArchive(dt) { if fileop { From 7369864344fa5a42702bfa14a4b7bab179ee098c Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Sun, 1 Mar 2020 22:48:30 +1100 Subject: [PATCH 3/3] Move printLogs from oci.go to sandbox.go It's not OCI-specific, so it makes more sense in the file that exports it to the world. Signed-off-by: Paul "TBBle" Hampson --- util/testutil/integration/oci.go | 12 ------------ util/testutil/integration/sandbox.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/util/testutil/integration/oci.go b/util/testutil/integration/oci.go index c4d3820cfcab..12d3ae705b40 100644 --- a/util/testutil/integration/oci.go +++ b/util/testutil/integration/oci.go @@ -1,8 +1,6 @@ package integration import ( - "bufio" - "bytes" "fmt" "log" "os" @@ -68,13 +66,3 @@ func (s *oci) New(cfg *BackendConfig) (Backend, func() error, error) { rootless: s.uid != 0, }, stop, nil } - -func printLogs(logs map[string]*bytes.Buffer, f func(args ...interface{})) { - for name, l := range logs { - f(name) - s := bufio.NewScanner(l) - for s.Scan() { - f(s.Text()) - } - } -} diff --git a/util/testutil/integration/sandbox.go b/util/testutil/integration/sandbox.go index 6cd2af4454bc..c926ed942f27 100644 --- a/util/testutil/integration/sandbox.go +++ b/util/testutil/integration/sandbox.go @@ -212,3 +212,13 @@ func rootlessSupported(uid int) bool { } return true } + +func printLogs(logs map[string]*bytes.Buffer, f func(args ...interface{})) { + for name, l := range logs { + f(name) + s := bufio.NewScanner(l) + for s.Scan() { + f(s.Text()) + } + } +}