Skip to content

Commit bcbc5d2

Browse files
authored
Lint, fix mac build (#2)
1 parent 4cd34b0 commit bcbc5d2

File tree

16 files changed

+126
-68
lines changed

16 files changed

+126
-68
lines changed

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.2.0
1+
6.2.1

.github/workflows/auto_update.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Auto Update
22
on:
3-
push:
4-
branches-ignore:
5-
- 'autoupdate'
3+
workflow_dispatch:
4+
schedule:
5+
# Check on Mondays and Thursdays
6+
- cron: '0 0 * * 1,4'
67

78
concurrency:
89
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
@@ -61,7 +62,7 @@ jobs:
6162
if [[ $(git --no-pager diff --exit-code HEAD) != '' ]]; then
6263
echo "Something changed, need to re-generate"
6364
bazel run //:generate
64-
buildifier --lint=fix -r ..
65+
buildifier -warnings all --lint=fix -r ..
6566
else
6667
echo "No changes!"
6768
fi;

.github/workflows/build.yml

+17-15
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@ jobs:
1212
matrix:
1313
include:
1414
# Build standard, native
15-
- { name: "windows - native", os: windows-latest, command: "test", config: "--config=windows", bazel_options: "--output_user_root=C:\\bazelroot", }
15+
- { name: "windows - native", os: windows-2019, command: "test", config: "--config=windows", bazel_options: "--output_user_root=C:\\bazelroot", }
1616
- { name: "ubuntu - native", os: ubuntu-latest, command: "test", config: "--config=linux", bazel_options: "", }
17-
- { name: "macos - native", os: macos-latest, command: "test", config: "--config=macos --test_tag_filters=-bazelrio-cpp-test", bazel_options: "", }
17+
- { name: "macos - native", os: macos-latest, command: "test", config: "--config=macos", bazel_options: "", }
1818

1919
# Build bzlmod, native
20-
- { name: "windows - bzlmod native", os: windows-latest, command: "test", config: "--enable_bzlmod --config=windows", bazel_options: "--output_user_root=C:\\bazelroot", }
20+
- { name: "windows - bzlmod native", os: windows-2019, command: "test", config: "--enable_bzlmod --config=windows", bazel_options: "--output_user_root=C:\\bazelroot", }
2121
- { name: "ubuntu - bzlmod native", os: ubuntu-latest, command: "test", config: "--enable_bzlmod --config=linux", bazel_options: "", }
22-
- { name: "macos - bzlmod native", os: macos-latest, command: "test", config: "--enable_bzlmod --config=macos --test_tag_filters=-bazelrio-cpp-test", bazel_options: "", }
22+
- { name: "macos - bzlmod native", os: macos-latest, command: "test", config: "--enable_bzlmod --config=macos", bazel_options: "", }
2323

2424
name: "Build - ${{ matrix.name }}"
2525
runs-on: ${{ matrix.os }}
2626
steps:
2727
- uses: actions/checkout@v3
2828
- uses: actions/setup-python@v4
29-
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --verbose_failures --config=remote //... @bzlmodrio-opencv//... || true
29+
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} @bzlmodrio-opencv//...
30+
working-directory: tests
31+
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --verbose_failures --config=remote //... || true
3032
working-directory: tests
3133
- run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=remote
3234
working-directory: tests
@@ -38,12 +40,12 @@ jobs:
3840
matrix:
3941
include:
4042
# Build standard, roborio
41-
- { name: "windows - roborio", os: windows-latest, command: "build", config: "--config=roborio", bazel_options: "--output_user_root=C:\\bazelroot", }
43+
- { name: "windows - roborio", os: windows-2019, command: "build", config: "--config=roborio", bazel_options: "--output_user_root=C:\\bazelroot", }
4244
- { name: "ubuntu - roborio", os: ubuntu-latest, command: "build", config: "--config=roborio", bazel_options: "", }
4345
- { name: "macos - roborio", os: macos-latest, command: "build", config: "--config=roborio", bazel_options: "", }
4446

