Commit 5585ddd
authored
[bazel]: de-alias pybind11 headers target (#79676)
In trying to set up python headers in an out-of-tree bazel MLIR project,
I encountered the `pybind11_bazel` project, and found that the
`@python_runtime` target used here is not defined by it.
Instead, it seems that `@python_runtime` is an alias used in some
projects like Tensorflow (see
https://github.com/tensorflow/tensorflow/blob/322936ffdd96ee59e27d028467fe458859cf3855/third_party/python_runtime/BUILD#L7-L7),
where it is aliased to `@local_config_python`. In fact,
`@local_config_python` is defined by `@pybind11_bazel`, and so it seems
that this layer of indirection no longer serves a purpose, and instead
just prevents anyone who doesn't clone Tensorflow's config from using
the python bindings here.
This commit updates the dependent targets to their canonical de-aliased
equivalents, and I suspect this will not even break any downstream users
since the new target is defined in those projects already.
Without this change, running, for example
```
bazel build @llvm-project//mlir:MLIRBindingsPythonCore
```
gives the error
```
no such package '@python_runtime//': The repository '@python_runtime'
could not be resolved: Repository '@python_runtime' is not defined and
referenced by '@llvm-project//mlir:MLIRBindingsPythonCore'
```
Minimal reproduction in https://github.com/j2kun/test_mlir_bazel_pybind,
which, when pointing to a local LLVM repository that has this change
(see `bazel/import_llvm.bzl` in that repository), results in that build
succeeding.
Hat tip to Maksim Levental for going on an hours-long investigation with
me to figure this out.1 parent 7595287 commit 5585ddd
1 file changed
+19
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
873 | 886 | | |
874 | 887 | | |
875 | 888 | | |
| |||
890 | 903 | | |
891 | 904 | | |
892 | 905 | | |
893 | | - | |
| 906 | + | |
894 | 907 | | |
895 | 908 | | |
896 | 909 | | |
| |||
908 | 921 | | |
909 | 922 | | |
910 | 923 | | |
911 | | - | |
| 924 | + | |
912 | 925 | | |
913 | 926 | | |
914 | 927 | | |
| |||
951 | 964 | | |
952 | 965 | | |
953 | 966 | | |
954 | | - | |
| 967 | + | |
955 | 968 | | |
956 | 969 | | |
957 | 970 | | |
| |||
971 | 984 | | |
972 | 985 | | |
973 | 986 | | |
974 | | - | |
| 987 | + | |
975 | 988 | | |
976 | 989 | | |
977 | 990 | | |
| |||
1082 | 1095 | | |
1083 | 1096 | | |
1084 | 1097 | | |
1085 | | - | |
| 1098 | + | |
1086 | 1099 | | |
1087 | 1100 | | |
1088 | 1101 | | |
| |||
1102 | 1115 | | |
1103 | 1116 | | |
1104 | 1117 | | |
1105 | | - | |
| 1118 | + | |
1106 | 1119 | | |
1107 | 1120 | | |
1108 | 1121 | | |
| |||
0 commit comments