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
=== modified file 'build.sh'
--- build.sh 2015-05-26 13:34:13 +0000
+++ build.sh 2015-11-05 17:18:37 +0000
@@ -9,14 +9,17 @@
9 arch=$19 arch=$1
1010
11 case $arch in11 case $arch in
12 386)
13 plat_abi=i386-linux-gnu
14 ;;
12 amd64)15 amd64)
13 plat_abi=x86_64-linux-gnu16 plat_abi=x86_64-linux-gnu
14 ;;17 ;;
15 arm)18 arm)
16 plat_abi=arm-linux-gnueabihf19 plat_abi=arm-linux-gnueabihf
17 ;;20 ;;
18 armhf)21 arm64)
19 plat_abi=arm-linux-gnueabihf22 plat_abi=aarch64-linux-gnu
20 ;;23 ;;
21 *)24 *)
22 echo "unknown platform for snappy-magic: $arch remember to file a bug or better yet: fix it :)"25 echo "unknown platform for snappy-magic: $arch remember to file a bug or better yet: fix it :)"
@@ -28,13 +31,33 @@
28}31}
2932
30gobuild() {33gobuild() {
31 arch=$134 local arch=$1
3235 local plat_abi=$(get_platform_abi $arch)
33 plat_abi=$(get_platform_abi $arch)
3436
35 mkdir -p "bin/$plat_abi"37 mkdir -p "bin/$plat_abi"
36 cd "bin/$plat_abi"38 cd "bin/$plat_abi"
37 GOARCH=$arch GOARM=7 CGO_ENABLED=1 CC=${plat_abi}-gcc go build -ldflags "-extld=${plat_abi}-gcc" launchpad.net/webdm/cmd/snappyd39
40 local GOARCH CGO_ENABLED CC GO386 FLAGS
41
42 export GOARCH=$arch
43 export CGO_ENABLED=1
44
45 if [ "$arch" = "386" ]; then
46 # 386 is a special snowflake, etc
47 # also, the edison doesn't have SSE, which we might care about
48 export GO386=387
49 else
50 export CC=${plat_abi}-gcc
51 if ! which $CC > /dev/null; then
52 echo "Could not find $CC. Maybe you need to install gcc-${plat_abi}?"
53 exit 1
54 fi
55
56 FLAGS="-ldflags -extld=$CC"
57 fi
58
59 go build $FLAGS launchpad.net/webdm/cmd/snappyd
60
38 cd - > /dev/null61 cd - > /dev/null
39}62}
4063
@@ -55,11 +78,14 @@
55cp -r www/public www/templates $builddir/www78cp -r www/public www/templates $builddir/www
56cd $builddir79cd $builddir
5780
58sed -i 's/\(architecture: \)UNKNOWN_ARCH/\1[amd64, armhf]/' \81sed -i 's/\(architectures: \)UNKNOWN_ARCH/\1[i386, amd64, armhf, arm64]/' \
59 $builddir/meta/package.yaml82 $builddir/meta/package.yaml
6083
61gobuild arm84for arch in 386 amd64 arm arm64; do
62gobuild amd6485 echo -n Building for $arch...
86 gobuild $arch
87 echo done
88done
6389
64cd "$orig_pwd"90cd "$orig_pwd"
6591
6692
=== modified file 'dependencies.tsv'
--- dependencies.tsv 2015-05-07 18:53:42 +0000
+++ dependencies.tsv 2015-11-05 17:18:37 +0000
@@ -4,9 +4,10 @@
4github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z4github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z
5github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z5github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z
6github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z6github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z
7github.com/juju/loggo git 4c7cbce140ca070eeb59a28f4bf9507e511711f9 2015-02-26T05:51:10Z7github.com/gosexy/gettext git 98b7b91596d20b96909e6b60d57411547dd9959c 2013-02-21T11:21:43Z
8github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z8github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z
9github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z9github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
10github.com/mvo5/uboot-go git 69978a3e4b05cca9d7cfee489b3453dfed45e72c 2015-07-23T08:17:10Z
10gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z11gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z
11gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z12gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z
12launchpad.net/snappy bzr snappy_tarmac-20150507103214-pgd90adryua6v6wi 44413launchpad.net/snappy bzr snappy_tarmac-20150925153317-7acittvlm7idwcwl 718
1314
=== modified file 'oem/oem.go'
--- oem/oem.go 2015-05-08 19:21:46 +0000
+++ oem/oem.go 2015-11-05 17:18:37 +0000
@@ -22,12 +22,13 @@
22 "io/ioutil"22 "io/ioutil"
23 "path/filepath"23 "path/filepath"
2424
25 "launchpad.net/snappy/pkg"
25 "launchpad.net/snappy/snappy"26 "launchpad.net/snappy/snappy"
2627
27 "gopkg.in/yaml.v2"28 "gopkg.in/yaml.v2"
28)29)
2930
30// Snap holds the package.yaml for a snappy.SnapTypeOem package.31// Snap holds the package.yaml for a pkg.TypeOem package.
31type Snap struct {32type Snap struct {
32 Name string `yaml:"name" json:"name"`33 Name string `yaml:"name" json:"name"`
33 Vendor string `yaml:"vendor" json:"vendor"`34 Vendor string `yaml:"vendor" json:"vendor"`
@@ -46,7 +47,7 @@
46// ErrNotFound indicates that there is no oem package.47// ErrNotFound indicates that there is no oem package.
47var ErrNotFound = errors.New("no oem package installed")48var ErrNotFound = errors.New("no oem package installed")
4849
49// ErrTooMany indicates that there are too many active snappy.SnapTypeOem packages, which50// ErrTooMany indicates that there are too many active pkg.TypeOem packages, which
50// should never happen on a snappy managed system.51// should never happen on a snappy managed system.
51var ErrTooMany = errors.New("too many oem packages found")52var ErrTooMany = errors.New("too many oem packages found")
5253
@@ -56,7 +57,7 @@
5657
57// Oem returns an oem package58// Oem returns an oem package
58func Oem() (*Snap, error) {59func Oem() (*Snap, error) {
59 oem, err := snappy.ActiveSnapsByType(snappy.SnapTypeOem)60 oem, err := snappy.ActiveSnapsByType(pkg.TypeOem)
60 if err != nil {61 if err != nil {
61 return nil, err62 return nil, err
62 } else if len(oem) > 1 {63 } else if len(oem) > 1 {
6364
=== modified file 'pkg/meta/package.yaml'
--- pkg/meta/package.yaml 2015-06-10 14:41:19 +0000
+++ pkg/meta/package.yaml 2015-11-05 17:18:37 +0000
@@ -3,8 +3,8 @@
3icon: meta/webdm-icon.png3icon: meta/webdm-icon.png
4source: lp:webdm4source: lp:webdm
5type: framework5type: framework
6version: 0.96version: 0.9.3
7architecture: UNKNOWN_ARCH7architectures: UNKNOWN_ARCH
8services:8services:
9 - name: snappyd9 - name: snappyd
10 start: snappyd10 start: snappyd
1111
=== modified file 'pkg/snappyd'
--- pkg/snappyd 2015-05-21 22:24:32 +0000
+++ pkg/snappyd 2015-11-05 17:18:37 +0000
@@ -4,6 +4,12 @@
4platform=$(uname -i)4platform=$(uname -i)
55
6case $platform in6case $platform in
7 i386)
8 plat_abi=i386-linux-gnu
9 ;;
10 aarch64)
11 plat_abi=aarch64-linux-gnu
12 ;;
7 x86_64)13 x86_64)
8 plat_abi=x86_64-linux-gnu14 plat_abi=x86_64-linux-gnu
9 ;;15 ;;
@@ -15,7 +21,6 @@
15 ;;21 ;;
16esac22esac
1723
18mkdir -m1777 -p $SNAP_APP_TMPDIR
19exec $SNAP_APP_PATH/bin/$plat_abi/snappyd24exec $SNAP_APP_PATH/bin/$plat_abi/snappyd
2025
21# never reach this26# never reach this
2227
=== modified file 'snappy/converge.go'
--- snappy/converge.go 2015-05-08 15:22:21 +0000
+++ snappy/converge.go 2015-11-05 17:18:37 +0000
@@ -25,6 +25,7 @@
2525
26 "log"26 "log"
2727
28 "launchpad.net/snappy/pkg"
28 "launchpad.net/snappy/snappy"29 "launchpad.net/snappy/snappy"
29 "launchpad.net/webdm/webprogress"30 "launchpad.net/webdm/webprogress"
30)31)
@@ -43,7 +44,7 @@
43 Progress float64 `json:"progress,omitempty"`44 Progress float64 `json:"progress,omitempty"`
44 InstalledSize int64 `json:"installed_size,omitempty"`45 InstalledSize int64 `json:"installed_size,omitempty"`
45 DownloadSize int64 `json:"download_size,omitempty"`46 DownloadSize int64 `json:"download_size,omitempty"`
46 Type snappy.SnapType `json:"type,omitempty"`47 Type pkg.Type `json:"type,omitempty"`
47 UIPort uint64 `json:"ui_port,omitempty"`48 UIPort uint64 `json:"ui_port,omitempty"`
48 UIUri string `json:"ui_uri,omitempty"`49 UIUri string `json:"ui_uri,omitempty"`
49}50}
@@ -63,10 +64,10 @@
63var activeSnapByName = snappy.ActiveSnapByName64var activeSnapByName = snappy.ActiveSnapByName
6465
65func (h *Handler) packagePayload(resource string) (snapPkg, error) {66func (h *Handler) packagePayload(resource string) (snapPkg, error) {
66 var pkgName, namespace string67 var pkgName, origin string
67 if s := strings.Split(resource, "."); len(s) == 2 {68 if s := strings.Split(resource, "."); len(s) == 2 {
68 pkgName = s[0]69 pkgName = s[0]
69 namespace = s[1]70 origin = s[1]
70 } else {71 } else {
71 pkgName = resource72 pkgName = resource
72 }73 }
@@ -74,13 +75,13 @@
74 snapQ := activeSnapByName(pkgName)75 snapQ := activeSnapByName(pkgName)
75 if snapQ != nil {76 if snapQ != nil {
76 // the second check is for locally installed snaps that lose their origin.77 // the second check is for locally installed snaps that lose their origin.
77 if snapQ.Namespace() == namespace || snapQ.Type() != snappy.SnapTypeApp {78 if snapQ.Origin() == origin || snapQ.Type() != pkg.TypeApp {
78 return h.snapQueryToPayload(snapQ), nil79 return h.snapQueryToPayload(snapQ), nil
79 }80 }
80 }81 }
8182
82 mStore := snappy.NewMetaStoreRepository()83 mStore := snappy.NewMetaStoreRepository()
83 found, err := mStore.Details(resource)84 found, err := mStore.Details(pkgName, origin)
84 if err == nil && len(found) != 0 {85 if err == nil && len(found) != 0 {
85 return h.snapQueryToPayload(found[0]), nil86 return h.snapQueryToPayload(found[0]), nil
86 }87 }
@@ -225,33 +226,24 @@
225 return snapPkgs226 return snapPkgs
226}227}
227228
228func isNamespaceless(snap snappy.Part) bool {
229 return snap.Type() == snappy.SnapTypeOem || snap.Type() == snappy.SnapTypeFramework
230}
231
232func hasPortInformation(snap snappy.Part) bool {229func hasPortInformation(snap snappy.Part) bool {
233 return snap.Type() == snappy.SnapTypeApp || snap.Type() == snappy.SnapTypeFramework230 return snap.Type() == pkg.TypeApp || snap.Type() == pkg.TypeFramework
234}231}
235232
236func (h *Handler) snapQueryToPayload(snapQ snappy.Part) snapPkg {233func (h *Handler) snapQueryToPayload(snapQ snappy.Part) snapPkg {
237 snap := snapPkg{234 snap := snapPkg{
238 Name: snapQ.Name(),235 Name: snapQ.Name(),
239 Origin: snapQ.Namespace(),236 Origin: snapQ.Origin(),
240 Version: snapQ.Version(),237 Version: snapQ.Version(),
241 Vendor: snapQ.Vendor(),238 Vendor: snapQ.Vendor(),
242 Description: snapQ.Description(),239 Description: snapQ.Description(),
243 Type: snapQ.Type(),240 Type: snapQ.Type(),
244 }241 ID: snappy.QualifiedName(snapQ),
245
246 if isNamespaceless(snapQ) {
247 snap.ID = snapQ.Name()
248 } else {
249 snap.ID = snapQ.Name() + "." + snapQ.Namespace()
250 }242 }
251243
252 if hasPortInformation(snapQ) {244 if hasPortInformation(snapQ) {
253 if snapInstalled, ok := snapQ.(snappy.Services); ok {245 if snapInstalled, ok := snapQ.(snappy.ServiceYamler); ok {
254 port, uri := uiAccess(snapInstalled.Services())246 port, uri := uiAccess(snapInstalled.ServiceYamls())
255 snap.UIPort = port247 snap.UIPort = port
256 snap.UIUri = uri248 snap.UIUri = uri
257 }249 }
@@ -293,7 +285,7 @@
293 return snap285 return snap
294}286}
295287
296func uiAccess(services []snappy.Service) (port uint64, uri string) {288func uiAccess(services []snappy.ServiceYaml) (port uint64, uri string) {
297 for i := range services {289 for i := range services {
298 if services[i].Ports == nil {290 if services[i].Ports == nil {
299 continue291 continue

Subscribers

People subscribed via source and target branches

to all changes: