We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal sqlite.go
package main import ( "database/sql" "fmt" _ "github.com/mattn/go-sqlite3" ) func main() { fmt.Println("Started") db, err := sql.Open("sqlite3", ":memory:") if err != nil { fmt.Printf("Error: %v\n", err) } fmt.Println("Database opened successfully") err = db.Ping() if err != nil { fmt.Printf("Error: %v\n", err) } fmt.Println("Database ping successful") if _, err := db.Exec(`CREATE TABLE test ( id INTEGER PRIMARY KEY ); `); err != nil { fmt.Printf("Error: %v\n", err) } fmt.Println("Table created") fmt.Println("Done") }
BUILD.bazel
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "sqlite_lib", srcs = ["sqlite.go"], importpath = "gmbuell/project/sqlite", visibility = ["//visibility:private"], deps = ["@com_github_mattn_go_sqlite3//:go-sqlite3"], ) go_binary( name = "sqlite", embed = [":sqlite_lib"], visibility = ["//visibility:public"], )
Testing on linux:
bazel run :sqlite
gives the expected output:
Started Database opened successfully Database ping successful Table created Done
Building for windows:
BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 bazel build :sqlite --platforms=@zig_sdk//platform:windows_amd64 --extra_toolchains @zig_sdk//toolchain:windows_amd64
If I run the exe with wine, I get the expected output:
But actually running the exe on WIndows gives
PS Z:\> .\sqlite.exe Started Database opened successfully
With the program then exiting silently (presumably crashing somewhere?)
Any ideas? I would assume cross compiling sqlite3 would be a fairly common use case for this toolchain.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Minimal sqlite.go
BUILD.bazel
Testing on linux:
bazel run :sqlite
gives the expected output:
Building for windows:
BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 bazel build :sqlite --platforms=@zig_sdk//platform:windows_amd64 --extra_toolchains @zig_sdk//toolchain:windows_amd64
If I run the exe with wine, I get the expected output:
But actually running the exe on WIndows gives
With the program then exiting silently (presumably crashing somewhere?)
Any ideas? I would assume cross compiling sqlite3 would be a fairly common use case for this toolchain.
The text was updated successfully, but these errors were encountered: