forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workspace] Deprecate the stduuid external (RobotLocomotion#18610)
Co-Authored-By: Betsy McPhail <[email protected]> Co-Authored-By: Matthew Woehlke <[email protected]> Co-Authored-By: Russ Tedrake <[email protected]>
- Loading branch information
1 parent
cfc9456
commit 500bce4
Showing
9 changed files
with
99 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- python -*- | ||
|
||
# This file exists to make our directory into a Bazel package, so that our | ||
# neighboring *.bzl file can be loaded elsewhere. | ||
|
||
load("//tools/lint:lint.bzl", "add_lint_tests") | ||
|
||
add_lint_tests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- python -*- | ||
|
||
load( | ||
"@drake//tools/install:install.bzl", | ||
"install", | ||
) | ||
|
||
licenses(["notice"]) # MIT | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# TODO(jwnimmer-tri) Once we require >= C++20, i.e., once we drop support for | ||
# Ubuntu 20.04 Focal, then we should remove the thus-unused gsl cc_library. | ||
cc_library( | ||
name = "gsl", | ||
hdrs = glob(["gsl/*"], allow_empty = False), | ||
includes = ["."], | ||
linkstatic = 1, | ||
) | ||
|
||
cc_library( | ||
name = "stduuid", | ||
hdrs = ["include/uuid.h"], | ||
strip_include_prefix = "include", | ||
include_prefix = "drake_vendor", | ||
linkstatic = 1, | ||
deps = [":gsl"], | ||
) | ||
|
||
# Install the license file. | ||
install( | ||
name = "install", | ||
docs = ["LICENSE"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Add vendoring namespace and disable std::hash | ||
|
||
This prevents ODR violations in case downstream code also links to stduuid. | ||
|
||
--- include/uuid.h | ||
+++ include/uuid.h | ||
@@ -49,6 +49,7 @@ | ||
|
||
#endif | ||
|
||
+inline namespace drake_vendor __attribute__ ((visibility ("hidden"))) { | ||
namespace uuids | ||
{ | ||
#ifdef __cpp_lib_span | ||
@@ -900,7 +901,9 @@ | ||
}; | ||
#endif | ||
} | ||
+} // namespace drake_vendor | ||
|
||
+#if 0 // Disable std::hash<> specialization. | ||
namespace std | ||
{ | ||
template <> | ||
@@ -947,5 +950,6 @@ | ||
} | ||
}; | ||
} | ||
+#endif | ||
|
||
#endif /* STDUUID_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- mode: python -*- | ||
# vi: set ft=python : | ||
|
||
load("@drake//tools/workspace:github.bzl", "github_archive") | ||
|
||
def stduuid_internal_repository( | ||
name, | ||
mirrors = None): | ||
github_archive( | ||
name = name, | ||
repository = "mariusbancila/stduuid", | ||
commit = "3afe7193facd5d674de709fccc44d5055e144d7a", | ||
sha256 = "e11f9bf30c7f9c03d8e9a3a3fd7fe016eb5d8d9b89a2fe2c11b5f049e1d97916", # noqa | ||
build_file = ":package.BUILD.bazel", | ||
patches = [ | ||
":patches/vendor.patch", | ||
], | ||
mirrors = mirrors, | ||
) |