Skip to content
Draft
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c21cb13
wip: point to Taylor's fork as of 0b45c6d
tyler-yankee Mar 17, 2026
e0a4068
wip: re-spell mypy to uv; add lief
tyler-yankee Mar 17, 2026
d3ae87a
wip: update ref to macOS argument
tyler-yankee Mar 17, 2026
ec0aa6c
wip: re-spell more refs to setup/{mypy -> uv}
tyler-yankee Mar 17, 2026
a69289d
wip: deps is a list!
tyler-yankee Mar 17, 2026
5b9cf09
wip: there is a new implib module
tyler-yankee Mar 17, 2026
fe53326
wip: add cxxfilt_internal as another new dep of implib_so_internal
tyler-yankee Mar 17, 2026
cd61bab
wip: lazy_load mosek on macOS
tyler-yankee Mar 17, 2026
b69437a
point to new implib rev
tyler-yankee Mar 18, 2026
33fe284
wip: also disable lazy load when mosek disabled
tyler-yankee Mar 19, 2026
22559e5
point to new implib rev
tyler-yankee Mar 24, 2026
f38e428
lint
tyler-yankee Mar 24, 2026
240c0eb
wip: make gen_implib a rule
tyler-yankee Mar 25, 2026
69f3668
lint
tyler-yankee Apr 2, 2026
d20fe8b
remove 'wheel' dependency
tyler-yankee Apr 2, 2026
db72eca
more lint
tyler-yankee Apr 2, 2026
77aa401
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee Apr 2, 2026
08a652c
remove cxxfilt
tyler-yankee Apr 2, 2026
dcb3e88
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee Apr 13, 2026
d6709d6
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee Apr 13, 2026
084982e
bump implib to latest revision
tyler-yankee Apr 13, 2026
3dc6493
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee Apr 14, 2026
efb4a8d
bumping implib
tyler-yankee Apr 14, 2026
7f2e723
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee Apr 15, 2026
15033b4
bumping implib for more cleanup
tyler-yankee Apr 15, 2026
c4d08cc
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee May 18, 2026
31f324a
bump implib to upstream PR
tyler-yankee May 18, 2026
ba6d89f
wip: split mypy and lief hubs
tyler-yankee May 18, 2026
810cb56
venv_upgrade
tyler-yankee May 18, 2026
9405850
fixups
tyler-yankee May 18, 2026
d38a471
Merge branch 'master' into implib-mac-whl
tyler-yankee Jun 15, 2026
1d2d1c2
Merge remote-tracking branch 'upstream/master' into implib-mac-whl
tyler-yankee Jun 29, 2026
03d44c9
bump implib
tyler-yankee Jun 29, 2026
d553c8d
Merge branch 'master' into implib-mac-whl
tyler-yankee Jul 15, 2026
b117a8f
lief 1.0.0
tyler-yankee Jul 15, 2026
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
9 changes: 7 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,18 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

[
pip.parse(
hub_name = "drake_mypy",
hub_name = "drake_{hub}".format(hub = hub),
python_version = python_version,
requirements_lock = "//setup:python/mypy/requirements.txt",
requirements_lock = "//setup:python/{hub}/requirements.txt".format(hub = hub),
)
for python_version in PYTHON_VERSIONS
for hub in [
"lief",
"mypy",
]
]

use_repo(pip, "drake_lief")
use_repo(pip, "drake_mypy")

# Load dependencies which are "public", i.e., made available to downstream
Expand Down
19 changes: 19 additions & 0 deletions setup/python/lief/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
load("@rules_python//python/uv:lock.bzl", "lock")
load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])

lock(
name = "lock",
srcs = ["requirements.in"],
out = "requirements.txt",
args = [
"--upgrade",
"--universal",
# This is our minimum supported version.
# When changing this, see drake/tools/workspace/python/README.md.
"--python-version=3.12",
],
)

