Closed
Description
Can we cross compile a Mac build of our binary which uses go_ibm_db on a Linux machine?
When running with CGO_ENABLED=1:
+ CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o agent-linux .
+ CGO_ENABLED=1 GOOS=windows go build -a -installsuffix cgo -o agent-windows .
+ CGO_ENABLED=1 GOOS=darwin go build -a -installsuffix cgo -o agent-darwin .
# net
../../tools/org.jenkinsci.plugins.golang.GolangInstallation/1.13/src/net/cgo_bsd.go:15:72: could not determine kind of name for C.AI_MASK
# os/user
../../tools/org.jenkinsci.plugins.golang.GolangInstallation/1.13/src/os/user/getgrouplist_darwin.go: In function ‘mygetgrouplist’:
../../tools/org.jenkinsci.plugins.golang.GolangInstallation/1.13/src/os/user/getgrouplist_darwin.go:16:11: warning: implicit declaration of function ‘getgrouplist’ [-Wimplicit-function-declaration]
int rv = getgrouplist(user, (int) group, buf, ngroups);
Is it possible to cross-compile the package without building the driver into the binary? And allow the appropriate driver to be present at runtime ?
We are importing and using the driver like this:
import (
"database/sql"
_ "github.com/ibmdb/go_ibm_db"
)
db, err := sql.Open("go_ibm_db", con)
We would like to use a single Linux environment to build all binaries for Windows, Mac, and Linux.
Metadata
Metadata
Assignees
Labels
No labels