Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions modules/pico-sdk/2.2.1-develop.bcr.20250915-8fcd44a1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
module(
name = "pico-sdk",
version = "2.2.1-develop.bcr.20250915-8fcd44a1",
)

bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_python", version = "0.36.0")
bazel_dep(name = "picotool", version = "2.2.0")
bazel_dep(name = "rules_cc", version = "0.0.10")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "arm_gcc_linux-aarch64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
)

http_archive(
name = "arm_gcc_linux-x86_64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
)

http_archive(
name = "arm_gcc_win-x86_64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
)

http_archive(
name = "arm_gcc_mac-x86_64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
)

http_archive(
name = "arm_gcc_mac-aarch64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
)

http_archive(
name = "clang_linux-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "82302f8f0d9cb1062e60756147403c1525e965e1d7b777fab8076c74c7a5a19b",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/linux-amd64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c",
)

http_archive(
name = "clang_win-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "2e9b8ac889838754e5305b6fd73c7bba7a6ec7364f1ce8ac60268b6d3bc61e6c",
type = "zip",
# Windows doesn't like `:` in the produced filename, so replace it with `%3A`.
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/windows-amd64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c".replace("git_revision:", "git_revision%3A"),
)

http_archive(
name = "clang_mac-x86_64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "d3f2ef6f391ef66141092cfdf07facd18d2587a25616e1251e6e6b13b05ab3df",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-amd64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c",
)

http_archive(
name = "clang_mac-aarch64",
build_file = "//bazel/toolchain:clang.BUILD",
sha256 = "61109b8464e9213ef8b9bfe55ce56298b94d4c66eaea308cf2b6556b0b85429e",
type = "zip",
url = "https://chrome-infra-packages.appspot.com/dl/fuchsia/third_party/clang/mac-arm64/+/git_revision:910be4ff90d7d07bd4518ea03b85c0974672bf9c",
)

new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")

# TODO: Provide tinyusb as a proper Bazel module.
new_git_repository(
name = "tinyusb",
build_file = "//src/rp2_common/tinyusb:tinyusb.BUILD",
commit = "86ad6e56c1700e85f1c5678607a762cfe3aa2f47", # keep-in-sync-with-submodule: lib/tinyusb
remote = "https://github.com/hathach/tinyusb.git",
)

# TODO: Provide btstack as a proper Bazel module.
new_git_repository(
name = "btstack",
build_file = "//src/rp2_common/pico_btstack:btstack.BUILD",
commit = "501e6d2b86e6c92bfb9c390bcf55709938e25ac1", # keep-in-sync-with-submodule: lib/btstack
remote = "https://github.com/bluekitchen/btstack.git",
)

# TODO: Provide cyw43-driver as a proper Bazel module.
new_git_repository(
name = "cyw43-driver",
build_file = "//src/rp2_common/pico_cyw43_driver:cyw43-driver.BUILD",
commit = "dd7568229f3bf7a37737b9e1ef250c26efe75b23", # keep-in-sync-with-submodule: lib/cyw43-driver
remote = "https://github.com/georgerobotics/cyw43-driver.git",
)

# TODO: Provide lwip as a proper Bazel module.
new_git_repository(
name = "lwip",
build_file = "//src/rp2_common/pico_lwip:lwip.BUILD",
commit = "77dcd25a72509eb83f72b033d219b1d40cd8eb95", # keep-in-sync-with-submodule: lib/lwip
remote = "https://github.com/lwip-tcpip/lwip.git",
)

new_git_repository(
name = "mbedtls",
build_file = "//src/rp2_common/pico_mbedtls:mbedtls.BUILD",
commit = "107ea89daaefb9867ea9121002fbbdf926780e98", # keep-in-sync-with-submodule: lib/mbedtls
remote = "https://github.com/Mbed-TLS/mbedtls.git",
)

register_toolchains(
"//bazel/toolchain:linux-aarch64-rp2040",
"//bazel/toolchain:linux-aarch64-rp2350",
"//bazel/toolchain:linux-x86_64-rp2040",
"//bazel/toolchain:linux-x86_64-rp2350",
"//bazel/toolchain:win-x86_64-rp2040",
"//bazel/toolchain:win-x86_64-rp2350",
"//bazel/toolchain:mac-x86_64-rp2040",
"//bazel/toolchain:mac-x86_64-rp2350",
"//bazel/toolchain:mac-aarch64-rp2040",
"//bazel/toolchain:mac-aarch64-rp2350",
# Require users to opt-in to the Pico SDK's toolchains.
dev_dependency = True,
)

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
python_version = "3.9",
)

use_repo(python, "pythons_hub")
register_toolchains(
"@pythons_hub//:all",
dev_dependency = True,
)
register_toolchains(
"@rules_python//python/runtime_env_toolchains:all",
dev_dependency = True,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/MODULE.bazel b/MODULE.bazel
index 111ed24c..6c072d11 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -1,6 +1,6 @@
module(
name = "pico-sdk",
- version = "2.2.1-develop",
+ version = "2.2.1-develop.bcr.20250915-8fcd44a1",
)

bazel_dep(name = "platforms", version = "0.0.9")
14 changes: 14 additions & 0 deletions modules/pico-sdk/2.2.1-develop.bcr.20250915-8fcd44a1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
matrix:
platform:
- ubuntu2004
- macos
- macos_arm64
bazel:
- 7.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@pico-sdk//src/host/pico_stdlib'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "git_repository",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reason we are switching to git_repository? It won't benefit from source archive download cache like http_archive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to avoid the archive stability problem for pre-releases. Maybe it's an unwarranted fear since there's many entries in the BCR with unstable archives. If you think this tradeoff isn't worth it, I can avoid it in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The community just set up a BCR source archive mirror at bcr.cloudflaremirrors.com, see bazel-contrib/bazelrc-preset.bzl#88. I think the unstable archive issue will be largely mitigated by this.

"remote": "https://github.com/raspberrypi/pico-sdk.git",
"commit": "8fcd44a1718337861214ba5499a8faceea2bfa1d",
"patch_strip": 1,
"patches": {
"0001-Patch-version-string.patch": "sha256-O4aYyU1INnDA+pv0Iw1ogAvUIUOONDpZ6Mdpr6PhQnw="
}
}
3 changes: 2 additions & 1 deletion modules/pico-sdk/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"2.1.0",
"2.1.1-develop.bcr.20250113-4b6e6475",
"2.1.1",
"2.2.0"
"2.2.0",
"2.2.1-develop.bcr.20250915-8fcd44a1"
],
"yanked_versions": {}
}
Loading