add_lint_tests()
1 change: 1 addition & 0 deletions setup/python/lief/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lief
79 changes: 79 additions & 0 deletions setup/python/lief/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This file was autogenerated by uv via the following command:
# bazel run //setup/python/lief:lock.update
lief==0.17.6 \
--hash=sha256:04a6f26bd92a63af6860a270761fc2773a8b6b262cc9397b176c21c2c0cb5153 \
--hash=sha256:04b07e91213ce345febb4698efd310c6745f48190a1d7ce5dd0e7b306839362d \
--hash=sha256:054e7a1b2dcfb2e62acbabef0be8d52d2adc6c1f9451700b988f08aadee3c024 \
--hash=sha256:0aca84f35ec67854ffdb38a23b1848cb214df3e3f95eb7579bac3107e9f68cc8 \
--hash=sha256:0dec797538b9bfa2ef415532cec6ef7b739ef9d3dc5af0f848ba90d6e6045e31 \
--hash=sha256:12db9cce6644b11b1cfa5c228574ae52d37121d1a8380266b2b3eb0721aa5b98 \
--hash=sha256:17371938a85fcf64febb9eca77beb6537daa418fd3f86511e5ae402dc8bc2866 \
--hash=sha256:1b8339f385b64bf9da42ac8f5d5fc4c9f4235c4d9d804e472ffe8f1fddc830cb \
--hash=sha256:1df9b22f3851de7d0e86a8731ad07e47ca562ebe430605d90aecfcd6d20125d0 \
--hash=sha256:22a96028fd5fc7607b1b2213aa88ac13be89e50709b36d2a6fcd6fdb3333c3c4 \
--hash=sha256:234a422fe7158e755ac0acdd0bfdfd41f75392dad9dac147dd3b9c7a9f1a6811 \
--hash=sha256:27cabac8f34885294b63e814952686453b59bce35ffb0c7d12e722adef389cd2 \
--hash=sha256:2c3130841c30743f549a84606b2108e71819f5f7a6f9932baaa845841e83f1f9 \
--hash=sha256:2f669d5b4e63c6e66cac48e07d0f23436bf898ec9d0630016d23250e2eb43d28 \
--hash=sha256:347495918478606fc47d90a503791c308812f0a3ef5200b2c1e577e0bebd7c7e \
--hash=sha256:365bf48528339a0d9a5c993b0a54f5c3bb8fcd11ca85797c79f9ae6179777492 \
--hash=sha256:379efbaa54655fd7b423536ceddb255c52073ce341b908be25775d99578497e1 \
--hash=sha256:3a0678eafed01245d98187815714bdd602f285b8c9a05a4982ff9ddf82360717 \
--hash=sha256:3ae021be2d65ea6f522884356c152ddf25d16674bab00240b04abe83c1cd5cb8 \
--hash=sha256:3bd852c4d934d9c8357d6b9491db85e6722bc0076249f8b23a205a8912a85ed5 \
--hash=sha256:3e380832cc49a3f460b2b5ee672a6127db94fad0a1226cc8c66cbffa9bd09582 \
--hash=sha256:3e59a64012a602772270aa1a930cff9c39cddca42f0ca5d7f1959f4dd951f38e \
--hash=sha256:41fc73285cce73f668dbc902b4ae7388a02cace7fe0c03603a1e42608f84003c \
--hash=sha256:45fd98016f5743f81f635628c2efc25becda80caa22cfc03bd002f359bcb7f71 \
--hash=sha256:4e03969294b3be2728162fd3ce15f9f6d1571ba05f62abbb6aa9512c656e22c3 \
--hash=sha256:503fd8df6425a6c0386df9ca6e4f4ce29d07d268f0620ee1d4059eb4d48c2562 \
--hash=sha256:51b6c5932d4f36d61fb17fe783d9e1bfba33ec1d72b3d07486c96e6f548781ff \
--hash=sha256:520e5f8a7b1e2487630e27639751d9fb13c94205fed72d358a87994e44a73815 \
--hash=sha256:5a34d651eb82e24a113f837b1a961d23e155be41d72bf39a37407854c6597a8b \
--hash=sha256:5ba237d5984262b383531c629432cba97552a13818624e0d2a0ce099f06be161 \
--hash=sha256:5df55be6cd29c654b8a205846d67637955063ad0cfd83875451f339cf623b101 \
--hash=sha256:5fce8968fd47e103aa4df35e1efd0b61bde4921952d7cf0fd668facff648f3f5 \
--hash=sha256:6324add89c366607a6d652553e4cac6309e952ca638c24f38a8b00331f064a50 \
--hash=sha256:6484de5a7053c1b7022cb93f41450532f93daaf6b5ce6421c682b87fd2cd2122 \
--hash=sha256:68cc28da07bd50a530590a56142c809a68035f29ace0b107046b0e0784650f50 \
--hash=sha256:6d4eb8adce400af52cc174ac5cbe40ab10b9df5824193975d12e2d4f85b298a3 \
--hash=sha256:6dce8652883b5b7fe06b5416807a8bc3cc4c1ab3e498512d242c38925e8a7d77 \
--hash=sha256:70671623b9b1cf55a688d0365789dd048426075ff6368c42270b224605c4b078 \
--hash=sha256:7384abed26200f8c6cb50ca9cedac70e7452e85fe72e82d4c5e9050c78eff0ae \
--hash=sha256:7b690c719abf67632701ff69e14a22610eef79100b51abc5e7fbdc70a3d19504 \
--hash=sha256:7b7759b443745d0e5211d87723c0a84c4a74364ef6194cc8f8d315d98d117648 \
--hash=sha256:7dcefa6467f0f0d75413a10e7869e488344347f0c67eff5bc49ec216714f0674 \
--hash=sha256:8561a156ccea562e200e5bde0db8070785e3194fcd0ddf9109c8470970978076 \
--hash=sha256:88fb786338aeb4f6812ff6d079415e44f3696b826410b9504a9f710cc962ebe5 \
--hash=sha256:8f39f68a8d8666622aa0300b4f13b30c8bf91a1f0c2f6e3eb47af8813544719b \
--hash=sha256:918ea953830ecf348e5a8d9cf0b1a178035d6d4032bf2a9aa1dc72483e06b3a1 \
--hash=sha256:94463d54bc5ecce9e3ae3855a084bacd5b473a23c1a080746bf54a0ed0339255 \
--hash=sha256:a2905d56f54eeb146682daf341dde14928d9f4d32ca047e995a4548a348ad3cd \
--hash=sha256:a6935a08a7b3285d0cf053d852fd739475fea15572b5559160a88d284987e995 \
--hash=sha256:a74f792564a5e69915d08530618d79aa1fd8b5e7b72513fac765e1106c63f57a \
--hash=sha256:acd673591c870bdedfd5e583c423fb67bbd99e00eb1852061f0dec6a918d4634 \
--hash=sha256:af39643ab79ae644d2063a2ef93de908e61a8f40e37b155683c477c1928e6c64 \
--hash=sha256:b5885e8a422066f3691b9707045b85d9728eaba621991def0b4e0044b0b0b063 \
--hash=sha256:ba6fb4f5926f3631e0de13218bedce0cc6b229c7eb84fae095f0985385c8beb1 \
--hash=sha256:bd94782164176baee7f08a1e633376f26a5486edfd230c4a3fb351e49108bfd0 \
--hash=sha256:c2164243f152e82c49b0ccd606155b758644f4b1ee221f0dbd4da055469a922f \
--hash=sha256:c5a19642e42578fe0b701bd86b10dd7e86d69c35c67d25ac1433f72410a7c2bb \
--hash=sha256:c8129a70bc73e04fd9db4f49f386d4336a3a78ceef07c83ca74f9cf464c03c22 \
--hash=sha256:c9cfcd463bbbe7cabb2fed9d22211ba1337775cf07f4d754da24c3c3f5c426d5 \
--hash=sha256:d5a936d3cec06e808e49e216076f47f25142184b593e5e4c31d6e068d4dc8f77 \
--hash=sha256:da6b97ae3d91a953a93def5dedfb61b098b204d3d4a75dcd592ad8570cb5a2ff \
--hash=sha256:dbe04dda79f5d17c5b2d1b381997d93aa039f59c7c52b9fe48d398dda9cce8ea \
--hash=sha256:dbfe15d3d21d389857dac8cedc04f03f8ef98c5503e5e147a34480ecbf351826 \
--hash=sha256:de5716279c82640359fe59137ec0572a1ed9859051c1d901de593d6e0e99d9c8 \
--hash=sha256:e186ac1ea8a5f4729c4b8d2b7f2fe6c55dbf1eddd8bc15fa4d19ed08dfa6cc54 \
--hash=sha256:e1ded9ee9b5184b5753e4823343e3550a623d34f5407cb2f8d7918e17856d860 \
--hash=sha256:e29552f52749249c9b05041d96d9156de20207d745916d599b4eb49ee7a8e1bf \
--hash=sha256:eaa294b19ab9cc7bcb18462b964cd3f12f294cba2f256a5b4588633a5c8fb172 \
--hash=sha256:ef618117ec33665697e3d1fe9c15fac8d6c42e2eeaf4aca9c31ea12fdb056c67 \
--hash=sha256:f24fa49f0fe3f7d350aa87610fc5765890b18272c2aafaf720a10b2be0675154 \
--hash=sha256:f471fa92430de76b84aa9d036d7fa7cd14256a81814fd3a055d156462fb5bb56 \
--hash=sha256:f764c77c848cf7478623e754099f50699d5e23b5bc4a34ce68cd20af7e0b5541 \
--hash=sha256:fb8ea20af86b25b852d7fa4ba96cdaab2184b1a1529469786b2474dc2e1be446 \
--hash=sha256:fc6541fdf8958e8bfadc91f8c79e6aa8e2cca74ac8bb2aaf74bf946057d7cf1d \
--hash=sha256:fccb2c1cc3e6e2e5395d73b13c0198b69afa8a80cd80ac5b121efffa00faf594
# via -r setup/python/lief/requirements.in
17 changes: 1 addition & 16 deletions setup/python/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion setup/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ wheel = [
"auditwheel; sys_platform == 'linux'",
"build",
"delocate; sys_platform == 'darwin'",
"wheel; sys_platform == 'darwin'",
]

