Skip to content

Commit 0388483

Browse files
committed
Migrate to bazel 8
1 parent 5461c45 commit 0388483

File tree

31 files changed

+2900
-167
lines changed

31 files changed

+2900
-167
lines changed

.bazelrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
common --enable_bzlmod

BUILD.bazel

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
21
load("@bazel_gazelle//:def.bzl", "gazelle")
32
# load(":rules.bzl", "foo_binary")
43

4+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
5+
56
# gazelle:prefix github.com/macadmins/osquery-extension
67
gazelle(name = "gazelle")
78

@@ -52,8 +53,8 @@ go_library(
5253
"//tables/sofa",
5354
"//tables/unifiedlog",
5455
"//tables/wifi_network",
55-
"@com_github_osquery_osquery_go//:osquery-go",
56-
"@com_github_osquery_osquery_go//plugin/table",
56+
"//vendor/github.com/osquery/osquery-go",
57+
"//vendor/github.com/osquery/osquery-go/plugin/table",
5758
],
5859
)
5960

MODULE.bazel

+7
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@
44
#
55
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
66
###############################################################################
7+
8+
module(
9+
name = "osquery-extension",
10+
repo_name = "com_github_macadmins_osquery-extension",
11+
)
12+
bazel_dep(name = "rules_go", version = "0.52.0", repo_name = "io_bazel_rules_go")
13+
bazel_dep(name = "gazelle", version = "0.41.0", repo_name = "bazel_gazelle")

MODULE.bazel.lock

+2,798-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WORKSPACE

-44
This file was deleted.

deps.bzl

+12-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ def go_dependencies():
3737
sum = "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=",
3838
version = "v0.5.9",
3939
)
40-
go_repository(
41-
name = "com_github_groob_plist",
42-
importpath = "github.com/groob/plist",
43-
sum = "h1:saaSiB25B1wgaxrshQhurfPKUGJ4It3OxNJUy0rdOjU=",
44-
version = "v0.0.0-20220217120414-63fa881b19a5",
45-
)
4640
go_repository(
4741
name = "com_github_hashicorp_go_version",
4842
importpath = "github.com/hashicorp/go-version",
@@ -67,6 +61,12 @@ def go_dependencies():
6761
sum = "h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=",
6862
version = "v0.2.0",
6963
)
64+
go_repository(
65+
name = "com_github_micromdm_plist",
66+
importpath = "github.com/micromdm/plist",
67+
sum = "h1:saaSiB25B1wgaxrshQhurfPKUGJ4It3OxNJUy0rdOjU=",
68+
version = "v0.0.0-20220217120414-63fa881b19a5",
69+
)
7070
go_repository(
7171
name = "com_github_microsoft_go_winio",
7272
importpath = "github.com/Microsoft/go-winio",
@@ -157,6 +157,12 @@ def go_dependencies():
157157
sum = "h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=",
158158
version = "v0.12.0",
159159
)
160+
go_repository(
161+
name = "org_golang_x_sync",
162+
importpath = "golang.org/x/sync",
163+
sum = "h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=",
164+
version = "v0.8.0",
165+
)
160166
go_repository(
161167
name = "org_golang_x_sys",
162168
importpath = "golang.org/x/sys",

go.mod

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
module github.com/macadmins/osquery-extension
22

3-
go 1.21
3+
go 1.22.0
4+
5+
toolchain go1.22.1
46

57
require (
6-
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5
78
github.com/hashicorp/go-version v1.6.0
9+
github.com/micromdm/plist v0.2.0
810
github.com/osquery/osquery-go v0.0.0-20231130195733-61ac79279aaa
911
github.com/pkg/errors v0.9.1
1012
github.com/stretchr/testify v1.9.0
11-
golang.org/x/sync v0.8.0
13+
golang.org/x/sync v0.10.0
1214
gopkg.in/yaml.v3 v3.0.1
1315
)
1416

@@ -18,11 +20,12 @@ require (
1820
github.com/davecgh/go-spew v1.1.1 // indirect
1921
github.com/go-logr/logr v1.4.1 // indirect
2022
github.com/go-logr/stdr v1.2.2 // indirect
23+
github.com/google/go-cmp v0.6.0 // indirect
2124
github.com/kr/pretty v0.3.1 // indirect
2225
github.com/pmezard/go-difflib v1.0.0 // indirect
2326
go.opentelemetry.io/otel v1.16.0 // indirect
2427
go.opentelemetry.io/otel/metric v1.16.0 // indirect
2528
go.opentelemetry.io/otel/trace v1.16.0 // indirect
26-
golang.org/x/sys v0.19.0 // indirect
29+
golang.org/x/sys v0.29.0 // indirect
2730
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
2831
)

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
1010
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
1111
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
1212
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
13-
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
14-
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
15-
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5 h1:saaSiB25B1wgaxrshQhurfPKUGJ4It3OxNJUy0rdOjU=
16-
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5/go.mod h1:itkABA+w2cw7x5nYUS/pLRef6ludkZKOigbROmCTaFw=
13+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
14+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1715
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
1816
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
1917
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -23,6 +21,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
2321
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
2422
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
2523
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
24+
github.com/micromdm/plist v0.2.0 h1:W/AuDP/0EB1xNhWvoP5qpE14oYeQSE+IaJqoeAU5SJ0=
25+
github.com/micromdm/plist v0.2.0/go.mod h1:flkfm0od6GzyXBqI28h5sgEyi3iPO28W2t1Zm9LpwWs=
2626
github.com/osquery/osquery-go v0.0.0-20231130195733-61ac79279aaa h1:bDsjvyU27AQGD/I23v6TUemEffCX0MnL2HVezsotJas=
2727
github.com/osquery/osquery-go v0.0.0-20231130195733-61ac79279aaa/go.mod h1:mLJRc1Go8uP32LRALGvWj2lVJ+hDYyIfxDzVa+C5Yo8=
2828
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -40,10 +40,10 @@ go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26
4040
go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4=
4141
go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs=
4242
go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0=
43-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
44-
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
45-
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
46-
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
43+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
44+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
45+
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
46+
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
4747
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4848
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
4949
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

pkg/utils/BUILD.bazel

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ go_library(
1010
],
1111
importpath = "github.com/macadmins/osquery-extension/pkg/utils",
1212
visibility = ["//visibility:public"],
13-
deps = ["@com_github_osquery_osquery_go//:osquery-go"],
13+
deps = ["//vendor/github.com/osquery/osquery-go"],
1414
)
1515

