attempt to fix build

This commit is contained in:
root
2018-03-15 11:15:37 +00:00
parent 9b9bbf4ed1
commit a38a3fabe1
4 changed files with 28 additions and 53 deletions

View File

@@ -43,6 +43,8 @@ endif
# Add the GO binary dir in the PATH # Add the GO binary dir in the PATH
export PATH := $(GOPATH)/bin:$(PATH) export PATH := $(GOPATH)/bin:$(PATH)
GOENV=GOPATH=$(GOPATH) CGO_CFLAGS_ALLOW='-w'
# --- MAKE TARGETS --- # --- MAKE TARGETS ---
# Display general help about this command # Display general help about this command
@@ -81,9 +83,8 @@ all: help
# Run the unit tests # Run the unit tests
test: test:
@mkdir -p target/test @mkdir -p target/test
GOPATH=$(GOPATH) \ $(GOENV) go test -covermode=atomic -bench=. -race -v . | \
go test -covermode=atomic -bench=. -race -v . | \ tee >($(GOENV) go-junit-report > target/test/report.xml); \
tee >(PATH=$(GOPATH)/bin:$(PATH) go-junit-report > target/test/report.xml); \
test $${PIPESTATUS[0]} -eq 0 test $${PIPESTATUS[0]} -eq 0
# Format the source code # Format the source code
@@ -98,44 +99,42 @@ fmtcheck:
# Check for syntax errors # Check for syntax errors
vet: vet:
GOPATH=$(GOPATH) go vet . $(GOENV) go vet .
# Check for style errors # Check for style errors
lint: lint:
GOPATH=$(GOPATH) PATH=$(GOPATH)/bin:$(PATH) golint . $(GOENV) golint .
# Generate the coverage report # Generate the coverage report
coverage: coverage:
@mkdir -p target/report @mkdir -p target/report
GOPATH=$(GOPATH) \ $(GOENV) go test -covermode=count -coverprofile=target/report/coverage.out -v . && \
go test -covermode=count -coverprofile=target/report/coverage.out -v . && \ $(GOENV) go tool cover -html=target/report/coverage.out -o target/report/coverage.html
GOPATH=$(GOPATH) \
go tool cover -html=target/report/coverage.out -o target/report/coverage.html
# Report cyclomatic complexity # Report cyclomatic complexity
cyclo: cyclo:
@mkdir -p target/report @mkdir -p target/report
GOPATH=$(GOPATH) gocyclo -avg . | tee target/report/cyclo.txt ; test $${PIPESTATUS[0]} -eq 0 $(GOENV) gocyclo -avg . | tee target/report/cyclo.txt ; test $${PIPESTATUS[0]} -eq 0
# Detect ineffectual assignments # Detect ineffectual assignments
ineffassign: ineffassign:
@mkdir -p target/report @mkdir -p target/report
GOPATH=$(GOPATH) ineffassign . | tee target/report/ineffassign.txt ; test $${PIPESTATUS[0]} -eq 0 $(GOENV) ineffassign . | tee target/report/ineffassign.txt ; test $${PIPESTATUS[0]} -eq 0
# Detect commonly misspelled words in source files # Detect commonly misspelled words in source files
misspell: misspell:
@mkdir -p target/report @mkdir -p target/report
GOPATH=$(GOPATH) misspell -error . | tee target/report/misspell.txt ; test $${PIPESTATUS[0]} -eq 0 $(GOENV) misspell -error . | tee target/report/misspell.txt ; test $${PIPESTATUS[0]} -eq 0
# AST scanner # AST scanner
astscan: astscan:
@mkdir -p target/report @mkdir -p target/report
GOPATH=$(GOPATH) gas ./*.go | tee target/report/astscan.txt ; test $${PIPESTATUS[0]} -eq 0 $(GOENV) gas ./... | tee target/report/astscan.txt ; test $${PIPESTATUS[0]} -eq 0
# Generate source docs # Generate source docs
docs: docs:
@mkdir -p target/docs @mkdir -p target/docs
nohup sh -c 'GOPATH=$(GOPATH) godoc -http=127.0.0.1:6060' > target/godoc_server.log 2>&1 & nohup sh -c '$(GOENV) godoc -http=127.0.0.1:6060' > target/godoc_server.log 2>&1 &
wget --directory-prefix=target/docs/ --execute robots=off --retry-connrefused --recursive --no-parent --adjust-extension --page-requisites --convert-links http://127.0.0.1:6060/pkg/github.com/${VENDOR}/${PROJECT}/ ; kill -9 `lsof -ti :6060` wget --directory-prefix=target/docs/ --execute robots=off --retry-connrefused --recursive --no-parent --adjust-extension --page-requisites --convert-links http://127.0.0.1:6060/pkg/github.com/${VENDOR}/${PROJECT}/ ; kill -9 `lsof -ti :6060`
@echo '<html><head><meta http-equiv="refresh" content="0;./127.0.0.1:6060/pkg/'${CVSPATH}'/'${PROJECT}'/index.html"/></head><a href="./127.0.0.1:6060/pkg/'${CVSPATH}'/'${PROJECT}'/index.html">'${PKGNAME}' Documentation ...</a></html>' > target/docs/index.html @echo '<html><head><meta http-equiv="refresh" content="0;./127.0.0.1:6060/pkg/'${CVSPATH}'/'${PROJECT}'/index.html"/></head><a href="./127.0.0.1:6060/pkg/'${CVSPATH}'/'${PROJECT}'/index.html">'${PKGNAME}' Documentation ...</a></html>' > target/docs/index.html
@@ -146,25 +145,25 @@ qa: fmtcheck test vet lint coverage cyclo ineffassign misspell astscan
# Get the dependencies # Get the dependencies
deps: deps:
GOPATH=$(GOPATH) go get $(go list ./... | grep -v /vendor/) $(GOENV) go get $(go list ./... | grep -v /vendor/)
GOPATH=$(GOPATH) go get github.com/inconshreveable/mousetrap $(GOENV) go get github.com/inconshreveable/mousetrap
GOPATH=$(GOPATH) go get github.com/golang/lint/golint $(GOENV) go get github.com/golang/lint/golint
GOPATH=$(GOPATH) go get github.com/jstemmer/go-junit-report $(GOENV) go get github.com/jstemmer/go-junit-report
GOPATH=$(GOPATH) go get github.com/axw/gocov/gocov $(GOENV) go get github.com/axw/gocov/gocov
GOPATH=$(GOPATH) go get github.com/fzipp/gocyclo $(GOENV) go get github.com/fzipp/gocyclo
GOPATH=$(GOPATH) go get github.com/gordonklaus/ineffassign $(GOENV) go get github.com/gordonklaus/ineffassign
GOPATH=$(GOPATH) go get github.com/client9/misspell/cmd/misspell $(GOENV) go get github.com/client9/misspell/cmd/misspell
GOPATH=$(GOPATH) go get github.com/HewlettPackard/gas $(GOENV) go get github.com/HewlettPackard/gas/cmd/gas
GOPATH=$(GOPATH) go get gopkg.in/check.v1 $(GOENV) go get gopkg.in/check.v1
# Remove any build artifact # Remove any build artifact
clean: clean:
GOPATH=$(GOPATH) go clean ./... $(GOENV) go clean ./...
# Deletes any intermediate file # Deletes any intermediate file
nuke: nuke:
rm -rf ./target rm -rf ./target
GOPATH=$(GOPATH) go clean -i ./... $(GOENV) go clean -i ./...
# Full build and test sequence # Full build and test sequence
buildall: deps qa buildall: deps qa

View File

@@ -1,18 +1,13 @@
// +build static
package xmlsec package xmlsec
// #cgo pkg-config: xmlsec1 libxml-2.0
// #cgo linux CFLAGS: -w // #cgo linux CFLAGS: -w
// #cgo darwin CFLAGS: -Wno-invalid-pp-token -Wno-header-guard // #cgo linux LDFLAGS: -lxml2 -lm
// #cgo pkg-config: xmlsec1
// #include <xmlsec/xmlsec.h> // #include <xmlsec/xmlsec.h>
// #include <xmlsec/xmltree.h> // #include <xmlsec/xmltree.h>
// #include <xmlsec/xmlenc.h> // #include <xmlsec/xmlenc.h>
// #include <xmlsec/templates.h> // #include <xmlsec/templates.h>
// #include <xmlsec/crypto.h> // #include <xmlsec/crypto.h>
import "C"
// #cgo pkg-config: libxml-2.0
// #include <libxml/parser.h> // #include <libxml/parser.h>
// #include <libxml/parserInternals.h> // #include <libxml/parserInternals.h>
// #include <libxml/xmlmemory.h> // #include <libxml/xmlmemory.h>

View File

@@ -1,19 +0,0 @@
// +build !static
package xmlsec
// #cgo linux CFLAGS: -w
// #cgo darwin CFLAGS: -Wno-invalid-pp-token -Wno-header-guard
// #cgo pkg-config: xmlsec1
// #include <xmlsec/xmlsec.h>
// #include <xmlsec/xmltree.h>
// #include <xmlsec/xmlenc.h>
// #include <xmlsec/templates.h>
// #include <xmlsec/crypto.h>
import "C"
// #cgo pkg-config: libxml-2.0
// #include <libxml/parser.h>
// #include <libxml/parserInternals.h>
// #include <libxml/xmlmemory.h>
import "C"

View File

@@ -42,7 +42,7 @@ func main() {
fmt.Printf("%s\n", err) fmt.Printf("%s\n", err)
os.Exit(1) os.Exit(1)
} }
os.Stdout.Write(signedBuf) os.Stdout.Write(signedBuf) //#nosec
} }
if *doVerify { if *doVerify {