diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 63154932df..688cfd368a 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -136,6 +136,35 @@ jobs: path: "*-bazel-lint-fixes.patch" if: ${{ failure() }} + non_robotpy_pregeneration: + name: "Non-RobotPy Pregen" + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + with: { fetch-depth: 0 } + + - id: Setup_bazel_remote + uses: ./.github/actions/setup-bazel-remote + with: + username: ${{ secrets.BAZEL_CACHE_USERNAME }} + password: ${{ secrets.BAZEL_CACHE_PASSWORD }} + + - name: Run Non-RobotPy pregeneration + run: bazel run //:write_pregenerated_files + + - name: Check Output + run: git --no-pager diff --exit-code HEAD + + - name: Generate diff + run: git diff HEAD > non-robotpy-pregeneration.patch + if: ${{ failure() }} + + - uses: actions/upload-artifact@v6 + with: + name: non-robotpy-pregeneration-fixes + path: non-robotpy-pregeneration.patch + if: ${{ failure() }} + robotpy_pregeneration: name: "Robotpy Pregeneration" runs-on: ubuntu-24.04 diff --git a/commandsv2/BUILD.bazel b/commandsv2/BUILD.bazel index 1cf570a555..5391d08d65 100644 --- a/commandsv2/BUILD.bazel +++ b/commandsv2/BUILD.bazel @@ -43,6 +43,7 @@ generate_wpilib_new_commands( write_source_files( name = "write_wpilib_new_commands", + diff_args = ["-u"], files = { "src/generated": ":generate_wpilib_new_commands", }, diff --git a/commandsv3/BUILD.bazel b/commandsv3/BUILD.bazel index 0212675834..3588d28597 100644 --- a/commandsv3/BUILD.bazel +++ b/commandsv3/BUILD.bazel @@ -28,6 +28,7 @@ generate_commandsv3( write_source_files( name = "write_commandsv3", + diff_args = ["-u"], files = { "src/generated": ":generate_commandsv3", }, diff --git a/hal/BUILD.bazel b/hal/BUILD.bazel index 106237851e..6a9c568c97 100644 --- a/hal/BUILD.bazel +++ b/hal/BUILD.bazel @@ -45,6 +45,7 @@ generate_hal( write_source_files( name = "write_hal", + diff_args = ["-u"], files = { "src/generated": ":generate_hal_files", }, diff --git a/ntcore/BUILD.bazel b/ntcore/BUILD.bazel index af07a45114..14a981ee9b 100644 --- a/ntcore/BUILD.bazel +++ b/ntcore/BUILD.bazel @@ -48,6 +48,7 @@ py_binary( write_source_files( name = "write_ntcore", + diff_args = ["-u"], files = { "src/generated": ":generate_ntcore", }, diff --git a/robotpyExamples/BUILD.bazel b/robotpyExamples/BUILD.bazel index 8b2a494cc7..0ca08dbda9 100644 --- a/robotpyExamples/BUILD.bazel +++ b/robotpyExamples/BUILD.bazel @@ -31,6 +31,7 @@ genrule( write_source_file( name = "write_example_project_list", + diff_args = ["-u"], in_file = ":generate_bazel_files_rule", out_file = "example_projects.bzl", suggested_update_target = "//:write_all", diff --git a/shared/bazel/rules/robotpy/build_info_gen.bzl b/shared/bazel/rules/robotpy/build_info_gen.bzl index bb8a03d7a2..7f595a21e2 100644 --- a/shared/bazel/rules/robotpy/build_info_gen.bzl +++ b/shared/bazel/rules/robotpy/build_info_gen.bzl @@ -34,6 +34,7 @@ def generate_robotpy_native_wrapper_build_info(name, pyproject_toml, third_party suggested_update_target = "//:write_robotpy_generated_native_files", tags = ["robotpy"], target_compatible_with = robotpy_compatibility_select(), + diff_args = ["-u"], ) def generate_robotpy_pybind_build_info( @@ -91,4 +92,5 @@ def generate_robotpy_pybind_build_info( visibility = ["//visibility:public"], tags = ["robotpy"], target_compatible_with = robotpy_compatibility_select(), + diff_args = ["-u"], ) diff --git a/shared/bazel/rules/robotpy/semiwrap_tool_helpers.bzl b/shared/bazel/rules/robotpy/semiwrap_tool_helpers.bzl index 2c947e1e25..c6ee52d958 100644 --- a/shared/bazel/rules/robotpy/semiwrap_tool_helpers.bzl +++ b/shared/bazel/rules/robotpy/semiwrap_tool_helpers.bzl @@ -61,6 +61,7 @@ def update_yaml_files(name, yaml_output_directory = "src/main/python/semiwrap", suggested_update_target = "//:write_all", target_compatible_with = robotpy_compatibility_select(), visibility = ["//visibility:public"], + diff_args = ["-u"], ) def scan_headers(name, pyproject_toml, package_root_file, extra_hdrs, pkgcfgs): diff --git a/wpilibc/BUILD.bazel b/wpilibc/BUILD.bazel index f346d2a3ee..114dad25bc 100644 --- a/wpilibc/BUILD.bazel +++ b/wpilibc/BUILD.bazel @@ -76,6 +76,7 @@ generate_version_file( write_source_files( name = "write_wpilibc", + diff_args = ["-u"], files = { "src/generated": ":generate_wpilibc", }, diff --git a/wpilibcExamples/BUILD.bazel b/wpilibcExamples/BUILD.bazel index 9f8ed500f7..739021381f 100644 --- a/wpilibcExamples/BUILD.bazel +++ b/wpilibcExamples/BUILD.bazel @@ -30,6 +30,7 @@ genrule( write_source_file( name = "write_example_project_list", + diff_args = ["-u"], in_file = ":generate_bazel_files_rule", out_file = "example_projects.bzl", suggested_update_target = "//:write_all", diff --git a/wpilibj/BUILD.bazel b/wpilibj/BUILD.bazel index 89c065bde8..69a6a8e9bf 100644 --- a/wpilibj/BUILD.bazel +++ b/wpilibj/BUILD.bazel @@ -51,6 +51,7 @@ generate_wpilibj( write_source_files( name = "write_wpilibj", + diff_args = ["-u"], files = { "src/generated": ":generate_wpilibj", }, diff --git a/wpilibjExamples/BUILD.bazel b/wpilibjExamples/BUILD.bazel index 2ddedb4452..6fbed92c3c 100644 --- a/wpilibjExamples/BUILD.bazel +++ b/wpilibjExamples/BUILD.bazel @@ -28,6 +28,7 @@ genrule( write_source_file( name = "write_example_project_list", + diff_args = ["-u"], in_file = ":generate_bazel_files_rule", out_file = "example_projects.bzl", suggested_update_target = "//:write_all", diff --git a/wpimath/BUILD.bazel b/wpimath/BUILD.bazel index 378f8cdf1b..0f06bf27e9 100644 --- a/wpimath/BUILD.bazel +++ b/wpimath/BUILD.bazel @@ -91,6 +91,7 @@ generate_wpimath( write_source_files( name = "write_wpimath", + diff_args = ["-u"], files = { "src/generated": ":generate_wpimath", }, diff --git a/wpiunits/BUILD.bazel b/wpiunits/BUILD.bazel index b97e0e60ce..bede2fa4a2 100644 --- a/wpiunits/BUILD.bazel +++ b/wpiunits/BUILD.bazel @@ -22,6 +22,7 @@ generate_wpiunits( write_source_files( name = "write_wpiunits", + diff_args = ["-u"], files = { "src/generated": ":gen_units", }, diff --git a/wpiutil/BUILD.bazel b/wpiutil/BUILD.bazel index bd175aa2ef..18a5898b0d 100644 --- a/wpiutil/BUILD.bazel +++ b/wpiutil/BUILD.bazel @@ -77,6 +77,7 @@ generate_wpiutil( write_source_files( name = "write_wpiutil", + diff_args = ["-u"], files = { "src/generated/test/native/cpp": ":generate_wpiutil", },