From c323c1364747e70f6b6665e9a59619d2bb07fa1c Mon Sep 17 00:00:00 2001 From: "Juan A. Garcia Pardo" Date: Thu, 18 Jul 2024 15:35:19 +0200 Subject: [PATCH] Use mattn's sqlite as default. --- .bazelrc | 6 +++--- private/storage/db/BUILD.bazel | 4 ++-- private/storage/db/sqlite_mattn.go | 11 ++++++++++- private/storage/db/sqlite_modernc.go | 9 +-------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.bazelrc b/.bazelrc index ae43f2c0dd..7a38c8efd6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,5 @@ ### common options for all subcommands (help, query, build, ...) -common --show_timestamps --enable_platform_specific_config +common --define gotags=sqlite_mattn --show_timestamps --enable_platform_specific_config # connect to buchgr/bazel-remote cache # These flags can unfortunately not be specified for `common`, as they are not accepted by all subcommands (help, version, dump) @@ -21,8 +21,8 @@ build --flag_alias=file_name_version=//:file_name_version # include one of "--define gotags=sqlite_mattn" or "--define gotags=sqlite_modernc" # cannot be in common, because query chokes on it. -build --define gotags=sqlite_modernc,netgo -build:osx --define gotags=sqlite_modernc +build --define gotags=sqlite_mattn,netgo +build:osx --define sqlite_mattn ### options for test test --build_tests_only --print_relative_test_log_paths --test_output=errors diff --git a/private/storage/db/BUILD.bazel b/private/storage/db/BUILD.bazel index 9ed6145d99..2ea9da993e 100644 --- a/private/storage/db/BUILD.bazel +++ b/private/storage/db/BUILD.bazel @@ -9,7 +9,7 @@ go_library( "metrics.go", "sqler.go", "sqlite.go", - "sqlite_modernc.go", + "sqlite_mattn.go", ], importpath = "github.com/scionproto/scion/private/storage/db", visibility = ["//visibility:public"], @@ -17,7 +17,7 @@ go_library( "//pkg/private/common:go_default_library", "//pkg/private/prom:go_default_library", "//pkg/private/serrors:go_default_library", - "@org_modernc_sqlite//:go_default_library", + "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/db/sqlite_mattn.go b/private/storage/db/sqlite_mattn.go index 805a646096..c959e033a1 100644 --- a/private/storage/db/sqlite_mattn.go +++ b/private/storage/db/sqlite_mattn.go @@ -12,7 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build sqlite_mattn +//go:build sqlite_mattn || !sqlite_modernc + +// XXX(juagargi): This setting is different from upstream, where the default is modernc. + +// Note that above go:build expression makes mattn the default by matching +// the absence of sqlite_modernc. Should there be more alternatives, please +// update that expression to match their absence too. +// Also note that this default is overridden by a build configuration +// in .bazelrc, so this is only useful when building with "go build" and +// may not match the bazel build configuration. package db diff --git a/private/storage/db/sqlite_modernc.go b/private/storage/db/sqlite_modernc.go index 951985b23e..ba4ee8ac33 100644 --- a/private/storage/db/sqlite_modernc.go +++ b/private/storage/db/sqlite_modernc.go @@ -12,14 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build sqlite_modernc || !sqlite_mattn - -// Note that above go:build expression makes modernc the default by matching -// the absence of sqlite_mattn. Should there be more alternatives, please -// update that expression to match their absence too. -// Also note that this default is overridden by a build configuration -// in .bazelrc, so this is only useful when building with "go build" and -// may not match the bazel build configuration. +//go:build sqlite_modernc package db