From 7f0ff066848bab8da13a0406fb4bc920650d7d5c Mon Sep 17 00:00:00 2001 From: jiceatscion <139873336+jiceatscion@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:46:35 +0200 Subject: [PATCH] build: support fedora (#4371) 1 . Update the scripts in tools/ so the necessary packages are installed (in the right order). 2 . Bottleneck references the sqlite lib through a single source file so it's easy to use different implementations of that lib. 3 . Replace mattn_sqlite with modenrc_sqlite to remove dependency on a specific version of glibc (which breaks integration tests). Also did some minor makefile simplifications: no need to "make go-mod-tidy" and "make go_deps.blz" explicitly. It happens as needed upon "make gazelle". --- .bazelrc | 5 + .buildkite/pipeline.yml | 2 +- BUILD.bazel | 76 ++++++- Makefile | 25 ++- doc/dev/dependencies.rst | 7 +- doc/dev/setup.rst | 19 +- go.mod | 15 +- go.sum | 38 +++- go_deps.bzl | 202 +++++++++++++++++- .../LICENSE | 10 +- .../com_github_remyoudompheng_bigfft/LICENSE | 27 +++ licenses/data/org_modernc_libc/LICENSE | 27 +++ licenses/data/org_modernc_libc/LICENSE-GO | 27 +++ .../honnef.co/go/netdb/LICENSE | 20 ++ licenses/data/org_modernc_mathutil/LICENSE | 27 +++ .../org_modernc_mathutil/mersenne/LICENSE | 27 +++ licenses/data/org_modernc_memory/LICENSE | 27 +++ licenses/data/org_modernc_memory/LICENSE-GO | 27 +++ .../data/org_modernc_memory/LICENSE-MMAP-GO | 25 +++ licenses/data/org_modernc_sqlite/LICENSE | 26 +++ .../data/org_modernc_sqlite/SQLITE-LICENSE | 25 +++ nogo.json | 11 +- private/storage/beacon/sqlite/BUILD.bazel | 1 - private/storage/beacon/sqlite/db.go | 2 - private/storage/db/BUILD.bazel | 2 + private/storage/db/sqlite.go | 10 +- private/storage/db/sqlite_mattn.go | 41 ++++ private/storage/db/sqlite_modernc.go | 48 +++++ .../storage/drkey/level1/sqlite/BUILD.bazel | 1 - private/storage/drkey/level1/sqlite/db.go | 2 - .../storage/drkey/level2/sqlite/BUILD.bazel | 1 - private/storage/drkey/level2/sqlite/db.go | 2 - .../storage/drkey/secret/sqlite/BUILD.bazel | 1 - private/storage/drkey/secret/sqlite/db.go | 2 - private/storage/path/sqlite/BUILD.bazel | 1 - private/storage/path/sqlite/sqlite.go | 2 - private/storage/trust/sqlite/BUILD.bazel | 1 - private/storage/trust/sqlite/db.go | 2 - tools/dc | 2 +- tools/env/rhel/deps | 3 +- tools/env/rhel/pkgs.txt | 10 + tools/install_deps | 2 +- tools/update_testdata.sh | 6 +- 43 files changed, 776 insertions(+), 61 deletions(-) rename licenses/data/{com_github_mattn_go_sqlite3 => com_github_dustin_go_humanize}/LICENSE (84%) create mode 100644 licenses/data/com_github_remyoudompheng_bigfft/LICENSE create mode 100644 licenses/data/org_modernc_libc/LICENSE create mode 100644 licenses/data/org_modernc_libc/LICENSE-GO create mode 100644 licenses/data/org_modernc_libc/honnef.co/go/netdb/LICENSE create mode 100644 licenses/data/org_modernc_mathutil/LICENSE create mode 100644 licenses/data/org_modernc_mathutil/mersenne/LICENSE create mode 100644 licenses/data/org_modernc_memory/LICENSE create mode 100644 licenses/data/org_modernc_memory/LICENSE-GO create mode 100644 licenses/data/org_modernc_memory/LICENSE-MMAP-GO create mode 100644 licenses/data/org_modernc_sqlite/LICENSE create mode 100644 licenses/data/org_modernc_sqlite/SQLITE-LICENSE create mode 100644 private/storage/db/sqlite_mattn.go create mode 100644 private/storage/db/sqlite_modernc.go create mode 100644 tools/env/rhel/pkgs.txt diff --git a/.bazelrc b/.bazelrc index 610c9114f9..0b4fa25f90 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,6 @@ ### common options for all subcommands (help, query, build, ...) common --show_timestamps + # 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) build --remote_cache=grpc://localhost:9092 --experimental_remote_downloader=grpc://localhost:9092 @@ -14,6 +15,10 @@ build --java_runtime_version=remotejdk_11 # disable legacy_create_init for py_binary, py_test etc. This may eventually become the default. build --incompatible_default_to_explicit_init_py +# 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 + ### options for test test --build_tests_only --print_relative_test_log_paths --test_output=errors diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1979d9ce6f..aac4913f2f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -31,8 +31,8 @@ steps: - echo "--- go_deps.bzl" - mkdir -p /tmp/test-artifacts - cp go.mod go.sum go_deps.bzl /tmp/test-artifacts/ + - make go.mod - make go_deps.bzl -B - - make go-mod-tidy - diff -u /tmp/test-artifacts/go.mod go.mod - diff -u /tmp/test-artifacts/go.sum go.sum - diff -u /tmp/test-artifacts/go_deps.bzl go_deps.bzl diff --git a/BUILD.bazel b/BUILD.bazel index 6e8445b1dd..ba817ae8f8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -17,7 +17,81 @@ load("@cgrindel_bazel_starlib//updatesrc:defs.bzl", "updatesrc_update_all") # gazelle:exclude doc/** # gazelle:exclude rules_openapi/tools/node_modules/** # gazelle:exclude tools/lint/**/testdata/src/** -gazelle(name = "gazelle") + +# We suport two sqlite implementations: modernc and mattn. Each implementation +# has a corresponding sqlite_.go "driver" in private/storage/db. Which +# driver gets compiled and linked is controled by a go build tag: sqlite_mattn +# or sqlite_modernc. Those are specified on the command line +# with "--define gotags=sqlite_mattn" or "--define gotags=sqlite_modernc" +# (see the build options in .bazelrc). +# +# Unfortunately Gazelle needs to be given these tags explicitly via the builtags +# attribute. So, to ensure consistency we have to translate our two gotags into +# build_tags. To that end, we create two config_setting flags that are +# set in response to matching the gotags value and use them to select the relevant +# tag for gazelle. (The "define_value" attribute of config_setting doesn't define +# anything. It matches a key-value pair from "--define"). +# +# This is simplistic but the complete, by-the-everchanging-bazel-book, solution +# is ludicrously complicated. Go there if and when needed. +config_setting( + name = "sqlite_mattn", + define_values = { + "gotags": "sqlite_mattn", + }, +) + +config_setting( + name = "sqlite_modernc", + define_values = { + "gotags": "sqlite_modernc", + }, +) + +# This is a dummy target so Make can "blaze build --announce_rc +# Where something truly does nothing that we may care about. + +config_setting( + name = "dummy_setting", + define_values = { + "whatever": "whatever", + }, +) + +gazelle( + name = "gazelle", + build_tags = select({ + ":sqlite_modernc": ["sqlite_modernc"], + ":sqlite_mattn": ["sqlite_mattn"], + }), + command = "update", + extra_args = [ + "-mode", + "fix", + "-go_naming_convention", + "go_default_library", + ], +) + +gazelle( + name = "gazelle_diff", + build_tags = select({ + ":sqlite_modernc": ["sqlite_modernc"], + ":sqlite_mattn": ["sqlite_mattn"], + }), + command = "update", + extra_args = [ + "-mode", + "diff", + "-go_naming_convention", + "go_default_library", + ], +) + +gazelle( + name = "gazelle_update_repos", + command = "update-repos", +) go_lint_config( name = "go_lint_config", diff --git a/Makefile b/Makefile index 2f91861106..ed34b003ed 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,4 @@ -.PHONY: all antlr bazel clean docker-images gazelle go-mod-tidy licenses mocks protobuf scion-topo test test-integration write_all_source_files -GAZELLE_MODE?=fix -GAZELLE_DIRS=. +.PHONY: all antlr bazel clean docker-images gazelle go.mod licenses mocks protobuf scion-topo test test-integration write_all_source_files build: bazel @@ -10,7 +8,7 @@ build: bazel # Use NOTPARALLEL to force correct order. # Note: From GNU make 4.4, this still allows building any other targets (e.g. lint) in parallel. .NOTPARALLEL: all -all: go_deps.bzl protobuf mocks gazelle licenses build antlr write_all_source_files +all: go_deps.bzl protobuf mocks gazelle build antlr write_all_source_files licenses clean: bazel clean @@ -28,12 +26,17 @@ test: test-integration: bazel test --config=integration_all -go-mod-tidy: +go.mod: bazel run --config=quiet @go_sdk//:bin/go -- mod tidy go_deps.bzl: go.mod +<<<<<<< HEAD @# gazelle is run with "-args"; so our arguments are added to those from the gazelle() rule. bazel run --config=quiet //:gazelle -- update-repos -prune -from_file=go.mod -to_macro=go_deps.bzl%go_deps +======= + @# gazelle is run with "-args"; so our arguments are added to those from the gazelle() rule. + bazel run --verbose_failures --config=quiet //:gazelle_update_repos -- -args -prune -from_file=go.mod -to_macro=go_deps.bzl%go_deps +>>>>>>> 4096d879b (build: support fedora (#4371)) @# XXX(matzf): clean up; gazelle update-repose inconsistently inserts blank lines (see bazelbuild/bazel-gazelle#1088). @sed -e '/def go_deps/,$${/^$$/d}' -i go_deps.bzl @@ -58,14 +61,14 @@ protobuf: mocks: tools/gomocks.py -gazelle: - bazel run //:gazelle --config=quiet -- update -mode=$(GAZELLE_MODE) -go_naming_convention go_default_library $(GAZELLE_DIRS) +gazelle: go_deps.bzl + bazel run //:gazelle --verbose_failures --config=quiet licenses: tools/licenses.sh antlr: - antlr/generate.sh $(GAZELLE_MODE) + antlr/generate.sh fix write_all_source_files: bazel run //:write_all_source_files @@ -84,16 +87,18 @@ lint-go: lint-go-gazelle lint-go-bazel lint-go-golangci lint-go-semgrep lint-go-gazelle: $(info ==> $@) - @$(MAKE) -s gazelle GAZELLE_MODE=diff + bazel run //:gazelle_diff --verbose_failures --config=quiet lint-go-bazel: $(info ==> $@) @tools/quiet bazel test --config lint +GO_BUILD_TAGS_ARG=$(shell bazel build --ui_event_filters=-stdout,-stderr --announce_rc --noshow_progress :dummy_setting 2>&1 | grep "'build' options" | sed -n "s/^.*--define gotags=\(\S*\).*/--build-tags \1/p" ) + lint-go-golangci: $(info ==> $@) @if [ -t 1 ]; then tty=true; else tty=false; fi; \ - tools/quiet docker run --tty=$$tty --rm -v golangci-lint-modcache:/go -v golangci-lint-buildcache:/root/.cache -v "${PWD}:/src" -w /src golangci/golangci-lint:v1.54.2 golangci-lint run --config=/src/.golangcilint.yml --timeout=3m --skip-dirs doc ./... + tools/quiet docker run --tty=$$tty --rm -v golangci-lint-modcache:/go -v golangci-lint-buildcache:/root/.cache -v "${PWD}:/src" -w /src golangci/golangci-lint:v1.50.0 golangci-lint run --config=/src/.golangcilint.yml --timeout=3m $(GO_BUILD_TAGS_ARG) --skip-dirs doc ./... lint-go-semgrep: $(info ==> $@) diff --git a/doc/dev/dependencies.rst b/doc/dev/dependencies.rst index 9f236cd13c..2ccb8fbd45 100644 --- a/doc/dev/dependencies.rst +++ b/doc/dev/dependencies.rst @@ -22,10 +22,9 @@ Workflow to modify dependencies To add/remove or update dependencies: 1. Modify ``go.mod``, manually or using e.g. ``go get``. -2. ``make go-mod-tidy`` -3. ``make go_deps.bzl`` -4. ``make licenses``, to update the licenses with the new dependency -5. ``make gazelle``, to update the build files that depend on the newly added dependency +2. ``make go_deps.bzl`` +3. ``make licenses``, to update the licenses with the new dependency +4. ``make gazelle``, to update the build files that depend on the newly added dependency .. Warning:: The Go rules for Bazel (rules_go) declares some internally used dependencies. diff --git a/doc/dev/setup.rst b/doc/dev/setup.rst index e1a87a1268..53040cec4b 100644 --- a/doc/dev/setup.rst +++ b/doc/dev/setup.rst @@ -9,9 +9,9 @@ Prerequisites #. Make sure that you are using a clean and recently updated linux distribution. Distributions that are known to work are: - * **Ubuntu** release 18.04 or later. - * **Fedora** release 38 or later. - * **Amazon** Linux 2. + - **Ubuntu** release 18.04 or later. + - **Fedora** release 38 or later. + - **Amazon** Linux 2. Other Linux environments will usually be fine too, but some of the tooling might need tweaking. If you make things work for other distributions, please update this list. @@ -109,11 +109,22 @@ rejecting your changes. #. Install go. Either follow `the official instructions `_ or check the `Ubuntu specific installation options on the golang wiki `_. +#. Decide which implementation of sqlite you want to use: + + - `mattn`: A cgo implementation. It is well established but makes go + executables dependent on a minimum glibc version. + - `modernc`: A pure go implementation. It does not cause glibc version + issues but is less common. modernc is currently recommended due to + the glibc issue. + #. Build SCION services and tools. .. code-block:: bash - go build -o bin .//cmd/... + go build -o -tags sqlite_ bin .//cmd/... + + where is one of `modernc` or `mattn`. + Tips and Tricks --------------- diff --git a/go.mod b/go.mod index 3959996751..e724146976 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/iancoleman/strcase v0.2.0 github.com/lestrrat-go/jwx v1.2.25 github.com/mattn/go-isatty v0.0.17 - github.com/mattn/go-sqlite3 v1.14.16 + github.com/mattn/go-sqlite3 v1.14.17 github.com/olekukonko/tablewriter v0.0.5 github.com/opentracing/opentracing-go v1.2.0 github.com/patrickmn/go-cache v2.1.1-0.20180815053127-5633e0862627+incompatible @@ -51,6 +51,7 @@ require ( // Necessary so @org_golang_google_genproto is included in the go_deps.bzl. google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 + modernc.org/sqlite v1.24.0 ) require ( @@ -63,6 +64,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/swag v0.21.1 // indirect @@ -77,6 +79,7 @@ require ( github.com/invopop/yaml v0.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/jtolds/gls v4.20.0+incompatible // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.0 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect @@ -97,6 +100,7 @@ require ( github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/quic-go/qtls-go1-20 v0.3.3 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/smartystreets/assertions v1.2.0 // indirect github.com/spf13/afero v1.9.3 // indirect @@ -114,6 +118,15 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.22.5 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect ) go 1.18 diff --git a/go.sum b/go.sum index bbb2a2565f..d5eec69270 100644 --- a/go.sum +++ b/go.sum @@ -95,6 +95,8 @@ github.com/docker/cli v20.10.20+incompatible h1:lWQbHSHUFs7KraSN2jOJK7zbMS2jNCHI github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/docker v20.10.20+incompatible h1:kH9tx6XO+359d+iAkumyKDc5Q1kOwPuAUaeri48nD6E= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -206,7 +208,10 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +<<<<<<< HEAD github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +======= +>>>>>>> 4096d879b (build: support fedora (#4371)) github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -251,6 +256,8 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= @@ -290,8 +297,8 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -362,6 +369,9 @@ github.com/quic-go/qtls-go1-20 v0.3.3 h1:17/glZSLI9P9fDAeyCHBFSWSqJcwx1byhLwP5eU github.com/quic-go/qtls-go1-20 v0.3.3/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/quic-go/quic-go v0.38.1 h1:M36YWA5dEhEeT+slOu/SwMEucbYd0YFidxG3KlGPZaE= github.com/quic-go/quic-go v0.38.1/go.mod h1:ijnZM7JsFIkp4cRyjxJNIzdSfCLmUMg9wdyhGmg+SN4= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -812,6 +822,30 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= +modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= +modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.24.0 h1:EsClRIWHGhLTCX44p+Ri/JLD+vFGo0QGjasg2/F9TlI= +modernc.org/sqlite v1.24.0/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/go_deps.bzl b/go_deps.bzl index efefb9c391..d5677f6abc 100644 --- a/go_deps.bzl +++ b/go_deps.bzl @@ -247,6 +247,12 @@ def go_deps(): sum = "h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=", version = "v0.5.0", ) + go_repository( + name = "com_github_dustin_go_humanize", + importpath = "github.com/dustin/go-humanize", + sum = "h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=", + version = "v1.0.1", + ) go_repository( name = "com_github_dvyukov_go_fuzz", importpath = "github.com/dvyukov/go-fuzz", @@ -679,6 +685,12 @@ def go_deps(): sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", version = "v1.3.0", ) + go_repository( + name = "com_github_kballard_go_shellquote", + importpath = "github.com/kballard/go-shellquote", + sum = "h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=", + version = "v0.0.0-20180428030007-95032a82bc51", + ) go_repository( name = "com_github_kisielk_errcheck", importpath = "github.com/kisielk/errcheck", @@ -697,6 +709,12 @@ def go_deps(): sum = "h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c=", version = "v1.15.11", ) + go_repository( + name = "com_github_klauspost_cpuid_v2", + importpath = "github.com/klauspost/cpuid/v2", + sum = "h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU=", + version = "v2.2.3", + ) go_repository( name = "com_github_konsorten_go_windows_terminal_sequences", importpath = "github.com/konsorten/go-windows-terminal-sequences", @@ -826,8 +844,8 @@ def go_deps(): go_repository( name = "com_github_mattn_go_sqlite3", importpath = "github.com/mattn/go-sqlite3", - sum = "h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=", - version = "v1.14.16", + sum = "h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM=", + version = "v1.14.17", ) go_repository( name = "com_github_matttproud_golang_protobuf_extensions", @@ -1021,6 +1039,12 @@ def go_deps(): sum = "h1:t527LHHE3HmiHrq74QMpNPZpGCIJzTx+apLkMKt4HC0=", version = "v1.0.0", ) + go_repository( + name = "com_github_remyoudompheng_bigfft", + importpath = "github.com/remyoudompheng/bigfft", + sum = "h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=", + version = "v0.0.0-20230129092748-24d4a6f8daec", + ) go_repository( name = "com_github_rogpeppe_go_internal", importpath = "github.com/rogpeppe/go-internal", @@ -1243,6 +1267,102 @@ def go_deps(): sum = "h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU=", version = "v1.14.0", ) + go_repository( + name = "com_google_cloud_go_storagetransfer", + importpath = "cloud.google.com/go/storagetransfer", + sum = "h1:fUe3OydbbvHcAYp07xY+2UpH4AermGbmnm7qdEj3tGE=", + version = "v1.6.0", + ) + go_repository( + name = "com_google_cloud_go_talent", + importpath = "cloud.google.com/go/talent", + sum = "h1:MrekAGxLqAeAol4Sc0allOVqUGO8j+Iim8NMvpiD7tM=", + version = "v1.4.0", + ) + go_repository( + name = "com_google_cloud_go_texttospeech", + importpath = "cloud.google.com/go/texttospeech", + sum = "h1:ccPiHgTewxgyAeCWgQWvZvrLmbfQSFABTMAfrSPLPyY=", + version = "v1.5.0", + ) + go_repository( + name = "com_google_cloud_go_tpu", + importpath = "cloud.google.com/go/tpu", + sum = "h1:ztIdKoma1Xob2qm6QwNh4Xi9/e7N3IfvtwG5AcNsj1g=", + version = "v1.4.0", + ) + go_repository( + name = "com_google_cloud_go_trace", + importpath = "cloud.google.com/go/trace", + sum = "h1:qO9eLn2esajC9sxpqp1YKX37nXC3L4BfGnPS0Cx9dYo=", + version = "v1.4.0", + ) + go_repository( + name = "com_google_cloud_go_translate", + importpath = "cloud.google.com/go/translate", + sum = "h1:AOYOH3MspzJ/bH1YXzB+xTE8fMpn3mwhLjugwGXvMPI=", + version = "v1.4.0", + ) + go_repository( + name = "com_google_cloud_go_video", + importpath = "cloud.google.com/go/video", + sum = "h1:ttlvO4J5c1VGq6FkHqWPD/aH6PfdxujHt+muTJlW1Zk=", + version = "v1.9.0", + ) + go_repository( + name = "com_google_cloud_go_videointelligence", + importpath = "cloud.google.com/go/videointelligence", + sum = "h1:RPFgVVXbI2b5vnrciZjtsUgpNKVtHO/WIyXUhEfuMhA=", + version = "v1.9.0", + ) + go_repository( + name = "com_google_cloud_go_vision_v2", + importpath = "cloud.google.com/go/vision/v2", + sum = "h1:TQHxRqvLMi19azwm3qYuDbEzZWmiKJNTpGbkNsfRCik=", + version = "v2.5.0", + ) + go_repository( + name = "com_google_cloud_go_vmmigration", + importpath = "cloud.google.com/go/vmmigration", + sum = "h1:A2Tl2ZmwMRpvEmhV2ibISY85fmQR+Y5w9a0PlRz5P3s=", + version = "v1.3.0", + ) + go_repository( + name = "com_google_cloud_go_vmwareengine", + importpath = "cloud.google.com/go/vmwareengine", + sum = "h1:JMPZaOT/gIUxVlTqSl/QQ32Y2k+r0stNeM1NSqhVP9o=", + version = "v0.1.0", + ) + go_repository( + name = "com_google_cloud_go_vpcaccess", + importpath = "cloud.google.com/go/vpcaccess", + sum = "h1:woHXXtnW8b9gLFdWO9HLPalAddBQ9V4LT+1vjKwR3W8=", + version = "v1.5.0", + ) + go_repository( + name = "com_google_cloud_go_webrisk", + importpath = "cloud.google.com/go/webrisk", + sum = "h1:ypSnpGlJnZSXbN9a13PDmAYvVekBLnGKxQ3Q9SMwnYY=", + version = "v1.7.0", + ) + go_repository( + name = "com_google_cloud_go_websecurityscanner", + importpath = "cloud.google.com/go/websecurityscanner", + sum = "h1:y7yIFg/h/mO+5Y5aCOtVAnpGUOgqCH5rXQ2Oc8Oq2+g=", + version = "v1.4.0", + ) + go_repository( + name = "com_google_cloud_go_workflows", + importpath = "cloud.google.com/go/workflows", + sum = "h1:7Chpin9p50NTU8Tb7qk+I11U/IwVXmDhEoSsdccvInE=", + version = "v1.9.0", + ) + go_repository( + name = "com_lukechampine_uint128", + importpath = "lukechampine.com/uint128", + sum = "h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=", + version = "v1.2.0", + ) go_repository( name = "com_shuralyov_dmitri_gpu_mtl", importpath = "dmitri.shuralyov.com/gpu/mtl", @@ -1491,6 +1611,84 @@ def go_deps(): sum = "h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=", version = "v0.0.0-20220907171357-04be3eba64a2", ) + go_repository( + name = "org_modernc_cc_v3", + importpath = "modernc.org/cc/v3", + sum = "h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw=", + version = "v3.40.0", + ) + go_repository( + name = "org_modernc_ccgo_v3", + importpath = "modernc.org/ccgo/v3", + sum = "h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw=", + version = "v3.16.13", + ) + go_repository( + name = "org_modernc_ccorpus", + importpath = "modernc.org/ccorpus", + sum = "h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=", + version = "v1.11.6", + ) + go_repository( + name = "org_modernc_httpfs", + importpath = "modernc.org/httpfs", + sum = "h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=", + version = "v1.0.6", + ) + go_repository( + name = "org_modernc_libc", + importpath = "modernc.org/libc", + sum = "h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE=", + version = "v1.22.5", + ) + go_repository( + name = "org_modernc_mathutil", + importpath = "modernc.org/mathutil", + sum = "h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=", + version = "v1.5.0", + ) + go_repository( + name = "org_modernc_memory", + importpath = "modernc.org/memory", + sum = "h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=", + version = "v1.5.0", + ) + go_repository( + name = "org_modernc_opt", + importpath = "modernc.org/opt", + sum = "h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=", + version = "v0.1.3", + ) + go_repository( + name = "org_modernc_sqlite", + importpath = "modernc.org/sqlite", + sum = "h1:EsClRIWHGhLTCX44p+Ri/JLD+vFGo0QGjasg2/F9TlI=", + version = "v1.24.0", + ) + go_repository( + name = "org_modernc_strutil", + importpath = "modernc.org/strutil", + sum = "h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY=", + version = "v1.1.3", + ) + go_repository( + name = "org_modernc_tcl", + importpath = "modernc.org/tcl", + sum = "h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY=", + version = "v1.15.2", + ) + go_repository( + name = "org_modernc_token", + importpath = "modernc.org/token", + sum = "h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=", + version = "v1.0.1", + ) + go_repository( + name = "org_modernc_z", + importpath = "modernc.org/z", + sum = "h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY=", + version = "v1.7.3", + ) go_repository( name = "org_uber_go_atomic", importpath = "go.uber.org/atomic", diff --git a/licenses/data/com_github_mattn_go_sqlite3/LICENSE b/licenses/data/com_github_dustin_go_humanize/LICENSE similarity index 84% rename from licenses/data/com_github_mattn_go_sqlite3/LICENSE rename to licenses/data/com_github_dustin_go_humanize/LICENSE index ca458bb39f..8d9a94a906 100644 --- a/licenses/data/com_github_mattn_go_sqlite3/LICENSE +++ b/licenses/data/com_github_dustin_go_humanize/LICENSE @@ -1,6 +1,4 @@ -The MIT License (MIT) - -Copyright (c) 2014 Yasuhiro Matsumoto +Copyright (c) 2005-2008 Dustin Sallings Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,8 +7,8 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -19,3 +17,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + diff --git a/licenses/data/com_github_remyoudompheng_bigfft/LICENSE b/licenses/data/com_github_remyoudompheng_bigfft/LICENSE new file mode 100644 index 0000000000..7448756763 --- /dev/null +++ b/licenses/data/com_github_remyoudompheng_bigfft/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_libc/LICENSE b/licenses/data/org_modernc_libc/LICENSE new file mode 100644 index 0000000000..0c6500bc36 --- /dev/null +++ b/licenses/data/org_modernc_libc/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2017 The Libc Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the names of the authors nor the names of the +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_libc/LICENSE-GO b/licenses/data/org_modernc_libc/LICENSE-GO new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/licenses/data/org_modernc_libc/LICENSE-GO @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_libc/honnef.co/go/netdb/LICENSE b/licenses/data/org_modernc_libc/honnef.co/go/netdb/LICENSE new file mode 100644 index 0000000000..ddd6ddd72b --- /dev/null +++ b/licenses/data/org_modernc_libc/honnef.co/go/netdb/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2012 Dominik Honnef + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/licenses/data/org_modernc_mathutil/LICENSE b/licenses/data/org_modernc_mathutil/LICENSE new file mode 100644 index 0000000000..128a1b64a4 --- /dev/null +++ b/licenses/data/org_modernc_mathutil/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 The mathutil Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the names of the authors nor the names of the +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_mathutil/mersenne/LICENSE b/licenses/data/org_modernc_mathutil/mersenne/LICENSE new file mode 100644 index 0000000000..4fa2a1f4fd --- /dev/null +++ b/licenses/data/org_modernc_mathutil/mersenne/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 The mersenne Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the names of the authors nor the names of the +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_memory/LICENSE b/licenses/data/org_modernc_memory/LICENSE new file mode 100644 index 0000000000..967339afcf --- /dev/null +++ b/licenses/data/org_modernc_memory/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2017 The Memory Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the names of the authors nor the names of the +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_memory/LICENSE-GO b/licenses/data/org_modernc_memory/LICENSE-GO new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/licenses/data/org_modernc_memory/LICENSE-GO @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_memory/LICENSE-MMAP-GO b/licenses/data/org_modernc_memory/LICENSE-MMAP-GO new file mode 100644 index 0000000000..8f05f338ac --- /dev/null +++ b/licenses/data/org_modernc_memory/LICENSE-MMAP-GO @@ -0,0 +1,25 @@ +Copyright (c) 2011, Evan Shaw +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/licenses/data/org_modernc_sqlite/LICENSE b/licenses/data/org_modernc_sqlite/LICENSE new file mode 100644 index 0000000000..867b0f379c --- /dev/null +++ b/licenses/data/org_modernc_sqlite/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2017 The Sqlite Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/licenses/data/org_modernc_sqlite/SQLITE-LICENSE b/licenses/data/org_modernc_sqlite/SQLITE-LICENSE new file mode 100644 index 0000000000..cc4c78e3d9 --- /dev/null +++ b/licenses/data/org_modernc_sqlite/SQLITE-LICENSE @@ -0,0 +1,25 @@ +SQLite Is Public Domain + +All of the code and documentation in SQLite has been dedicated to the public +domain by the authors. All code authors, and representatives of the companies +they work for, have signed affidavits dedicating their contributions to the +public domain and originals of those signed affidavits are stored in a firesafe +at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, +compile, sell, or distribute the original SQLite code, either in source code +form or as a compiled binary, for any purpose, commercial or non-commercial, +and by any means. + +The previous paragraph applies to the deliverable code and documentation in +SQLite - those parts of the SQLite library that you actually bundle and ship +with a larger application. Some scripts used as part of the build process (for +example the "configure" scripts generated by autoconf) might fall under other +open-source licenses. Nothing from these build scripts ever reaches the final +deliverable SQLite library, however, and so the licenses associated with those +scripts should not be a factor in assessing your rights to copy and use the +SQLite library. + +All of the deliverable code in SQLite has been written from scratch. No code +has been taken from other projects or from the open internet. Every line of +code can be traced back to its original author, and all of those authors have +public domain dedications on file. So the SQLite code base is clean and is +uncontaminated with licensed code from other projects. diff --git a/nogo.json b/nogo.json index 625a5166d5..bad20152f4 100644 --- a/nogo.json +++ b/nogo.json @@ -2,7 +2,8 @@ "assign": { "exclude_files": { "gazelle/walk/walk.go": "", - "com_github_deepmap_oapi_codegen/pkg/codegen/": "" + "com_github_deepmap_oapi_codegen/pkg/codegen/": "", + "/org_modernc_sqlite": "" } }, "composites": { @@ -73,7 +74,9 @@ "/com_github_magiconair_properties": "", "/com_github_ghodss_yaml/": "", "/com_github_lestrrat_go_iter/mapiter/": "", - "/com_github_lestrrat_go_iter/arrayiter/": "" + "/com_github_lestrrat_go_iter/arrayiter/": "", + "/org_modernc_libc": "", + "/org_modernc_sqlite": "" } }, "unsafeptr": { @@ -105,7 +108,9 @@ }, "stdmethods": { "exclude_files": { - "/com_github_uber_jaeger_client_go": "" + "/com_github_uber_jaeger_client_go": "", + "/org_modernc_sqlite": "", + "/org_modernc_mathutil": "" } }, "structtag": { diff --git a/private/storage/beacon/sqlite/BUILD.bazel b/private/storage/beacon/sqlite/BUILD.bazel index 1e265e09cd..fb536c3032 100644 --- a/private/storage/beacon/sqlite/BUILD.bazel +++ b/private/storage/beacon/sqlite/BUILD.bazel @@ -16,7 +16,6 @@ go_library( "//pkg/private/util:go_default_library", "//private/storage/beacon:go_default_library", "//private/storage/db:go_default_library", - "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/beacon/sqlite/db.go b/private/storage/beacon/sqlite/db.go index 4c76036f29..f6b2de6ad7 100644 --- a/private/storage/beacon/sqlite/db.go +++ b/private/storage/beacon/sqlite/db.go @@ -22,8 +22,6 @@ import ( "sync" "time" - _ "github.com/mattn/go-sqlite3" - "github.com/scionproto/scion/control/beacon" "github.com/scionproto/scion/pkg/addr" "github.com/scionproto/scion/pkg/private/common" diff --git a/private/storage/db/BUILD.bazel b/private/storage/db/BUILD.bazel index fa5d8594a5..9ed6145d99 100644 --- a/private/storage/db/BUILD.bazel +++ b/private/storage/db/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "metrics.go", "sqler.go", "sqlite.go", + "sqlite_modernc.go", ], importpath = "github.com/scionproto/scion/private/storage/db", visibility = ["//visibility:public"], @@ -16,6 +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", ], ) diff --git a/private/storage/db/sqlite.go b/private/storage/db/sqlite.go index 15e04f6c4a..5e0dde3f54 100644 --- a/private/storage/db/sqlite.go +++ b/private/storage/db/sqlite.go @@ -22,6 +22,8 @@ import ( "github.com/scionproto/scion/pkg/private/serrors" ) +const _ = buildtag_guard_either_sqlite_mattn_or_sqlite_modernc + // NewSqlite returns a new SQLite backend opening a database at the given path. If // no database exists a new database is be created. If the schema version of the // stored database is different from schemaVersion, an error is returned. @@ -67,14 +69,12 @@ func open(path string) (*sql.DB, error) { return nil, serrors.WrapStr("invalid connection path", err, "path", path) } - q := u.Query() // Add foreign_key parameter to path to enable foreign key support. - q.Set("_foreign_keys", "1") - // prevent weird errors. (see https://stackoverflow.com/a/35805826) - q.Set("_journal_mode", "WAL") + q := u.Query() + addPragmas(q) u.RawQuery = q.Encode() path = u.String() - db, err := sql.Open("sqlite3", path) + db, err := sql.Open(driverName(), path) if err != nil { return nil, serrors.WrapStr("Couldn't open SQLite database", err, "path", path) } diff --git a/private/storage/db/sqlite_mattn.go b/private/storage/db/sqlite_mattn.go new file mode 100644 index 0000000000..805a646096 --- /dev/null +++ b/private/storage/db/sqlite_mattn.go @@ -0,0 +1,41 @@ +// Copyright 2023 SCION Association +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build sqlite_mattn + +package db + +import ( + "net/url" + + _ "github.com/mattn/go-sqlite3" +) + +const buildtag_guard_either_sqlite_mattn_or_sqlite_modernc = "must choose an sqlite " + + "implementation to build, by defining exactly one of the gotags " + + "'sqlite_modernc' or 'sqlite_mattn'" + +// addPragmas() modifies given URL query so it can be used to make the correct uri +// connection path for this sqlite implementation. The modifications turn on +// foreign keys and WAL journal mode for every SQL query. +func addPragmas(q url.Values) { + // Add foreign_key parameter to path to enable foreign key support. + q.Set("_foreign_keys", "1") + // prevent weird errors. (see https://stackoverflow.com/a/35805826) + q.Set("_journal_mode", "WAL") +} + +func driverName() string { + return "sqlite3" +} diff --git a/private/storage/db/sqlite_modernc.go b/private/storage/db/sqlite_modernc.go new file mode 100644 index 0000000000..951985b23e --- /dev/null +++ b/private/storage/db/sqlite_modernc.go @@ -0,0 +1,48 @@ +// Copyright 2023 SCION Association +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// 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. + +package db + +import ( + "net/url" + + _ "modernc.org/sqlite" +) + +const buildtag_guard_either_sqlite_mattn_or_sqlite_modernc = "must choose an sqlite " + + "implementation to build, by defining exactly one of the gotags " + + "'sqlite_modernc' or 'sqlite_mattn'" + +// addPragmas() modifies given URL query so it can be used to make the correct uri +// connection path for this sqlite implementation. The modifications turn on +// foreign keys and WAL journal mode for every SQL query. +func addPragmas(q url.Values) { + // Add foreign_key parameter to path to enable foreign key support. + q.Add("_pragma", "foreign_keys=1") + // prevent weird errors. (see https://stackoverflow.com/a/35805826) + q.Add("_pragma", "journal_mode=WAL") +} + +func driverName() string { + return "sqlite" +} diff --git a/private/storage/drkey/level1/sqlite/BUILD.bazel b/private/storage/drkey/level1/sqlite/BUILD.bazel index fb58e54249..162d041ab3 100644 --- a/private/storage/drkey/level1/sqlite/BUILD.bazel +++ b/private/storage/drkey/level1/sqlite/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "//pkg/drkey:go_default_library", "//pkg/private/util:go_default_library", "//private/storage/db:go_default_library", - "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/drkey/level1/sqlite/db.go b/private/storage/drkey/level1/sqlite/db.go index 2b18074b29..7b6a3a239e 100644 --- a/private/storage/drkey/level1/sqlite/db.go +++ b/private/storage/drkey/level1/sqlite/db.go @@ -20,8 +20,6 @@ import ( "sync" "time" - _ "github.com/mattn/go-sqlite3" - "github.com/scionproto/scion/pkg/drkey" "github.com/scionproto/scion/pkg/private/util" "github.com/scionproto/scion/private/storage/db" diff --git a/private/storage/drkey/level2/sqlite/BUILD.bazel b/private/storage/drkey/level2/sqlite/BUILD.bazel index ccbc061ef0..58c2e9cfbd 100644 --- a/private/storage/drkey/level2/sqlite/BUILD.bazel +++ b/private/storage/drkey/level2/sqlite/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "//pkg/drkey:go_default_library", "//pkg/private/util:go_default_library", "//private/storage/db:go_default_library", - "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/drkey/level2/sqlite/db.go b/private/storage/drkey/level2/sqlite/db.go index 6570427d16..f0e212c0f1 100644 --- a/private/storage/drkey/level2/sqlite/db.go +++ b/private/storage/drkey/level2/sqlite/db.go @@ -20,8 +20,6 @@ import ( "sync" "time" - _ "github.com/mattn/go-sqlite3" - "github.com/scionproto/scion/pkg/drkey" "github.com/scionproto/scion/pkg/private/util" "github.com/scionproto/scion/private/storage/db" diff --git a/private/storage/drkey/secret/sqlite/BUILD.bazel b/private/storage/drkey/secret/sqlite/BUILD.bazel index f4736d09db..40191a2bf6 100644 --- a/private/storage/drkey/secret/sqlite/BUILD.bazel +++ b/private/storage/drkey/secret/sqlite/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "//pkg/drkey:go_default_library", "//pkg/private/util:go_default_library", "//private/storage/db:go_default_library", - "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/drkey/secret/sqlite/db.go b/private/storage/drkey/secret/sqlite/db.go index 818bf8eb15..6511c1be9b 100644 --- a/private/storage/drkey/secret/sqlite/db.go +++ b/private/storage/drkey/secret/sqlite/db.go @@ -20,8 +20,6 @@ import ( "sync" "time" - _ "github.com/mattn/go-sqlite3" - "github.com/scionproto/scion/pkg/drkey" "github.com/scionproto/scion/pkg/private/util" "github.com/scionproto/scion/private/storage/db" diff --git a/private/storage/path/sqlite/BUILD.bazel b/private/storage/path/sqlite/BUILD.bazel index 480c055e8a..2bf89eda05 100644 --- a/private/storage/path/sqlite/BUILD.bazel +++ b/private/storage/path/sqlite/BUILD.bazel @@ -17,7 +17,6 @@ go_library( "//private/storage/db:go_default_library", "//private/storage/path:go_default_library", "//private/storage/utils:go_default_library", - "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/path/sqlite/sqlite.go b/private/storage/path/sqlite/sqlite.go index 78961c8108..a11748d270 100644 --- a/private/storage/path/sqlite/sqlite.go +++ b/private/storage/path/sqlite/sqlite.go @@ -26,8 +26,6 @@ import ( "sync" "time" - _ "github.com/mattn/go-sqlite3" - "github.com/scionproto/scion/pkg/addr" "github.com/scionproto/scion/pkg/private/serrors" seg "github.com/scionproto/scion/pkg/segment" diff --git a/private/storage/trust/sqlite/BUILD.bazel b/private/storage/trust/sqlite/BUILD.bazel index 65f66ca7ba..688b9292dd 100644 --- a/private/storage/trust/sqlite/BUILD.bazel +++ b/private/storage/trust/sqlite/BUILD.bazel @@ -14,7 +14,6 @@ go_library( "//private/storage/db:go_default_library", "//private/storage/trust:go_default_library", "//private/trust:go_default_library", - "@com_github_mattn_go_sqlite3//:go_default_library", ], ) diff --git a/private/storage/trust/sqlite/db.go b/private/storage/trust/sqlite/db.go index 388469fb68..aa7f49aebb 100644 --- a/private/storage/trust/sqlite/db.go +++ b/private/storage/trust/sqlite/db.go @@ -23,8 +23,6 @@ import ( "strings" "sync" - _ "github.com/mattn/go-sqlite3" - "github.com/scionproto/scion/pkg/private/serrors" "github.com/scionproto/scion/pkg/scrypto/cppki" "github.com/scionproto/scion/private/storage/db" diff --git a/tools/dc b/tools/dc index 9aad5d98e8..2b21ec3f3d 100755 --- a/tools/dc +++ b/tools/dc @@ -83,7 +83,7 @@ dc() { local project="$1" local dc_file="gen/$1-dc.yml" shift - COMPOSE_FILE="$dc_file" docker-compose -p "$project" --no-ansi "$@" + COMPOSE_FILE="$dc_file" docker-compose -p "$project" --ansi never "$@" } cmd_collect_logs() { diff --git a/tools/env/rhel/deps b/tools/env/rhel/deps index 007bc9153e..533f4e69e7 100755 --- a/tools/env/rhel/deps +++ b/tools/env/rhel/deps @@ -3,4 +3,5 @@ set -e sudo yum groupinstall -y "Development Tools" -sudo yum install -y jq +BASE=$(dirname "$0") +xargs -a "$BASE/pkgs.txt" sudo yum install -y diff --git a/tools/env/rhel/pkgs.txt b/tools/env/rhel/pkgs.txt new file mode 100644 index 0000000000..737fe222c4 --- /dev/null +++ b/tools/env/rhel/pkgs.txt @@ -0,0 +1,10 @@ +bridge-utils +moreutils +gcc +g++ +python3-pip +python3-setuptools +python3-wheel +jq +sqlite3 +openssl diff --git a/tools/install_deps b/tools/install_deps index 6ac5bf0ced..b43f43d756 100755 --- a/tools/install_deps +++ b/tools/install_deps @@ -3,9 +3,9 @@ set -e BASE=$(dirname "$0") -"$BASE/env/pip3/deps" if which apt-get >& /dev/null; then "$BASE/env/debian/deps" elif which yum >& /dev/null; then "$BASE/env/rhel/deps" fi +"$BASE/env/pip3/deps" diff --git a/tools/update_testdata.sh b/tools/update_testdata.sh index 71372413d6..1d4874a31b 100755 --- a/tools/update_testdata.sh +++ b/tools/update_testdata.sh @@ -10,5 +10,7 @@ folders=$(grep \ --exclude-dir=bazel-\* \ "xtest.UpdateGoldenFiles()" . | xargs dirname | sort | uniq ) -echo $folders -update | xargs go test -echo $folders -count=1 | xargs go test +GO_BUILD_TAGS_ARG=$(bazel build --ui_event_filters=-stdout,-stderr --announce_rc --noshow_progress :dummy_setting 2>&1 | grep "'build' options" | sed -n "s/^.*--define gotags=\(\S*\).*/-tags \1/p") + +echo $folders -update | xargs go test ${GO_BUILD_TAGS_ARG} +echo $folders -count=1 | xargs go test ${GO_BUILD_TAGS_ARG}