1616
go_test(
@@ -22,7 +22,7 @@ go_test(
2222
],
2323
embed = [":utils"],
2424
deps = [
25-
"@com_github_stretchr_testify//assert",
26-
"@com_github_stretchr_testify//require",
25+
"//vendor/github.com/stretchr/testify/assert",
26+
"//vendor/github.com/stretchr/testify/require",
2727
],
2828
)

tables/alt_system_info/BUILD.bazel

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//pkg/utils",
10-
"@com_github_groob_plist//:plist",
11-
"@com_github_osquery_osquery_go//plugin/table",
12-
"@org_golang_x_sync//errgroup:go_default_library",
10+
"//vendor/github.com/micromdm/plist",
11+
"//vendor/github.com/osquery/osquery-go/plugin/table",
12+
"//vendor/golang.org/x/sync/errgroup",
1313
],
1414
)
1515

@@ -19,7 +19,7 @@ go_test(
1919
deps = [
2020
":alt_system_info",
2121
"//pkg/utils",
22-
"@com_github_stretchr_testify//assert",
23-
"@com_github_stretchr_testify//require",
22+
"//vendor/github.com/stretchr/testify/assert",
23+
"//vendor/github.com/stretchr/testify/require",
2424
],
2525
)

tables/alt_system_info/alt_system_info.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"sync"
1010
"time"
1111

12-
"github.com/groob/plist"
1312
"github.com/macadmins/osquery-extension/pkg/utils"
13+
"github.com/micromdm/plist"
1414
"github.com/osquery/osquery-go/plugin/table"
1515
"golang.org/x/sync/errgroup"
1616
)

tables/authdb/BUILD.bazel

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//pkg/utils",
10-
"@com_github_groob_plist//:plist",
11-
"@com_github_osquery_osquery_go//plugin/table",
10+
"//vendor/github.com/micromdm/plist",
11+
"//vendor/github.com/osquery/osquery-go/plugin/table",
1212
],
1313
)
1414

@@ -18,7 +18,7 @@ go_test(
1818
embed = [":authdb"],
1919
deps = [
2020
"//pkg/utils",
21-
"@com_github_osquery_osquery_go//plugin/table",
22-
"@com_github_stretchr_testify//assert",
21+
"//vendor/github.com/osquery/osquery-go/plugin/table",
22+
"//vendor/github.com/stretchr/testify/assert",
2323
],
2424
)

tables/authdb/authdb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"strconv"
88
"strings"
99

10-
"github.com/groob/plist"
1110
"github.com/macadmins/osquery-extension/pkg/utils"
11+
"github.com/micromdm/plist"
1212
"github.com/osquery/osquery-go/plugin/table"
1313
)
1414

tables/chromeuserprofiles/BUILD.bazel

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ go_library(
66
importpath = "github.com/macadmins/osquery-extension/tables/chromeuserprofiles",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"@com_github_osquery_osquery_go//plugin/table",
10-
"@com_github_pkg_errors//:errors",
9+
"//vendor/github.com/osquery/osquery-go/plugin/table",
10+
"//vendor/github.com/pkg/errors",
1111
],
1212
)
1313

