Merge lp:~chipaca/snapweb/seriously-build-ok into lp:~snappy-dev/snapweb/trunk

Proposed by John Lenton
Status: Needs review
Proposed branch: lp:~chipaca/snapweb/seriously-build-ok
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 271 lines (+62/-37)
6 files modified
build.sh (+35/-9)
dependencies.tsv (+3/-2)
oem/oem.go (+4/-3)
pkg/meta/package.yaml (+2/-2)
pkg/snappyd (+6/-1)
snappy/converge.go (+12/-20)
To merge this branch: bzr merge lp:~chipaca/snapweb/seriously-build-ok
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Sergio Schvezov Pending
Review via email: mp+276791@code.launchpad.net

This proposal supersedes a proposal from 2015-10-01.

Commit message

Tweaks and fixes to build and package.

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
John Lenton (chipaca) :
review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (3.6 KiB)

The attempt to merge lp:~chipaca/webdm/seriously-build-ok into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update github.com/mvo5/uboot-go failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/mvo5/uboot-go now at 69978a3e4b05cca9d7cfee489b3453dfed45e72c
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update github.com/davecheney/gmx failed; trying to fetch newer version
launchpad.net/snappy now at snappy_tarmac-20150925153317-7acittvlm7idwcwl
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/gosexy/gettext failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/gosexy/gettext now at 98b7b91596d20b96909e6b60d57411547dd9959c
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
Building
Running tests from /tmp/tmp.PVYDFWU1ZN/src/launchpad.net/webdm
=== RUN Test
OK: 4 passed
--- PASS: Test (0.00 seconds)
PASS
coverage: 60.0% of statements
ok launchpad.net/webdm/avahi 0.007s coverage: 60.0% of statements
? launchpad.net/webdm/cmd/snappyd [no test files]
? launchpad.net/webdm/oem [no test files]
FAIL launchpad.net/webdm/snappy [build failed]
? launchpad.net/webdm/webprogress [no test files]

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad.net/webdm
cp -a . $GOPATH/src/launchpad.net/webdm/
cd $GOPATH/src/launchpad.net/webdm

./run-checks
github.com/davecheney/gmx
github.com/miekg/dns
gopkg.in/yaml.v2
launchpad.net/snappy/pkg
github.com/mvo5/goconfigparser
github.com/blakesmith/ar
launchpad.net/snappy/logger
launchpad.net/snappy/helpers
launchpad.net/snappy/clickdeb
launchpad.net/snappy/coreconfig
github.com/davecheney/mdns
github.com/gosexy/gettext
launchpad.net/webdm/avahi
launchpad.net/snappy/oauth
github.com/mvo5/uboot-go/uenv
launchpad.net/snappy/partition
launchpad.net/snap...

Read more...

Unmerged revisions

163. By John Lenton

fxi typo

162. By John Lenton

silly tweaks to build and package

161. By John Lenton

update package version

160. By John Lenton

