diff --git a/multibody/fem/BUILD.bazel b/multibody/fem/BUILD.bazel index 71021308495d..923830ad87a1 100644 --- a/multibody/fem/BUILD.bazel +++ b/multibody/fem/BUILD.bazel @@ -404,7 +404,7 @@ drake_cc_library( ], deps = [ "//common:unused", - "@petsc", + "@petsc//:petsc_nowarn", ], ) diff --git a/tools/workspace/default.bzl b/tools/workspace/default.bzl index dd162e889f12..59909dee091c 100644 --- a/tools/workspace/default.bzl +++ b/tools/workspace/default.bzl @@ -245,6 +245,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): if "osqp_internal" not in excludes: osqp_internal_repository(name = "osqp_internal", mirrors = mirrors) if "petsc" not in excludes: + # The @petsc external is deprecated in Drake's WORKSPACE and will be + # removed on or after 2023-11-01. petsc_repository(name = "petsc", mirrors = mirrors) if "picosha2" not in excludes: picosha2_repository(name = "picosha2", mirrors = mirrors) diff --git a/tools/workspace/petsc/package.BUILD.bazel b/tools/workspace/petsc/package.BUILD.bazel index afa285e598ed..fbe1e565868c 100644 --- a/tools/workspace/petsc/package.BUILD.bazel +++ b/tools/workspace/petsc/package.BUILD.bazel @@ -147,6 +147,14 @@ cc_library( "@drake//tools/workspace/petsc:stubs", ], visibility = ["//visibility:public"], + deprecation = "The @petsc external is deprecated in Drake's WORKSPACE and will be removed on or after 2023-11-01.", # noqa +) + +# An alias that avoids the deprecation warning (for Drake's internal use only). +cc_library( + name = "petsc_nowarn", + deps = [":petsc"], + visibility = ["//visibility:public"], ) genrule( diff --git a/tools/workspace/petsc/repository.bzl b/tools/workspace/petsc/repository.bzl index 7c7529acfbd2..c4cbac28635e 100644 --- a/tools/workspace/petsc/repository.bzl +++ b/tools/workspace/petsc/repository.bzl @@ -3,6 +3,9 @@ load("@drake//tools/workspace:github.bzl", "github_archive") def petsc_repository( name, mirrors = None): + """The @petsc external is deprecated in Drake's WORKSPACE and will be + removed on or after 2023-11-01. + """ github_archive( name = name, repository = "petsc/petsc",