Skip to content
This repository was archived by the owner on Mar 6, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: constabulary/gb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.2
Choose a base ref
...
head repository: constabulary/gb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 5,570 additions and 2,117 deletions.
  1. +9 −1 appveyor.yml → .appveyor.yml
  2. +12 −4 .travis.yml
  3. +10 −6 README.md
  4. +10 −14 action_test.go
  5. +14 −0 bin/coverage.sh
  6. +51 −107 build.go
  7. +33 −30 build_test.go
  8. +39 −21 cgo.go
  9. +14 −21 cmd/cmd.go
  10. +1 −0 cmd/env.go
  11. +4 −1 cmd/gb-vendor/alldocs.go
  12. +11 −11 cmd/gb-vendor/delete.go
  13. +12 −9 cmd/gb-vendor/fetch.go
  14. +5 −4 cmd/gb-vendor/list.go
  15. +3 −12 cmd/gb-vendor/main.go
  16. +9 −9 cmd/gb-vendor/purge.go
  17. +63 −18 cmd/gb-vendor/restore.go
  18. +14 −14 cmd/gb-vendor/update.go
  19. +30 −9 cmd/gb/alldocs.go
  20. +46 −12 cmd/gb/build.go
  21. +155 −0 cmd/gb/depfile_test.go
  22. +1 −9 cmd/gb/depset.go
  23. +5 −11 cmd/gb/doc.go
  24. +8 −38 cmd/gb/env.go
  25. +1,804 −0 cmd/gb/gb_test.go
  26. +8 −14 cmd/gb/generate.go
  27. +3 −3 cmd/gb/help.go
  28. +61 −8 cmd/gb/info.go
  29. 0 cmd/gb/internal/match/_testdata/a/src/.gitturd
  30. +7 −0 cmd/gb/internal/match/_testdata/a/src/cmd/main/main.go
  31. 0 cmd/gb/internal/match/_testdata/a/src/github.com/foo/_testdata/.gitturd
  32. 0 cmd/gb/internal/match/_testdata/a/src/github.com/foo/bar/_testdata/.gitturd
  33. +1 −0 cmd/gb/internal/match/_testdata/a/src/github.com/foo/bar/bar.go
  34. +1 −0 cmd/gb/internal/match/_testdata/a/src/github.com/quxx/bar/bar.go
  35. +145 −0 cmd/gb/internal/match/match.go
  36. +275 −0 cmd/gb/internal/match/match_test.go
  37. +5 −5 cmd/gb/list.go
  38. +135 −63 cmd/gb/main.go
  39. +5 −8 cmd/gb/plugin.go
  40. +0 −4 cmd/gb/signal_unix.go
  41. +18 −8 cmd/gb/test.go
  42. +24 −8 cmd/gb/testflag.go
  43. +23 −5 cmd/gb/testflag_test.go
  44. +0 −55 cmd/import.go
  45. +0 −100 cmd/import_test.go
  46. +4 −6 cmd/path.go
  47. +3 −9 cmd/path_test.go
  48. +234 −160 context.go
  49. +176 −1 context_test.go
  50. +0 −29 debug/debug.go
  51. +211 −0 depfile.go
  52. +3 −6 example_test.go
  53. +2 −1 executor.go
  54. +7 −6 executor_test.go
  55. +19 −34 gb.go
  56. +0 −8 gb14.go
  57. +0 −8 gb15.go
  58. +36 −0 gb_test.go
  59. +44 −69 gc.go
  60. +0 −96 install.go
  61. +0 −80 install_test.go
  62. +155 −0 internal/depfile/depfile.go
  63. +192 −0 internal/depfile/depfile_test.go
  64. 0 { → internal}/fileutils/_testdata/copyfile/a/rick
  65. +10 −7 { → internal}/fileutils/fileutils.go
  66. 0 { → internal}/fileutils/fileutils_test.go
  67. +0 −2 { → internal}/fileutils/path_test.go
  68. BIN internal/untar/_testdata/a.tar.gz
  69. BIN internal/untar/_testdata/errors.tar.gz
  70. BIN internal/untar/_testdata/symlink.tar.gz
  71. +93 −0 internal/untar/untar.go
  72. +113 −0 internal/untar/untar_test.go
  73. 0 { → internal}/vendor/_testdata/src/github.com/foo/bar/main.go
  74. 0 { → internal}/vendor/_testdata/vendor/src/bitbucket.org/fwoop/ftang/kthulu.go
  75. 0 { → internal}/vendor/_testdata/vendor/src/github.com/hoo/wuu/goo.go
  76. 0 { → internal}/vendor/_testdata/vendor/src/github.com/lypo/moopo/tropo.go
  77. 0 { → internal}/vendor/_testdata/vendor/src/github.com/quux/flobble/wobble.go
  78. +7 −2 { → internal}/vendor/depset.go
  79. +5 −4 { → internal}/vendor/discovery.go
  80. +4 −4 { → internal}/vendor/imports.go
  81. +34 −5 { → internal}/vendor/imports_test.go
  82. +10 −4 { → internal}/vendor/manifest.go
  83. +3 −4 { → internal}/vendor/manifest_test.go
  84. +3 −7 { → internal}/vendor/repo.go
  85. +32 −41 { → internal}/vendor/repo_test.go
  86. 0 { → internal}/vendor/stringset.go
  87. 0 { → internal}/vendor/stringset_test.go
  88. +8 −0 internal/version/version16.go
  89. +8 −0 internal/version/version17.go
  90. +7 −0 internal/version/version18.go
  91. +198 −97 package.go
  92. +320 −62 package_test.go
  93. +16 −36 project.go
  94. +54 −0 project_test.go
  95. +0 −38 resolve.go
  96. +0 −99 resolve_test.go
  97. +131 −0 resolver.go
  98. +0 −10 src.go
  99. +0 −138 stdlib.go
  100. +12 −125 test/gotest.go
  101. +8 −3 test/resolve.go
  102. +46 −27 test/test.go
  103. +46 −37 test/test_test.go
  104. +126 −0 test/testmain17.go
  105. +112 −0 test/testmain18.go
  106. +3 −0 testdata/src/localimport/local.go
  107. +1 −0 testdata/src/nosource/x.txt
  108. +0 −72 vendor/copy.go
  109. +0 −138 vendor/stdlib.go