build again, ok? ta

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build.sh'
2--- build.sh 2015-05-26 13:34:13 +0000
3+++ build.sh 2015-11-05 17:18:37 +0000
4@@ -9,14 +9,17 @@
5 arch=$1
6
7 case $arch in
8+ 386)
9+ plat_abi=i386-linux-gnu
10+ ;;
11 amd64)
12 plat_abi=x86_64-linux-gnu
13 ;;
14 arm)
15 plat_abi=arm-linux-gnueabihf
16 ;;
17- armhf)
18- plat_abi=arm-linux-gnueabihf
19+ arm64)
20+ plat_abi=aarch64-linux-gnu
21 ;;
22 *)
23 echo "unknown platform for snappy-magic: $arch remember to file a bug or better yet: fix it :)"
24@@ -28,13 +31,33 @@
25 }
26
27 gobuild() {
28- arch=$1
29-
30- plat_abi=$(get_platform_abi $arch)
31+ local arch=$1
32+ local plat_abi=$(get_platform_abi $arch)
33
34 mkdir -p "bin/$plat_abi"
35 cd "bin/$plat_abi"
36- GOARCH=$arch GOARM=7 CGO_ENABLED=1 CC=${plat_abi}-gcc go build -ldflags "-extld=${plat_abi}-gcc" launchpad.net/webdm/cmd/snappyd
37+
38+ local GOARCH CGO_ENABLED CC GO386 FLAGS
39+
40+ export GOARCH=$arch
41+ export CGO_ENABLED=1
42+
43+ if [ "$arch" = "386" ]; then
44+ # 386 is a special snowflake, etc
45+ # also, the edison doesn't have SSE, which we might care about
46+ export GO386=387
47+ else
48+ export CC=${plat_abi}-gcc
49+ if ! which $CC > /dev/null; then
50+ echo "Could not find $CC. Maybe you need to install gcc-${plat_abi}?"
51+ exit 1
52+ fi
53+
54+ FLAGS="-ldflags -extld=$CC"
55+ fi
56+
57+ go build $FLAGS launchpad.net/webdm/cmd/snappyd
58+
59 cd - > /dev/null
60 }
61
62@@ -55,11 +78,14 @@
63 cp -r www/public www/templates $builddir/www
64 cd $builddir
65
66-sed -i 's/\(architecture: \)UNKNOWN_ARCH/\1[amd64, armhf]/' \
67+sed -i 's/\(architectures: \)UNKNOWN_ARCH/\1[i386, amd64, armhf, arm64]/' \
68 $builddir/meta/package.yaml
69
70-gobuild arm
71-gobuild amd64
72+for arch in 386 amd64 arm arm64; do
73+ echo -n Building for $arch...
74+ gobuild $arch
75+ echo done
76+done
77
78 cd "$orig_pwd"
79
80
81=== modified file 'dependencies.tsv'
82--- dependencies.tsv 2015-05-07 18:53:42 +0000
83+++ dependencies.tsv 2015-11-05 17:18:37 +0000
84@@ -4,9 +4,10 @@
85 github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z
86 github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z
87 github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z
88-github.com/juju/loggo git 4c7cbce140ca070eeb59a28f4bf9507e511711f9 2015-02-26T05:51:10Z
89+github.com/gosexy/gettext git 98b7b91596d20b96909e6b60d57411547dd9959c 2013-02-21T11:21:43Z
90 github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z
91 github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
92+github.com/mvo5/uboot-go git 69978a3e4b05cca9d7cfee489b3453dfed45e72c 2015-07-23T08:17:10Z
93 gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z
94 gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z
95-launchpad.net/snappy bzr snappy_tarmac-20150507103214-pgd90adryua6v6wi 444
96+launchpad.net/snappy bzr snappy_tarmac-20150925153317-7acittvlm7idwcwl 718
97
98=== modified file 'oem/oem.go'
99--- oem/oem.go 2015-05-08 19:21:46 +0000
100+++ oem/oem.go 2015-11-05 17:18:37 +0000
101@@ -22,12 +22,13 @@
102 "io/ioutil"
103 "path/filepath"
104
105+ "launchpad.net/snappy/pkg"
106 "launchpad.net/snappy/snappy"
107
108 "gopkg.in/yaml.v2"
109 )
110
111-// Snap holds the package.yaml for a snappy.SnapTypeOem package.
112+// Snap holds the package.yaml for a pkg.TypeOem package.
113 type Snap struct {
114 Name string `yaml:"name" json:"name"`
115 Vendor string `yaml:"vendor" json:"vendor"`
116@@ -46,7 +47,7 @@
117 // ErrNotFound indicates that there is no oem package.
118 var ErrNotFound = errors.New("no oem package installed")
119
120-// ErrTooMany indicates that there are too many active snappy.SnapTypeOem packages, which
121+// ErrTooMany indicates that there are too many active pkg.TypeOem packages, which
122 // should never happen on a snappy managed system.
123 var ErrTooMany = errors.New("too many oem packages found")
124
125@@ -56,7 +57,7 @@
126
127 // Oem returns an oem package
128 func Oem() (*Snap, error) {
129- oem, err := snappy.ActiveSnapsByType(snappy.SnapTypeOem)
130+ oem, err := snappy.ActiveSnapsByType(pkg.TypeOem)
131 if err != nil {
132 return nil, err
133 } else if len(oem) > 1 {
134
135=== modified file 'pkg/meta/package.yaml'
136--- pkg/meta/package.yaml 2015-06-10 14:41:19 +0000
137+++ pkg/meta/package.yaml 2015-11-05 17:18:37 +0000
138@@ -3,8 +3,8 @@
139 icon: meta/webdm-icon.png
140 source: lp:webdm
141 type: framework
142-version: 0.9
143-architecture: UNKNOWN_ARCH
144+version: 0.9.3
145+architectures: UNKNOWN_ARCH
146 services:
147 - name: snappyd
148 start: snappyd
149
150=== modified file 'pkg/snappyd'
151--- pkg/snappyd 2015-05-21 22:24:32 +0000
152+++ pkg/snappyd 2015-11-05 17:18:37 +0000
153@@ -4,6 +4,12 @@
154 platform=$(uname -i)
155
156 case $platform in
157+ i386)
158+ plat_abi=i386-linux-gnu
159+ ;;
160+ aarch64)
161+ plat_abi=aarch64-linux-gnu
162+ ;;
163 x86_64)
164 plat_abi=x86_64-linux-gnu
165 ;;
166@@ -15,7 +21,6 @@
167 ;;
168 esac
169
170-mkdir -m1777 -p $SNAP_APP_TMPDIR
171 exec $SNAP_APP_PATH/bin/$plat_abi/snappyd
172
173 # never reach this
174
175=== modified file 'snappy/converge.go'
176--- snappy/converge.go 2015-05-08 15:22:21 +0000
177+++ snappy/converge.go 2015-11-05 17:18:37 +0000
178@@ -25,6 +25,7 @@
179
180 "log"
181
182+ "launchpad.net/snappy/pkg"
183 "launchpad.net/snappy/snappy"
184 "launchpad.net/webdm/webprogress"
185 )
186@@ -43,7 +44,7 @@
187 Progress float64 `json:"progress,omitempty"`
188 InstalledSize int64 `json:"installed_size,omitempty"`
189 DownloadSize int64 `json:"download_size,omitempty"`
190- Type snappy.SnapType `json:"type,omitempty"`
191+ Type pkg.Type `json:"type,omitempty"`
192 UIPort uint64 `json:"ui_port,omitempty"`
193 UIUri string `json:"ui_uri,omitempty"`
194 }
195@@ -63,10 +64,10 @@
196 var activeSnapByName = snappy.ActiveSnapByName
197
198 func (h *Handler) packagePayload(resource string) (snapPkg, error) {
199- var pkgName, namespace string
200+ var pkgName, origin string
201 if s := strings.Split(resource, "."); len(s) == 2 {
202 pkgName = s[0]
203- namespace = s[1]
204+ origin = s[1]
205 } else {
206 pkgName = resource
207 }
208@@ -74,13 +75,13 @@
209 snapQ := activeSnapByName(pkgName)
210 if snapQ != nil {
211 // the second check is for locally installed snaps that lose their origin.
212- if snapQ.Namespace() == namespace || snapQ.Type() != snappy.SnapTypeApp {
213+ if snapQ.Origin() == origin || snapQ.Type() != pkg.TypeApp {
214 return h.snapQueryToPayload(snapQ), nil
215 }
216 }
217
218 mStore := snappy.NewMetaStoreRepository()
219- found, err := mStore.Details(resource)
220+ found, err := mStore.Details(pkgName, origin)
221 if err == nil && len(found) != 0 {
222 return h.snapQueryToPayload(found[0]), nil
223 }
224@@ -225,33 +226,24 @@
225 return snapPkgs
226 }
227
228-func isNamespaceless(snap snappy.Part) bool {
229- return snap.Type() == snappy.SnapTypeOem || snap.Type() == snappy.SnapTypeFramework
230-}
231-
232 func hasPortInformation(snap snappy.Part) bool {
233- return snap.Type() == snappy.SnapTypeApp || snap.Type() == snappy.SnapTypeFramework
234+ return snap.Type() == pkg.TypeApp || snap.Type() == pkg.TypeFramework
235 }
236
237 func (h *Handler) snapQueryToPayload(snapQ snappy.Part) snapPkg {
238 snap := snapPkg{
239 Name: snapQ.Name(),
240- Origin: snapQ.Namespace(),
241+ Origin: snapQ.Origin(),
242 Version: snapQ.Version(),
243 Vendor: snapQ.Vendor(),
244 Description: snapQ.Description(),
245 Type: snapQ.Type(),
246- }
247-
248- if isNamespaceless(snapQ) {
249- snap.ID = snapQ.Name()
250- } else {
251- snap.ID = snapQ.Name() + "." + snapQ.Namespace()
252+ ID: snappy.QualifiedName(snapQ),
253 }
254
255 if hasPortInformation(snapQ) {
256- if snapInstalled, ok := snapQ.(snappy.Services); ok {
257- port, uri := uiAccess(snapInstalled.Services())
258+ if snapInstalled, ok := snapQ.(snappy.ServiceYamler); ok {
259+ port, uri := uiAccess(snapInstalled.ServiceYamls())
260 snap.UIPort = port
261 snap.UIUri = uri
262 }
263@@ -293,7 +285,7 @@
264 return snap
265 }
266
267-func uiAccess(services []snappy.Service) (port uint64, uri string) {
268+func uiAccess(services []snappy.ServiceYaml) (port uint64, uri string) {
269 for i := range services {
270 if services[i].Ports == nil {
271 continue

Subscribers

People subscribed via source and target branches

to all changes: