Fix bazel lint issues #2923

Merged
will-v-pi merged 2 commits from fix-bazel-build into develop 2026-05-06 05:08:15 -05:00
will-v-pi commented 2026-05-06 04:01:02 -05:00 (Migrated from github.com)

Fixes bazel lint issues and bazel 9 build introduced by merging the low power PR

Also improves output from lint check - now prints the single command to run to reformat the files that need it, and prints the other errors more clearly

See this job for the new output, also copied here:

[ERROR] ERROR: One or more buildifier checks failed.

/src/rp2_common/hardware_rosc/BUILD.bazel:5: native-cc-library: Function "cc_library" is not global anymore and needs to be loaded from "@rules_cc//cc:cc_library.bzl". (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#native-cc-library)
/src/rp2_common/pico_low_power/BUILD.bazel:5: native-cc-library: Function "cc_library" is not global anymore and needs to be loaded from "@rules_cc//cc:cc_library.bzl". (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#native-cc-library)
/test/fixed_bitset_test/BUILD.bazel:1: load: Loaded symbol "cc_binary" is unused. Please remove it.
/test/fixed_bitset_test/BUILD.bazel:2: load: Loaded symbol "compatible_with_rp2" is unused. Please remove it.

These files require reformatting:
  /src/common/pico_base_headers/BUILD.bazel
  /src/common/pico_util/BUILD.bazel
  /src/rp2_common/BUILD.bazel
  /src/rp2_common/pico_low_power/BUILD.bazel
  /src/rp2_common/pico_runtime_init/BUILD.bazel
  /test/pico_low_power_test/BUILD.bazel

To automatically fix formatting issues in the files requiring reformatting, run:
  bazel run @buildifier_prebuilt//:buildifier -- $(pwd)/src/common/pico_base_headers/BUILD.bazel $(pwd)/src/common/pico_util/BUILD.bazel $(pwd)/src/rp2_common/BUILD.bazel $(pwd)/src/rp2_common/pico_low_power/BUILD.bazel $(pwd)/src/rp2_common/pico_runtime_init/BUILD.bazel $(pwd)/test/pico_low_power_test/BUILD.bazel

To run the checks manually on a file, run:
  bazel run @buildifier_prebuilt//:buildifier -- --mode=check --lint=warn <file>
Fixes bazel lint issues and bazel 9 build introduced by merging the low power PR Also improves output from lint check - now prints the single command to run to reformat the files that need it, and prints the other errors more clearly See [this job](https://github.com/raspberrypi/pico-sdk/actions/runs/25425752432/job/74578579412) for the new output, also copied here: ``` [ERROR] ERROR: One or more buildifier checks failed. /src/rp2_common/hardware_rosc/BUILD.bazel:5: native-cc-library: Function "cc_library" is not global anymore and needs to be loaded from "@rules_cc//cc:cc_library.bzl". (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#native-cc-library) /src/rp2_common/pico_low_power/BUILD.bazel:5: native-cc-library: Function "cc_library" is not global anymore and needs to be loaded from "@rules_cc//cc:cc_library.bzl". (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#native-cc-library) /test/fixed_bitset_test/BUILD.bazel:1: load: Loaded symbol "cc_binary" is unused. Please remove it. /test/fixed_bitset_test/BUILD.bazel:2: load: Loaded symbol "compatible_with_rp2" is unused. Please remove it. These files require reformatting: /src/common/pico_base_headers/BUILD.bazel /src/common/pico_util/BUILD.bazel /src/rp2_common/BUILD.bazel /src/rp2_common/pico_low_power/BUILD.bazel /src/rp2_common/pico_runtime_init/BUILD.bazel /test/pico_low_power_test/BUILD.bazel To automatically fix formatting issues in the files requiring reformatting, run: bazel run @buildifier_prebuilt//:buildifier -- $(pwd)/src/common/pico_base_headers/BUILD.bazel $(pwd)/src/common/pico_util/BUILD.bazel $(pwd)/src/rp2_common/BUILD.bazel $(pwd)/src/rp2_common/pico_low_power/BUILD.bazel $(pwd)/src/rp2_common/pico_runtime_init/BUILD.bazel $(pwd)/test/pico_low_power_test/BUILD.bazel To run the checks manually on a file, run: bazel run @buildifier_prebuilt//:buildifier -- --mode=check --lint=warn <file> ```
kilograham (Migrated from github.com) reviewed 2026-05-06 04:01:02 -05:00
peterharperuk (Migrated from github.com) approved these changes 2026-05-06 05:06:52 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!2923
No description provided.