[tool.pdm]
Expand Down
2 changes: 1 addition & 1 deletion tools/wheel/image/build-drake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cat > /tmp/drake-wheel-build/drake-build/drake.bazelrc << EOF
build --disk_cache=/var/cache/bazel/disk_cache
build --repository_cache=/var/cache/bazel/repository_cache
build --repo_env=DRAKE_WHEEL=1
# Enable MOSEK lazy loading. Right now this is only done for Linux builds.
# Enable MOSEK lazy loading.
build --@drake//solvers:mosek_lazy_load=True
EOF

Expand Down
36 changes: 0 additions & 36 deletions tools/wheel/image/build-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,42 +131,6 @@ python -m build --wheel

if [[ "$(uname)" == "Darwin" ]]; then
delocate-wheel -w wheelhouse -v dist/drake*.whl

# Remove libmosek from wheels.
if [[ -n "${MOSEK_ENABLED}" ]]; then
for w in wheelhouse/drake*.whl; do
mkdir fixup-wheel
wheel unpack --dest fixup-wheel "$w"

rm fixup-wheel/drake-*/pydrake/lib/libmosek*
rm fixup-wheel/drake-*/pydrake/lib/libtbb*
rm fixup-wheel/drake-*/pydrake/doc/mosek/mosek-eula.pdf
rm fixup-wheel/drake-*/pydrake/doc/mosek/LICENSE.third_party