1414
go_test(
1515
name = "chromeuserprofiles_test",
1616
srcs = ["chrome_user_profiles_test.go"],
1717
embed = [":chromeuserprofiles"],
18-
deps = ["@com_github_stretchr_testify//assert"],
18+
deps = ["//vendor/github.com/stretchr/testify/assert"],
1919
)

tables/fileline/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//pkg/utils",
10-
"@com_github_osquery_osquery_go//plugin/table",
10+
"//vendor/github.com/osquery/osquery-go/plugin/table",
1111
],
1212
)

tables/filevaultusers/BUILD.bazel

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ go_library(
66
importpath = "github.com/macadmins/osquery-extension/tables/filevaultusers",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"@com_github_osquery_osquery_go//plugin/table",
10-
"@com_github_pkg_errors//:errors",
9+
"//vendor/github.com/osquery/osquery-go/plugin/table",
10+
"//vendor/github.com/pkg/errors",
1111
],
1212
)
1313

1414
go_test(
1515
name = "filevaultusers_test",
1616
srcs = ["filevaultusers_test.go"],
1717
embed = [":filevaultusers"],
18-
deps = ["@com_github_stretchr_testify//assert"],
18+
deps = ["//vendor/github.com/stretchr/testify/assert"],
1919
)

tables/macos_profiles/BUILD.bazel

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ go_library(
66
importpath = "github.com/macadmins/osquery-extension/tables/macos_profiles",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"@com_github_groob_plist//:plist",
10-
"@com_github_osquery_osquery_go//plugin/table",
11-
"@com_github_pkg_errors//:errors",
9+
"//vendor/github.com/micromdm/plist",
10+
"//vendor/github.com/osquery/osquery-go/plugin/table",
11+
"//vendor/github.com/pkg/errors",
1212
],
1313
)
1414

@@ -17,5 +17,5 @@ go_test(
1717
srcs = ["macos_profiles_test.go"],
1818
embed = [":macos_profiles"],
1919
embedsrcs = ["test_profiles_stdout.plist"],
20-
deps = ["@com_github_stretchr_testify//assert"],
20+
deps = ["//vendor/github.com/stretchr/testify/assert"],
2121
)

tables/macos_profiles/macos_profiles.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"os/exec"
66

7-
"github.com/groob/plist"
7+
"github.com/micromdm/plist"
88
"github.com/osquery/osquery-go/plugin/table"
99
"github.com/pkg/errors"
1010
)

tables/macosrsr/BUILD.bazel

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ go_library(
66
importpath = "github.com/macadmins/osquery-extension/tables/macosrsr",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"@com_github_groob_plist//:plist",
10-
"@com_github_osquery_osquery_go//plugin/table",
11-
"@com_github_pkg_errors//:errors",
9+
"//vendor/github.com/micromdm/plist",
10+
"//vendor/github.com/osquery/osquery-go/plugin/table",
11+
"//vendor/github.com/pkg/errors",
1212
],
1313
)
1414

@@ -17,5 +17,5 @@ go_test(
1717
srcs = ["rsr_test.go"],
1818
embed = [":macosrsr"],
1919
embedsrcs = ["test_SystemVersion.plist"],
20-
deps = ["@com_github_stretchr_testify//assert"],
20+
deps = ["//vendor/github.com/stretchr/testify/assert"],
2121
)

tables/macosrsr/rsr.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strconv"
99
"strings"
1010

11-
"github.com/groob/plist"
11+
"github.com/micromdm/plist"
1212
"github.com/osquery/osquery-go/plugin/table"
1313
"github.com/pkg/errors"
1414
)

tables/mdm/BUILD.bazel

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//pkg/utils",
10-
"@com_github_groob_plist//:plist",
11-
"@com_github_osquery_osquery_go//plugin/table",
12-
"@com_github_pkg_errors//:errors",
10+
"//vendor/github.com/micromdm/plist",
11+
"//vendor/github.com/osquery/osquery-go/plugin/table",
12+
"//vendor/github.com/pkg/errors",
1313
],
1414
)
1515

@@ -18,7 +18,7 @@ go_test(
1818
srcs = ["mdm_test.go"],
1919
embed = [":mdm"],
2020
deps = [
21-
"@com_github_osquery_osquery_go//plugin/table",
22-
"@com_github_stretchr_testify//assert",
21+
"//vendor/github.com/osquery/osquery-go/plugin/table",
22+
"//vendor/github.com/stretchr/testify/assert",
2323
],
2424
)

0 commit comments

Comments
 (0)