Skip to content

Commit

Permalink
cleaning up all packr related code
Browse files Browse the repository at this point in the history
- fix ci tasks so it will build this without packr
- remove packr from our dockerfile
- fix our build scripts for local building
- clean up packr related go mods
- add documentation of our decisions of the move from packr to embed
  • Loading branch information
ramonskie authored and rkoster committed Mar 14, 2023
1 parent 1333c80 commit e9a366a
Show file tree
Hide file tree
Showing 442 changed files with 41 additions and 63,097 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ _obj
_test
.idea
ignored
.direnv
terraform-binaries

# Architecture specific extensions/prefixes
*.[568vq]
Expand Down
3 changes: 0 additions & 3 deletions ci/dockerfiles/deployment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,5 @@ RUN pip install -U awscli
# Install ginkgo
RUN go get -u github.com/onsi/ginkgo/ginkgo

# Install packr2
RUN go get -u github.com/gobuffalo/packr/v2/packr2

RUN chown -R testuser:testuser /usr/local/go/pkg
RUN chown -R testuser:testuser /go
4 changes: 1 addition & 3 deletions ci/tasks/build-release/task
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ function build_bbl() {

echo "Building amd64 for $2"
CGO_ENABLED=0 GOARCH="amd64" GOOS="$2" \
packr2 build \
go build \
-ldflags "-X main.Version=${BBL_VERSION}" \
-o "${build_path}" .

packr2 clean
}

function determine_build_path() {
Expand Down
29 changes: 29 additions & 0 deletions docs/architecture/decisions/0003-replace-packr2-with-go-embed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 2. Replace packr2 wiht go embed

Date: 21-02-2023

## Status

Inprogress

## Context

The issue motivating this decision, and any context that influences or constrains the decision.

The original author packr has discontinued the work on packr
and archived the repo https://github.com/gobuffalo/packr/ since Jun 25 2022
and as of go 1.16 `go:embed` was introduced see https://pkg.go.dev/embed

which is native file embedding feature of Go, or github.com/markbates/pkger.
It has an idiomatic API, minimal dependencies,
a stronger test suite (tested directly against the std lib counterparts),
transparent tooling, and more.


## Decision

Use [embed](https://pkg.go.dev/embed) instead.

## Consequences

- getting rid of an external tool packr2
28 changes: 3 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ require (
github.com/cloudfoundry/multierror v0.0.0-20170123201326-dafed03eebc6
github.com/coreos/go-semver v0.2.0
github.com/genevieve/leftovers v0.55.1-0.20190805182303-e86fd74c0714
github.com/gobuffalo/packd v0.0.0-20181212173646-eca3b8fd6687
github.com/gobuffalo/packr/v2 v2.0.1
github.com/jessevdk/go-flags v1.4.0
github.com/kr/pty v1.1.3
github.com/lytics/cloudstorage v0.0.0-20180517181525-27319609bc1c
Expand All @@ -32,58 +30,38 @@ require (
require (
cloud.google.com/go v0.36.0 // indirect
code.cloudfoundry.org/multierror v0.0.0-20170123201326-dafed03eebc6 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Pallinder/go-randomdata v1.2.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/go-ini/ini v1.37.0 // indirect
github.com/gobuffalo/buffalo-plugins v1.13.0 // indirect
github.com/gobuffalo/envy v1.6.15 // indirect
github.com/gobuffalo/events v1.2.0 // indirect
github.com/gobuffalo/flect v0.1.0 // indirect
github.com/gobuffalo/genny v0.0.0-20190219203444-c95082806342 // indirect
github.com/gobuffalo/gogen v0.0.0-20190219194924-d32a17ad9761 // indirect
github.com/gobuffalo/logger v0.0.0-20181127160119-5b956e21995c // indirect
github.com/gobuffalo/mapi v1.0.1 // indirect
github.com/gobuffalo/meta v0.0.0-20190207205153-50a99e08b8cf // indirect
github.com/gobuffalo/syncx v0.0.0-20181120194010-558ac7de985f // indirect
github.com/golang/protobuf v1.2.0 // indirect
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
github.com/googleapis/gax-go/v2 v2.0.3 // indirect
github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357 // indirect
github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0 // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 // indirect
github.com/joho/godotenv v1.3.0 // indirect
github.com/karrick/godirwalk v1.7.8 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 // indirect
github.com/markbates/safe v1.0.1 // indirect
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mitchellh/go-homedir v1.0.0 // indirect
github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae // indirect
github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c // indirect
github.com/pierrec/lz4 v2.0.3+incompatible // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/rogpeppe/go-internal v1.2.2 // indirect
github.com/sirupsen/logrus v1.3.0 // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/spf13/cobra v0.0.3 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.3.0 // indirect
github.com/ulikunitz/xz v0.5.4 // indirect
github.com/vmware/govmomi v0.18.0 // indirect
go.opencensus.io v0.18.0 // indirect
golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a // indirect
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 // indirect
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 // indirect
google.golang.org/appengine v1.4.0 // indirect
google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922 // indirect
google.golang.org/grpc v1.17.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/ini.v1 v1.51.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
Loading

0 comments on commit e9a366a

Please sign in to comment.