10 changes: 9 additions & 1 deletion appveyor.yml → .appveyor.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,13 @@ shallow_clone: true # for startup speed

environment:
GOPATH: C:\gopath
matrix:
- environment:
GOVERSION: 1.6.3
- environment:
GOVERSION: 1.7.5
- environment:
GOVERSION: 1.8.1

platform:
- x64
@@ -23,12 +30,13 @@ install:
- gcc --version
- g++ --version
# need bzr for several tests
- choco install bzr
- choco install -y --force bzr
- set PATH=C:\Program Files (x86)\Bazaar;%PATH%
- bzr --version
# TODO(tianon) - git clone --depth 1 https://github.com/constabulary/integration-tests.git

build_script:
- go get github.com/pkg/errors
- go install -v ./...

test_script:
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: go
go_import_path: github.com/constabulary/gb
go:
- 1.5.1
- 1.4.3
- 1.6.x
- 1.7.x
- 1.8.x
- tip

sudo: false
@@ -17,10 +18,17 @@ addons:
install:
- go get -t -v ./...
- git clone --quiet --single-branch --depth 1 https://github.com/constabulary/integration-tests.git ../integration-tests
- if [[ $TRAVIS_GO_VERSION == 1.4* ]]; then go get -u golang.org/x/tools/cmd/cover; fi
- echo '#!/bin/bash' > "$GOPATH/bin/sudo"
&& echo 'echo >&2 attempted sudo "$@"' >> "$GOPATH/bin/sudo"
&& chmod +x "$GOPATH/bin/sudo"

script:
- go test -v ./...
- ../integration-tests/run-all.bash
- go install -v ./...
&& bin/coverage.sh
&& go build
&& gb test
&& ../integration-tests/run-all.bash