4547
# Build bzlmod, roborio
46-
# - { name: "windows - bzlmod roborio", os: windows-latest, command: "build", config: "--enable_bzlmod --config=roborio", bazel_options: "--output_user_root=C:\\bazelroot", }
48+
# - { name: "windows - bzlmod roborio", os: windows-2019, command: "build", config: "--enable_bzlmod --config=roborio", bazel_options: "--output_user_root=C:\\bazelroot", }
4749
- { name: "ubuntu - bzlmod roborio", os: ubuntu-latest, command: "build", config: "--enable_bzlmod --config=roborio", bazel_options: "", }
4850
- { name: "macos - bzlmod roborio", os: macos-latest, command: "build", config: "--enable_bzlmod --config=roborio", bazel_options: "", }
4951
name: "Build - ${{ matrix.name }}"
@@ -63,14 +65,14 @@ jobs:
6365
matrix:
6466
include:
6567
# Build standard, bullseye32
66-
- { name: "windows - bullseye32", os: windows-latest, command: "build", config: "--config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", }
68+
- { name: "windows - bullseye32", os: windows-2019, command: "build", config: "--config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", }
6769
- { name: "ubuntu - bullseye32", os: ubuntu-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
68-
# - { name: "macos - bullseye32", os: macos-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
70+
- { name: "macos - bullseye32", os: macos-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
6971

7072
# Build bzlmod, bullseye32
71-
# - { name: "windows - bzlmod bullseye32", os: windows-latest, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", }
73+
- { name: "windows - bzlmod bullseye32", os: windows-2019, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", }
7274
- { name: "ubuntu - bzlmod bullseye32", os: ubuntu-latest, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "", }
73-
# - { name: "macos - bzlmod bullseye32", os: macos-latest, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "", }
75+
- { name: "macos - bzlmod bullseye32", os: macos-latest, command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "", }
7476
name: "Build - ${{ matrix.name }}"
7577
runs-on: ${{ matrix.os }}
7678
steps:
@@ -89,14 +91,14 @@ jobs:
8991
matrix:
9092
include:
9193
# Build standard, bullseye32:
92-
- { name: "windows - bullseye64", os: windows-latest, command: "build", config: "--config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", }
94+
- { name: "windows - bullseye64", os: windows-2019, command: "build", config: "--config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", }
9395
- { name: "ubuntu - bullseye64", os: ubuntu-latest, command: "build", config: "--config=bullseye64", bazel_options: "", }
94-
# - { name: "macos - bullseye64", os: macos-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
96+
- { name: "macos - bullseye64", os: macos-latest, command: "build", config: "--config=bullseye32", bazel_options: "", }
9597

9698
# Build bzlmod, bullseye32:
97-
# - { name: "windows - bzlmod bullseye64", os: windows-latest, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", }
99+
- { name: "windows - bzlmod bullseye64", os: windows-2019, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", }
98100
- { name: "ubuntu - bzlmod bullseye64", os: ubuntu-latest, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "", }
99-
# - { name: "macos - bzlmod bullseye64", os: macos-latest, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "", }
101+
- { name: "macos - bzlmod bullseye64", os: macos-latest, command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "", }
100102
name: "Build - ${{ matrix.name }}"
101103
runs-on: ${{ matrix.os }}
102104
steps:

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected]
5252
5353
- name: Run buildifier
54-
run: buildifier --lint=fix -r .
54+
run: buildifier -warnings all --lint=fix -r .
5555

5656
- name: Check Output
5757
run: git --no-pager diff --exit-code HEAD

MODULE.bazel

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module(
55
)
66

77
bazel_dep(name = "platforms", version = "0.0.6")
8-
bazel_dep(name = "rules_java", version = "5.5.0")
8+
bazel_dep(name = "rules_cc", version = "0.0.6")
9+
bazel_dep(name = "rules_java", version = "6.0.0")
910
bazel_dep(name = "rules_bazelrio", version = "0.0.10")
1011
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2023-7")
1112

generate/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
2+
13
py_library(
24
name = "get_opencv_dependencies",
35
srcs = ["get_opencv_dependencies.py"],

libraries/cpp/opencv/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
13
alias(
24
name = "opencv",
35
actual = ":shared",

libraries/java/opencv/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_java//java:defs.bzl", "java_import")
2+
13
java_import(
24
name = "opencv",
35
jars = ["@edu_wpi_first_thirdparty_frc2023_opencv_opencv_java//jar:file"],

maven_cpp_deps.bzl

+26-9
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,43 @@ cc_library(
3333
"""
3434

3535
cc_library_shared = """
36-
static_srcs = glob(["**/*.lib", "**/*.a"], exclude=["**/*jni.lib"])
37-
shared_srcs = glob(["**/*.dll", "**/*.so*", "**/*.dylib"], exclude=["**/*jni.dll", "**/*jni.so", "**/*.so.debug", "**/libopencv_java*.dylib"])
38-
shared_jni_srcs = glob(["**/*jni.dll", "**/*jni.so*", "**/*.jni.dylib", "**/libopencv_java*.dylib"], exclude=["**/*.so.debug"])
36+
JNI_PATTERN=[
37+
"**/*jni.dll",
38+
"**/*jni.so*",
39+
"**/*jni.dylib",
40+
"**/*_java*.dll",
41+
"**/lib*_java*.dylib",
42+
"**/lib*_java*.so",
43+
]
3944
40-
cc_library(
45+
static_srcs = glob([
46+
"**/*.lib",
47+
"**/*.a"
48+
],
49+
exclude=["**/*jni.lib"]
50+
)
51+
shared_srcs = glob([
52+
"**/*.dll",
53+
"**/*.so*",
54+
"**/*.dylib",
55+
],
56+
exclude=JNI_PATTERN + ["**/*.so.debug"]
57+
)
58+
shared_jni_srcs = glob(JNI_PATTERN, exclude=["**/*.so.debug"])
59+
60+
filegroup(
4161
name = "static_libs",
4262
srcs = static_srcs,
4363
visibility = ["//visibility:public"],
4464
)
4565
46-
cc_library(
66+
filegroup(
4767
name = "shared_libs",
4868
srcs = shared_srcs,
4969
visibility = ["//visibility:public"],
50-
deps = [
51-
":static_libs",
52-
]
5370
)
5471
55-
cc_library(
72+
filegroup(
5673
name = "shared_jni_libs",
5774
srcs = shared_jni_srcs,
5875
visibility = ["//visibility:public"],

0 commit comments

Comments
 (0)