Skip to content

Commit

Permalink
Work around inability to build Linux CGO on Mac
Browse files Browse the repository at this point in the history
The combination of CGO and GOOS=Linux breaks compilation on a Mac, which
has the result of breaking Vim's compilation error checking. We've
worked around this by adding a non-CGO implementation of our single
CGO package, which will be used when CGO_ENABLED=0. We're adding that
env var setting to our Vim alias in the garden-dotfiles repo.

[finishes #139469133]

Signed-off-by: Gareth Clay <[email protected]>
  • Loading branch information
MissingRoberto authored and spikymonkey committed Feb 23, 2017
1 parent d6daac8 commit fd48c94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux
// +build linux,cgo

// This code was copied from https://github.com/docker/docker/blob/v1.13.1/daemon/graphdriver/quota/projectquota.go
// License: Apache License
Expand Down
28 changes: 28 additions & 0 deletions store/filesystems/overlayxfs/quota/projectquota_nocgo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// +build linux,!cgo

// This file is a dummy structure to allow us to compile on a Mac with GOOS=linux

package quota

type Quota struct {
Size uint64
}

type Control struct {
}

func NewControl(basePath string) (*Control, error) {
return nil, nil
}

func (q *Control) SetQuota(targetPath string, quota Quota) error {
return nil
}

func (q *Control) GetQuota(targetPath string, quota *Quota) error {
return nil
}

func GetProjectID(targetPath string) (uint32, error) {
return 0, nil
}

0 comments on commit fd48c94

Please sign in to comment.