after_success:
- bash <(curl -s https://codecov.io/bash)
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ Unix:
Windows:
[![Build status](https://ci.appveyor.com/api/projects/status/rjttg1agmp2sra3h/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/gb/branch/master)

[![codecov.io](https://codecov.io/github/constabulary/gb/branch/master/graph/badge.svg)](https://codecov.io/github/constabulary/gb)

`gb` is a proof of concept replacement build tool for the [Go programming language](https://golang.org).

I gave a talk about `gb` and the rational for its creation at GDG Berlin in April 2015, [video](https://www.youtube.com/watch?v=c3dW80eO88I) and [slides](http://go-talks.appspot.com/github.com/davecheney/presentations/reproducible-builds.slide#1).
@@ -29,17 +31,23 @@ gb has its own site, [getgb.io](http://getgb.io/), head over there for more info

## Contributing

### Contribution guidelines

We welcome pull requests, bug fixes and issue reports.

Before proposing a large change, please discuss your change by raising an issue.

### Road map

#### Completed

- [Cross Compilation](https://github.com/constabulary/gb/milestones/cross-compilation)
- Tag handling, unify -tags, ENVVARS and GOOS/GOARCH into a single format for binary names and pkg cache
- gb test improvements, test output, test flag handling
- [Race detector support](https://github.com/constabulary/gb/issues/96)

#### Todo

- 0.3 series: gb test improvements, test output, ~~flag handling~~ (done)
- [Race detector support](https://github.com/constabulary/gb/issues/96)
- 0.4 series: gb vendor updates and bug fixes
- 0.5 series: new package resolver (replace go/build)

@@ -49,7 +57,3 @@ Big ticket items that are not on the road map yet

- Package BuildID support (make stale detection work like the Go 1.5)
- `gccgo` toolchain support.

We welcome pull requests, bug fixes and issue reports.

Before proposing a large change, please discuss your change by raising an issue.
24 changes: 10 additions & 14 deletions action_test.go
Original file line number Diff line number Diff line change
@@ -7,10 +7,6 @@ import (
)

func TestBuildAction(t *testing.T) {
actions := func(a ...*Action) []*Action {
return a
}

var tests = []struct {
pkg string
action *Action
@@ -19,20 +15,20 @@ func TestBuildAction(t *testing.T) {
pkg: "a",
action: &Action{
Name: "build: a",
Deps: actions(&Action{Name: "compile: a"}),
Deps: []*Action{{Name: "compile: a"}},
},
}, {
pkg: "b",
action: &Action{
Name: "build: b",
Deps: []*Action{
&Action{
{
Name: "link: b",
Deps: []*Action{
&Action{
{
Name: "compile: b",
Deps: []*Action{
&Action{
{
Name: "compile: a",
}},
},
@@ -44,12 +40,12 @@ func TestBuildAction(t *testing.T) {
action: &Action{
Name: "build: c",
Deps: []*Action{
&Action{
{
Name: "compile: c",
Deps: []*Action{
&Action{
{
Name: "compile: a",
}, &Action{
}, {
Name: "compile: d.v1",
}},
}},
@@ -59,22 +55,22 @@ func TestBuildAction(t *testing.T) {
ctx := testContext(t)
defer ctx.Destroy()
pkg, err := ctx.ResolvePackage(tt.pkg)
if !sameErr(err, tt.err) {
if !reflect.DeepEqual(err, tt.err) {
t.Errorf("ctx.ResolvePackage(%v): want %v, got %v", tt.pkg, tt.err, err)
continue
}
if err != nil {
continue
}
got, err := BuildPackages(pkg)
if !sameErr(err, tt.err) {
if !reflect.DeepEqual(err, tt.err) {
t.Errorf("BuildAction(%v): want %v, got %v", tt.pkg, tt.err, err)
continue
}
deleteTasks(got)

if !reflect.DeepEqual(tt.action, got) {
t.Errorf("BuildAction(%v): want %#v, got %#v", tt.pkg, tt.action, got)
t.Errorf("BuildAction(%v): want %#+v, got %#+v", tt.pkg, tt.action, got)
}

// double underpants
14 changes: 14 additions & 0 deletions bin/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

rm -f coverage.txt

for d in $(go list github.com/constabulary/gb/...); do
go test -coverprofile=profile.out -covermode=atomic $d

if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
Loading