chore: bump to Bazel 7.3.1 (#914)

diff --git a/.bazelversion b/.bazelversion
index a8a1887..643916c 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-7.1.2
+7.3.1
diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc
index 59d4d15..4821d32 100644
--- a/.github/workflows/ci.bazelrc
+++ b/.github/workflows/ci.bazelrc
@@ -5,9 +5,6 @@
 # Debug where options came from
 common --announce_rc
 
-# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
-common --test_env=XDG_CACHE_HOME
-
 # Remote build execution
 build:rbe --extra_execution_platforms=@aspect_bazel_lib//platforms:x86_64_linux_remote
 build:rbe --host_platform=@aspect_bazel_lib//platforms:x86_64_linux_remote
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 37d5b8d..6cca60a 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -87,6 +87,9 @@
           - "e2e/smoke"
           - "e2e/write_source_files"
         exclude:
+          # Root workspace is only bzlmod
+          - folder: .
+            bzlmod: 0
           # Don't test MacOS and Windows against secondary bazel version to minimize minutes (billed at 10X and 2X respectively)
           # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
           - os: macos
@@ -124,7 +127,6 @@
           path: |
             ~/.cache/bazel-disk-cache
             ~/.cache/bazel-repository-cache
-            ~/.cache/xdg-cache
           key: bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-${{ hashFiles('.bazelrc', '.bazelversion', '.bazeliskrc', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}
           restore-keys: bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
 
@@ -173,8 +175,6 @@
             --build_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
             --enable_bzlmod=${{ matrix.bzlmod }} \
             //...
-        env:
-          XDG_CACHE_HOME: ~/.cache/xdg-cache # bazelisk will download bazel to here
 
       - name: Integration tests
         # Don't run integration tests on Windows since they are bash scripts and Windows runs Powershell
diff --git a/MODULE.bazel b/MODULE.bazel
index bef9552..f700a07 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -9,7 +9,7 @@
 
 # Lower-bounds (minimum) versions for direct runtime dependencies
 bazel_dep(name = "bazel_skylib", version = "1.5.0")
-bazel_dep(name = "platforms", version = "0.0.8")
+bazel_dep(name = "platforms", version = "0.0.10")
 
 # 0.5.4 is the first version with bzlmod support
 bazel_dep(name = "stardoc", version = "0.6.2", repo_name = "io_bazel_stardoc")
@@ -73,6 +73,9 @@
 host.host()
 use_repo(host, "aspect_bazel_lib_host")
 
+host_platform = use_extension("@platforms//host:extension.bzl", "host_platform", dev_dependency = True)
+use_repo(host_platform, "host_platform")
+
 bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
 bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
 bazel_dep(name = "bazel_features", version = "0.2.0", dev_dependency = True)
diff --git a/lib/private/BUILD.bazel b/lib/private/BUILD.bazel
index 384aa23..84f1b0f 100644
--- a/lib/private/BUILD.bazel
+++ b/lib/private/BUILD.bazel
@@ -262,8 +262,15 @@
     name = "platform_utils",
     srcs = [
         "platform_utils.bzl",
+        "@host_platform//:constraints.bzl",  # keep
         "@local_config_platform//:constraints.bzl",  # keep
-    ],
+        "@platforms//host:constraints.bzl",  # keep
+    ] + (select({
+        "@aspect_bazel_lib//lib:bzlmod": [],
+        "//conditions:default": [
+            "@internal_platforms_do_not_use//host:constraints.bzl",  # keep
+        ],
+    }) if is_bazel_7_or_greater() else []),
     visibility = ["//lib:__subpackages__"],
     deps = [],  # keep
 )