about summary refs log tree commit diff
path: root/external/main.go
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-13T15·15+0000
committerVincent Ambo <tazjin@google.com>2019-12-13T15·15+0000
commit859c429b2fbf21e3ea799b1068daa6f123c59a48 (patch)
tree1425b71b0e6255638dd1e78b7759b478258e1e57 /external/main.go
parentcfae527cc14c55f2cfa3d356674971c627ad1a88 (diff)
feat(external): Include *.s (ASM) files in external builds
Diffstat (limited to 'external/main.go')
-rw-r--r--external/main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/external/main.go b/external/main.go
index d73f1540a986..aa4a813d32bd 100644
--- a/external/main.go
+++ b/external/main.go
@@ -32,6 +32,7 @@ type pkg struct {
 	Name        string     `json:"name"`
 	Locator     []string   `json:"locator"`
 	Files       []string   `json:"files"`
+	SFiles      []string   `json:"sfiles"`
 	LocalDeps   [][]string `json:"localDeps"`
 	ForeignDeps []string   `json:"foreignDeps"`
 	IsCommand   bool       `json:"isCommand"`
@@ -75,6 +76,7 @@ func findGoDirs(at string) ([]string, error) {
 // generate a derivation for this package.
 func analysePackage(root, source, importpath string, stdlib map[string]bool) (pkg, error) {
 	ctx := build.Default
+	ctx.CgoEnabled = false
 
 	p, err := ctx.ImportDir(source, build.IgnoreVendor)
 	if err != nil {
@@ -114,10 +116,16 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
 		files = append(files, path.Join(prefix, f))
 	}
 
+	sfiles := []string{}
+	for _, f := range p.SFiles {
+		sfiles = append(sfiles, path.Join(prefix, f))
+	}
+
 	return pkg{
 		Name:        path.Join(importpath, prefix),
 		Locator:     locator,
 		Files:       files,
+		SFiles:      sfiles,
 		LocalDeps:   local,
 		ForeignDeps: foreign,
 		IsCommand:   p.IsCommand(),