From f34e673079278609eb856cece9f421b8231986c3 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 27 Aug 2014 00:10:16 -0700 Subject: [PATCH] dashboard/env: add nacl-386 and nacl-amd64p32 builders LGTM=adg R=adg, dave CC=golang-codereviews https://golang.org/cl/136830043 --- dashboard/env/linux-x86-nacl/Dockerfile | 57 +++++++++++++++++++ dashboard/env/linux-x86-nacl/Makefile | 10 ++++ dashboard/env/linux-x86-nacl/README | 6 ++ dashboard/env/linux-x86-nacl/build-command.pl | 13 +++++ 4 files changed, 86 insertions(+) create mode 100644 dashboard/env/linux-x86-nacl/Dockerfile create mode 100644 dashboard/env/linux-x86-nacl/Makefile create mode 100644 dashboard/env/linux-x86-nacl/README create mode 100755 dashboard/env/linux-x86-nacl/build-command.pl diff --git a/dashboard/env/linux-x86-nacl/Dockerfile b/dashboard/env/linux-x86-nacl/Dockerfile new file mode 100644 index 00000000..0aea4a00 --- /dev/null +++ b/dashboard/env/linux-x86-nacl/Dockerfile @@ -0,0 +1,57 @@ +# Copyright 2014 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# gobuilders/linux-x86-nacl for 32- and 64-bit nacl. +# +# We need more modern libc than Debian stable as used in base, so we're +# using Ubuntu LTS here. +# +# TODO(bradfitz): make both be Ubuntu? But we also want Debian, Fedora, +# etc coverage., so deal with unifying these later, once there's a plan +# or a generator for them and the other builders are turned down. + +FROM ubuntu:trusty +MAINTAINER golang-dev + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get upgrade -y + +# For running curl to get the hg starter tarballs (faster than hg clone). +RUN apt-get install -y --no-install-recommends curl ca-certificates + +# For building Go's bootstrap 'dist' program: +RUN apt-get install -y --no-install-recommends gcc libc6-dev + +# For interacting with the Go source & subrepos: +RUN apt-get install -y --no-install-recommends mercurial git-core subversion + +# For 32-bit nacl: +RUN apt-get install -y --no-install-recommends libc6-i386 libc6-dev-i386 lib32stdc++6 gcc-multilib + +ENV GOPATH /gopath +ENV GOROOT /goroot + +RUN mkdir -p $GOROOT +RUN cd $GOROOT && curl -s https://storage.googleapis.com/gobuilder/go-snap.tar.gz | tar x --no-same-owner -zv + +ENV GO_TOOLS $GOPATH/src/code.google.com/p/go.tools +RUN mkdir -p $GO_TOOLS +RUN cd $GO_TOOLS $ && curl -s https://storage.googleapis.com/gobuilder/go.tools-snap.tar.gz | tar x --no-same-owner -zv + +RUN cd $GOROOT && hg update -C b8ff0ec2a724 +RUN cd $GOROOT/src && ./make.bash +RUN mkdir -p /usr/local/bin + +RUN cd $GO_TOOLS && hg update -C 881a2f3130de +ENV GOBIN /usr/local/bin +RUN /goroot/bin/go install code.google.com/p/go.tools/dashboard/builder + +RUN cd /usr/local/bin && curl -s -O https://storage.googleapis.com/gobuilder/sel_ldr_x86_32 && chmod +x sel_ldr_x86_32 +RUN cd /usr/local/bin && curl -s -O https://storage.googleapis.com/gobuilder/sel_ldr_x86_64 && chmod +x sel_ldr_x86_64 + +RUN ln -s $GOROOT/misc/nacl/go_nacl_386_exec /usr/local/bin/ +RUN ln -s $GOROOT/misc/nacl/go_nacl_amd64p32_exec /usr/local/bin/ +ADD build-command.pl /usr/local/bin/ + +ENV PATH /usr/local/bin:$GOROOT/bin:$PATH diff --git a/dashboard/env/linux-x86-nacl/Makefile b/dashboard/env/linux-x86-nacl/Makefile new file mode 100644 index 00000000..2128361f --- /dev/null +++ b/dashboard/env/linux-x86-nacl/Makefile @@ -0,0 +1,10 @@ +# Copyright 2014 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +docker: Dockerfile + docker build -t gobuilders/linux-x86-nacl . + +push: docker + docker push gobuilders/linux-x86-nacl + diff --git a/dashboard/env/linux-x86-nacl/README b/dashboard/env/linux-x86-nacl/README new file mode 100644 index 00000000..5862ee19 --- /dev/null +++ b/dashboard/env/linux-x86-nacl/README @@ -0,0 +1,6 @@ +$ export BUILD=nacl-amd64p32-temp +$ export BUILDREV=59b1bb4bf045 +$ docker run \ + -v $HOME/keys/$BUILD.buildkey:/.gobuildkey \ + gobuilders/linux-x86-nacl \ + /usr/local/bin/builder -rev=$BUILDREV -buildroot=/ -v -cmd=/usr/local/bin/build-command.pl $BUILD diff --git a/dashboard/env/linux-x86-nacl/build-command.pl b/dashboard/env/linux-x86-nacl/build-command.pl new file mode 100755 index 00000000..0eb9edbb --- /dev/null +++ b/dashboard/env/linux-x86-nacl/build-command.pl @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +use strict; + +if ($ENV{GOOS} eq "nacl") { + delete $ENV{GOROOT_FINAL}; + exec("./nacltest.bash", @ARGV); + die "Failed to run nacltest.bash: $!\n"; +} + +exec("./all.bash", @ARGV); +die "Failed to run all.bash: $!\n"; +