change_lpath \
--old='@loader_path/libtbb' \
--old='@loader_path/libmosek' \
--new='@loader_path/../../mosek/libtbb' \
--new='@loader_path/../../mosek/libmosek' \
fixup-wheel/drake-*/pydrake/lib/*.so
change_lpath \
--old='@loader_path/lib/libtbb' \
--old='@loader_path/lib/libmosek' \
--new='@loader_path/../mosek/libtbb' \
--new='@loader_path/../mosek/libmosek' \
fixup-wheel/drake-*/pydrake/*.so
change_lpath \
--old='@loader_path/../lib/libtbb' \
--old='@loader_path/../lib/libmosek' \
--new='@loader_path/../../mosek/libtbb' \
--new='@loader_path/../../mosek/libmosek' \
fixup-wheel/drake-*/pydrake/*/*.so

rm "$w"
wheel pack --dest wheelhouse fixup-wheel/drake-*/
rm -rf fixup-wheel
done
fi
else
GLIBC_VERSION=$(ldd --version | sed -n '1{s/.* //;s/[.]/_/p}')

Expand Down
6 changes: 3 additions & 3 deletions tools/wheel/macos/build-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ cat > "$build_root/drake.bazelrc" << EOF
build --disk_cache=$HOME/.cache/drake-wheel-build/bazel/disk_cache
build --repository_cache=$HOME/.cache/drake-wheel-build/bazel/repository_cache
build --repo_env=DRAKE_WHEEL=1
# Enable MOSEK lazy loading.
build --@drake//solvers:mosek_lazy_load=True
# See tools/wheel/wheel_builder/macos.py for more on this env variable.
build --macos_minimum_os="${MACOSX_DEPLOYMENT_TARGET}"
EOF
Expand All @@ -56,9 +58,7 @@ EOF
# for other mentions of MOSEK version bounds and fix those as well.
WITH_MOSEK=ON
PYTHON_MINOR=$($python_executable -c "import sys; print(sys.version_info.minor)")
if [[ ${PYTHON_MINOR} -ge 15 ]]; then
WITH_MOSEK=OFF
fi
[ ${PYTHON_MINOR} -ge 15 ] && WITH_MOSEK=OFF

# Install Drake.
# N.B. When you change anything here, also fix wheel/image/build-drake.sh.
Expand Down
4 changes: 4 additions & 0 deletions tools/workspace/implib_so_internal/package.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- bazel -*-

load("@drake//tools/skylark:py.bzl", "py_binary")
load("@drake_lief//:requirements.bzl", lief_requirement = "requirement")

py_binary(
name = "gen",
Expand All @@ -13,6 +14,9 @@ py_binary(
python_version = "PY3",
srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
lief_requirement("lief"),
],
)

exports_files(["drake_repository_metadata.json"])
6 changes: 3 additions & 3 deletions tools/workspace/implib_so_internal/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ def implib_so_internal_repository(
mirrors = None):
github_archive(
name = name,
repository = "yugr/Implib.so",
commit = "30e547b2e8d608f7cd69bc8ec88d047034a40e35",
sha256 = "0f5e111ce0648215a288c273639a045bde1f1b40139fbd85d06fd25e03af13a2", # noqa
repository = "TaylorSasser/Implib.so",
commit = "3a94ebf1b26e021cfa8c2202e4f4c7b31eab8eec",
sha256 = "32aba7aed862d34b8b1e5353c2a69479a61b4e88b7e9388c634161827cb16a40", # noqa
build_file = ":package.BUILD.bazel",
mirrors = mirrors,
)
36 changes: 36 additions & 0 deletions tools/workspace/mosek/gen_implib.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
_PY_CC_TOOLCHAIN_TYPE = "@rules_python//python/cc:toolchain_type"

def _impl(ctx):
args = ctx.actions.args()
args.add("--dlopen-callback", ctx.attr.dlopen_callback)
args.add("--outdir", ctx.outputs.outs[0].dirname)
args.add(ctx.file.src.path)

py_toolchain = ctx.toolchains[_PY_CC_TOOLCHAIN_TYPE]

ctx.actions.run(
mnemonic = "GenImplib",
executable = ctx.executable.tool,
arguments = [args],
inputs = [ctx.file.src],
outputs = ctx.outputs.outs,
)

return [DefaultInfo(
files = depset(ctx.outputs.outs),
)]

gen_implib = rule(
implementation = _impl,
attrs = {
"src": attr.label(allow_single_file = True, mandatory = True),
"tool": attr.label(
mandatory = True,
executable = True,
cfg = "target",
),
"dlopen_callback": attr.string(mandatory = True),
"outs": attr.output_list(mandatory = True),
},
toolchains = ["@rules_python//python/cc:toolchain_type"],
)
9 changes: 5 additions & 4 deletions tools/workspace/mosek/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@drake//tools/install:install.bzl", "install", "install_files")
load("@drake//tools/skylark:cc.bzl", "cc_import", "cc_library")
load("@drake//tools/workspace/mosek:gen_implib.bzl", "gen_implib")

package(default_visibility = ["//visibility:private"])

Expand Down Expand Up @@ -89,12 +90,12 @@ _IMPLIB_SRCS = [
"{}.init.c".format(_MOSEK_SO_NAME),
]

genrule(
gen_implib(
name = "_gen_implib",
srcs = [_MOSEK_MAJMIN_GLOB[0]],
src = _MOSEK_MAJMIN_GLOB[0],
outs = _IMPLIB_SRCS,
cmd = "$(execpath @implib_so_internal//:gen) --dlopen-callback=drake_dlopen_mosek --outdir=$(RULEDIR) $<",
tools = ["@implib_so_internal//:gen"],
dlopen_callback = "drake_dlopen_mosek",
tool = "@implib_so_internal//:gen",
)

cc_library(
Expand Down
15 changes: 9 additions & 6 deletions tools/workspace/python/venv_upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# - Users can make edits to drake/setup/python/pyproject.toml, and then
# run this script to compile it to drake/setup/python/pdm.lock.
#
# - Users can make edits to drake/setup/python/mypy/requirements.in, and then
# run this script to compile it to drake/setup/python/mypy/requirements.txt.
# - Users can make edits to drake/setup/python/{hub}/requirements.in, and then
# run this script to compile it to drake/setup/python/{hub}/requirements.txt.
#
# The --reuse option may be given to apply changes to pyproject.toml while
# attempting to preserve existing version pins.
Expand Down Expand Up @@ -117,10 +117,13 @@ done
# Check for changes to the pdm lock file.
files_to_commit+=( "$(git diff --name-only HEAD -- "${lockfile}")" )

# Upgrade the mypy lockfile.
readonly mypy_requirements="./setup/python/mypy/requirements.txt"
bazel run //setup/python/mypy:lock.update
files_to_commit+=( "$(git diff --name-only HEAD -- "${mypy_requirements}")" )
# Upgrade the uv-managed lockfiles.
readonly uv_hubs=("lief" "mypy")
for hub in "${uv_hubs[@]}"; do
hub_requirements="./setup/python/${hub}/requirements.txt"
bazel run //setup/python/${hub}:lock.update
files_to_commit+=( "$(git diff --name-only HEAD -- "${hub_requirements}")" )
done

# If committing, do the commit.
if [ -n "${commit}" ]; then
Expand Down