From 3d27437809408220cd8a11590dcc09d0c677eb64 Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Fri, 6 Oct 2023 07:15:59 -0700 Subject: [PATCH] Update `rules_python` and `rules_proto`, along with `bazel_rules_hdl` NOTE: Due to the changes in how `rules_python` handles pip dependencies, we've had to add a new step to the startup instructions; users not on Python 3.11 (or not on a similar-enough Linux release) may need to run `bazel run //dependency_support:pip_requirements.update` before building the rest of the code. As a side effect, lets us remove `xls_py_proto_library` wrapper, since internal & external `py_proto_library` rules have converged. PiperOrigin-RevId: 571329808 --- Dockerfile-ubuntu-20.04 | 2 + Dockerfile-ubuntu-20.10 | 3 + Dockerfile-ubuntu-22.04 | 3 + README.md | 5 + WORKSPACE | 10 +- dependency_support/BUILD.bazel | 8 +- dependency_support/initialize_external.bzl | 21 +- dependency_support/load_external.bzl | 21 +- ...p_requirements.txt => pip_requirements.in} | 0 dependency_support/pip_requirements_lock.txt | 209 ++++++++++++++++++ dependency_support/rules_hdl/workspace.bzl | 8 +- docs_src/README.md | 5 + xls/build_rules/py_proto_library.bzl | 28 --- xls/codegen/BUILD | 33 +-- xls/contrib/xlscc/BUILD | 12 +- xls/delay_model/BUILD | 7 +- xls/fuzzer/BUILD | 17 +- xls/ir/BUILD | 19 +- xls/scheduling/BUILD | 7 +- xls/synthesis/BUILD | 14 +- xls/tools/BUILD | 14 +- 21 files changed, 319 insertions(+), 127 deletions(-) rename dependency_support/{pip_requirements.txt => pip_requirements.in} (100%) create mode 100644 dependency_support/pip_requirements_lock.txt delete mode 100644 xls/build_rules/py_proto_library.bzl diff --git a/Dockerfile-ubuntu-20.04 b/Dockerfile-ubuntu-20.04 index 2234cde82a..5bac65566b 100644 --- a/Dockerfile-ubuntu-20.04 +++ b/Dockerfile-ubuntu-20.04 @@ -28,6 +28,8 @@ USER xls-developer ADD --chown=xls-developer . /home/xls-developer/xls/ WORKDIR /home/xls-developer/xls/ +# Update pip dependencies +RUN bazel run -c opt //dependency_support:pip_requirements.update # Build everything (opt) RUN bazel build -c opt ... diff --git a/Dockerfile-ubuntu-20.10 b/Dockerfile-ubuntu-20.10 index 126968e090..b55d2a7c96 100644 --- a/Dockerfile-ubuntu-20.10 +++ b/Dockerfile-ubuntu-20.10 @@ -31,6 +31,9 @@ USER xls-developer ADD --chown=xls-developer . /home/xls-developer/xls/ WORKDIR /home/xls-developer/xls/ +# Update pip dependencies +RUN bazel run -c opt //dependency_support:pip_requirements.update + # Test everything (opt), exclude xlscc for now due to increased build time when # we add Clang. diff --git a/Dockerfile-ubuntu-22.04 b/Dockerfile-ubuntu-22.04 index e8ec91e46f..c90be01747 100644 --- a/Dockerfile-ubuntu-22.04 +++ b/Dockerfile-ubuntu-22.04 @@ -31,6 +31,9 @@ USER xls-developer ADD --chown=xls-developer . /home/xls-developer/xls/ WORKDIR /home/xls-developer/xls/ +# Update pip dependencies +RUN bazel run -c opt //dependency_support:pip_requirements.update + # Test everything (opt), exclude xlscc for now due to increased build time when # we add Clang. diff --git a/README.md b/README.md index 983747a010..0aab7acb97 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,11 @@ bazel 5.2.0 ~/xls$ # This is important. Without this step, you may experience cryptic error messages: ~/xls$ sudo apt install python3-distutils python3-dev libtinfo5 python-is-python3 +~/xls$ # We're also going to update the Python/pip dependency lock file for your Python +~/xls$ # version, since it's locked to one version by default. Without this, you may +~/xls$ # also experience cryptic error messages. +~/xls$ bazel run -c opt -- //xls/dependency_support:pip_requirements.update + ~/xls$ # Now build/test in optimized build mode. ~/xls$ # If you don't plan on using the C++ frontend, which is not needed to get started, ~/xls$ # use this command line: diff --git a/WORKSPACE b/WORKSPACE index 6509183c85..60410ef7f9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -59,8 +59,16 @@ load("//dependency_support:initialize_external.bzl", "initialize_external_reposi initialize_external_repositories() +load("@rules_hdl_pip_deps//:requirements.bzl", rules_hdl_pip_install_deps = "install_deps") + +rules_hdl_pip_install_deps() + +load("@xls_pip_deps//:requirements.bzl", xls_pip_install_deps = "install_deps") + +xls_pip_install_deps() + # Loading the extra deps must be called after initialize_eternal_repositories or -# the call to pip_install fails. +# the call to pip_parse fails. load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") grpc_extra_deps() diff --git a/dependency_support/BUILD.bazel b/dependency_support/BUILD.bazel index bde7573e93..6050f96dd7 100644 --- a/dependency_support/BUILD.bazel +++ b/dependency_support/BUILD.bazel @@ -12,4 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Needed to make this a package. +load("@rules_python//python:pip.bzl", "compile_pip_requirements") + +compile_pip_requirements( + name = "pip_requirements", + requirements_in = "pip_requirements.in", + requirements_txt = "pip_requirements_lock.txt", +) diff --git a/dependency_support/initialize_external.bzl b/dependency_support/initialize_external.bzl index 0ec75554aa..d104a6155d 100644 --- a/dependency_support/initialize_external.bzl +++ b/dependency_support/initialize_external.bzl @@ -14,27 +14,34 @@ """Provides helper that initializes external repositories with third-party code.""" +load("//dependency_support/boost:initialize.bzl", initialize_boost = "initialize") +load("//dependency_support/llvm:initialize.bzl", initialize_llvm = "initialize") load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") +load("@com_grail_bazel_compdb//:deps.bzl", "bazel_compdb_deps") load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains") -load("@rules_hdl//dependency_support:dependency_support.bzl", rules_hdl_dependency_support = "dependency_support") load("@rules_hdl//:init.bzl", rules_hdl_init = "init") -load("@rules_python//python:pip.bzl", "pip_install") -load("//dependency_support/boost:initialize.bzl", initialize_boost = "initialize") -load("//dependency_support/llvm:initialize.bzl", initialize_llvm = "initialize") -load("@com_grail_bazel_compdb//:deps.bzl", "bazel_compdb_deps") +load("@rules_hdl//dependency_support:dependency_support.bzl", rules_hdl_dependency_support = "dependency_support") +load("@rules_hdl//toolchains/cpython:cpython_toolchain.bzl", rules_hdl_register_cpython_repository = "register_cpython_repository") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_python//python:pip.bzl", "pip_parse") +load("@rules_python//python:repositories.bzl", "py_repositories") def initialize_external_repositories(): """Calls set-up methods for external repositories that require that.""" bazel_skylib_workspace() protobuf_deps() + rules_hdl_register_cpython_repository() rules_hdl_init() rules_hdl_dependency_support() rules_closure_dependencies() rules_closure_toolchains() - pip_install( + rules_proto_dependencies() + rules_proto_toolchains() + py_repositories() + pip_parse( name = "xls_pip_deps", - requirements = "@com_google_xls//dependency_support:pip_requirements.txt", + requirements_lock = "@com_google_xls//dependency_support:pip_requirements_lock.txt", python_interpreter = "python3", timeout = 600000, ) diff --git a/dependency_support/load_external.bzl b/dependency_support/load_external.bzl index 426a838a87..9f1b164375 100644 --- a/dependency_support/load_external.bzl +++ b/dependency_support/load_external.bzl @@ -127,13 +127,24 @@ def load_external_repositories(): ], ) - # Released on 2022-04-22, current as of 2022-05-27 - # https://github.com/bazelbuild/rules_python/releases/tag/0.8.1 + # Released on 2022-12-27, current as of 2023-09-27 + # https://github.com/bazelbuild/rules_proto/releases/tag/5.3.0-21.7 + http_archive( + name = "rules_proto", + sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", + strip_prefix = "rules_proto-5.3.0-21.7", + urls = [ + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", + ], + ) + + # Released on 2023-08-22, current as of 2023-09-26 + # https://github.com/bazelbuild/rules_python/releases/tag/0.25.0 http_archive( name = "rules_python", - sha256 = "cdf6b84084aad8f10bf20b46b77cb48d83c319ebe6458a18e9d2cebf57807cdd", - strip_prefix = "rules_python-0.8.1", - url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.8.1.tar.gz", + sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036", + strip_prefix = "rules_python-0.25.0", + url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz", ) http_archive( diff --git a/dependency_support/pip_requirements.txt b/dependency_support/pip_requirements.in similarity index 100% rename from dependency_support/pip_requirements.txt rename to dependency_support/pip_requirements.in diff --git a/dependency_support/pip_requirements_lock.txt b/dependency_support/pip_requirements_lock.txt new file mode 100644 index 0000000000..298589a461 --- /dev/null +++ b/dependency_support/pip_requirements_lock.txt @@ -0,0 +1,209 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# bazel run //dependency_support:pip_requirements.update +# +blinker==1.6.2 \ + --hash=sha256:4afd3de66ef3a9f8067559fb7a1cbe555c17dcbe15971b05d1b625c3e7abe213 \ + --hash=sha256:c3d739772abb7bc2860abf5f2ec284223d9ad5c76da018234f6f50d6f31ab1f0 + # via flask +click==8.1.3 \ + --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \ + --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48 + # via + # -r dependency_support/pip_requirements.in + # flask +flask==2.3.2 \ + --hash=sha256:77fd4e1249d8c9923de34907236b747ced06e5467ecac1a7bb7115ae0e9670b0 \ + --hash=sha256:8c2f9abd47a9e8df7f0c3f091ce9497d011dc3b31effcf4c85a6e2b50f4114ef + # via -r dependency_support/pip_requirements.in +itsdangerous==2.1.2 \ + --hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \ + --hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a + # via + # -r dependency_support/pip_requirements.in + # flask +jinja2==3.1.2 \ + --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ + --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 + # via + # -r dependency_support/pip_requirements.in + # flask +markupsafe==2.1.1 \ + --hash=sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003 \ + --hash=sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88 \ + --hash=sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5 \ + --hash=sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7 \ + --hash=sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a \ + --hash=sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603 \ + --hash=sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1 \ + --hash=sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135 \ + --hash=sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247 \ + --hash=sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6 \ + --hash=sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601 \ + --hash=sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77 \ + --hash=sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02 \ + --hash=sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e \ + --hash=sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63 \ + --hash=sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f \ + --hash=sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980 \ + --hash=sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b \ + --hash=sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812 \ + --hash=sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff \ + --hash=sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96 \ + --hash=sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1 \ + --hash=sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925 \ + --hash=sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a \ + --hash=sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6 \ + --hash=sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e \ + --hash=sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f \ + --hash=sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4 \ + --hash=sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f \ + --hash=sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3 \ + --hash=sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c \ + --hash=sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a \ + --hash=sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417 \ + --hash=sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a \ + --hash=sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a \ + --hash=sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37 \ + --hash=sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452 \ + --hash=sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933 \ + --hash=sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a \ + --hash=sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7 + # via + # -r dependency_support/pip_requirements.in + # jinja2 + # werkzeug +numpy==1.24.4 \ + --hash=sha256:04640dab83f7c6c85abf9cd729c5b65f1ebd0ccf9de90b270cd61935eef0197f \ + --hash=sha256:1452241c290f3e2a312c137a9999cdbf63f78864d63c79039bda65ee86943f61 \ + --hash=sha256:222e40d0e2548690405b0b3c7b21d1169117391c2e82c378467ef9ab4c8f0da7 \ + --hash=sha256:2541312fbf09977f3b3ad449c4e5f4bb55d0dbf79226d7724211acc905049400 \ + --hash=sha256:31f13e25b4e304632a4619d0e0777662c2ffea99fcae2029556b17d8ff958aef \ + --hash=sha256:4602244f345453db537be5314d3983dbf5834a9701b7723ec28923e2889e0bb2 \ + --hash=sha256:4979217d7de511a8d57f4b4b5b2b965f707768440c17cb70fbf254c4b225238d \ + --hash=sha256:4c21decb6ea94057331e111a5bed9a79d335658c27ce2adb580fb4d54f2ad9bc \ + --hash=sha256:6620c0acd41dbcb368610bb2f4d83145674040025e5536954782467100aa8835 \ + --hash=sha256:692f2e0f55794943c5bfff12b3f56f99af76f902fc47487bdfe97856de51a706 \ + --hash=sha256:7215847ce88a85ce39baf9e89070cb860c98fdddacbaa6c0da3ffb31b3350bd5 \ + --hash=sha256:79fc682a374c4a8ed08b331bef9c5f582585d1048fa6d80bc6c35bc384eee9b4 \ + --hash=sha256:7ffe43c74893dbf38c2b0a1f5428760a1a9c98285553c89e12d70a96a7f3a4d6 \ + --hash=sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463 \ + --hash=sha256:95f7ac6540e95bc440ad77f56e520da5bf877f87dca58bd095288dce8940532a \ + --hash=sha256:9667575fb6d13c95f1b36aca12c5ee3356bf001b714fc354eb5465ce1609e62f \ + --hash=sha256:a5425b114831d1e77e4b5d812b69d11d962e104095a5b9c3b641a218abcc050e \ + --hash=sha256:b4bea75e47d9586d31e892a7401f76e909712a0fd510f58f5337bea9572c571e \ + --hash=sha256:b7b1fc9864d7d39e28f41d089bfd6353cb5f27ecd9905348c24187a768c79694 \ + --hash=sha256:befe2bf740fd8373cf56149a5c23a0f601e82869598d41f8e188a0e9869926f8 \ + --hash=sha256:c0bfb52d2169d58c1cdb8cc1f16989101639b34c7d3ce60ed70b19c63eba0b64 \ + --hash=sha256:d11efb4dbecbdf22508d55e48d9c8384db795e1b7b51ea735289ff96613ff74d \ + --hash=sha256:dd80e219fd4c71fc3699fc1dadac5dcf4fd882bfc6f7ec53d30fa197b8ee22dc \ + --hash=sha256:e2926dac25b313635e4d6cf4dc4e51c8c0ebfed60b801c799ffc4c32bf3d1254 \ + --hash=sha256:e98f220aa76ca2a977fe435f5b04d7b3470c0a2e6312907b37ba6068f26787f2 \ + --hash=sha256:ed094d4f0c177b1b8e7aa9cba7d6ceed51c0e569a5318ac0ca9a090680a6a1b1 \ + --hash=sha256:f136bab9c2cfd8da131132c2cf6cc27331dd6fae65f95f69dcd4ae3c3639c810 \ + --hash=sha256:f3a86ed21e4f87050382c7bc96571755193c4c1392490744ac73d660e8f564a9 + # via + # -r dependency_support/pip_requirements.in + # scipy +portpicker==1.3.1 \ + --hash=sha256:d2cdc776873635ed421315c4d22e63280042456bbfa07397817e687b142b9667 + # via -r dependency_support/pip_requirements.in +psutil==5.7.0 \ + --hash=sha256:1413f4158eb50e110777c4f15d7c759521703bd6beb58926f1d562da40180058 \ + --hash=sha256:298af2f14b635c3c7118fd9183843f4e73e681bb6f01e12284d4d70d48a60953 \ + --hash=sha256:60b86f327c198561f101a92be1995f9ae0399736b6eced8f24af41ec64fb88d4 \ + --hash=sha256:685ec16ca14d079455892f25bd124df26ff9137664af445563c1bd36629b5e0e \ + --hash=sha256:73f35ab66c6c7a9ce82ba44b1e9b1050be2a80cd4dcc3352cc108656b115c74f \ + --hash=sha256:75e22717d4dbc7ca529ec5063000b2b294fc9a367f9c9ede1f65846c7955fd38 \ + --hash=sha256:a02f4ac50d4a23253b68233b07e7cdb567bd025b982d5cf0ee78296990c22d9e \ + --hash=sha256:d008ddc00c6906ec80040d26dc2d3e3962109e40ad07fd8a12d0284ce5e0e4f8 \ + --hash=sha256:d84029b190c8a66a946e28b4d3934d2ca1528ec94764b180f7d6ea57b0e75e26 \ + --hash=sha256:e2d0c5b07c6fe5a87fa27b7855017edb0d52ee73b71e6ee368fae268605cc3f5 \ + --hash=sha256:f344ca230dd8e8d5eee16827596f1c22ec0876127c28e800d7ae20ed44c4b310 + # via -r dependency_support/pip_requirements.in +pyyaml==6.0.1 \ + --hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \ + --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ + --hash=sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df \ + --hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \ + --hash=sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206 \ + --hash=sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27 \ + --hash=sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595 \ + --hash=sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62 \ + --hash=sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98 \ + --hash=sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696 \ + --hash=sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290 \ + --hash=sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9 \ + --hash=sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d \ + --hash=sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6 \ + --hash=sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867 \ + --hash=sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47 \ + --hash=sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486 \ + --hash=sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6 \ + --hash=sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3 \ + --hash=sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007 \ + --hash=sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938 \ + --hash=sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0 \ + --hash=sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c \ + --hash=sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735 \ + --hash=sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d \ + --hash=sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28 \ + --hash=sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4 \ + --hash=sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba \ + --hash=sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8 \ + --hash=sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5 \ + --hash=sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd \ + --hash=sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3 \ + --hash=sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0 \ + --hash=sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515 \ + --hash=sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c \ + --hash=sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c \ + --hash=sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924 \ + --hash=sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34 \ + --hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 \ + --hash=sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859 \ + --hash=sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673 \ + --hash=sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54 \ + --hash=sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a \ + --hash=sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b \ + --hash=sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab \ + --hash=sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa \ + --hash=sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c \ + --hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \ + --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ + --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f + # via -r dependency_support/pip_requirements.in +scipy==1.10.1 \ + --hash=sha256:049a8bbf0ad95277ffba9b3b7d23e5369cc39e66406d60422c8cfef40ccc8415 \ + --hash=sha256:07c3457ce0b3ad5124f98a86533106b643dd811dd61b548e78cf4c8786652f6f \ + --hash=sha256:0f1564ea217e82c1bbe75ddf7285ba0709ecd503f048cb1236ae9995f64217bd \ + --hash=sha256:1553b5dcddd64ba9a0d95355e63fe6c3fc303a8fd77c7bc91e77d61363f7433f \ + --hash=sha256:15a35c4242ec5f292c3dd364a7c71a61be87a3d4ddcc693372813c0b73c9af1d \ + --hash=sha256:1b4735d6c28aad3cdcf52117e0e91d6b39acd4272f3f5cd9907c24ee931ad601 \ + --hash=sha256:2cf9dfb80a7b4589ba4c40ce7588986d6d5cebc5457cad2c2880f6bc2d42f3a5 \ + --hash=sha256:39becb03541f9e58243f4197584286e339029e8908c46f7221abeea4b749fa88 \ + --hash=sha256:43b8e0bcb877faf0abfb613d51026cd5cc78918e9530e375727bf0625c82788f \ + --hash=sha256:4b3f429188c66603a1a5c549fb414e4d3bdc2a24792e061ffbd607d3d75fd84e \ + --hash=sha256:4c0ff64b06b10e35215abce517252b375e580a6125fd5fdf6421b98efbefb2d2 \ + --hash=sha256:51af417a000d2dbe1ec6c372dfe688e041a7084da4fdd350aeb139bd3fb55353 \ + --hash=sha256:5678f88c68ea866ed9ebe3a989091088553ba12c6090244fdae3e467b1139c35 \ + --hash=sha256:79c8e5a6c6ffaf3a2262ef1be1e108a035cf4f05c14df56057b64acc5bebffb6 \ + --hash=sha256:7ff7f37b1bf4417baca958d254e8e2875d0cc23aaadbe65b3d5b3077b0eb23ea \ + --hash=sha256:aaea0a6be54462ec027de54fca511540980d1e9eea68b2d5c1dbfe084797be35 \ + --hash=sha256:bce5869c8d68cf383ce240e44c1d9ae7c06078a9396df68ce88a1230f93a30c1 \ + --hash=sha256:cd9f1027ff30d90618914a64ca9b1a77a431159df0e2a195d8a9e8a04c78abf9 \ + --hash=sha256:d925fa1c81b772882aa55bcc10bf88324dadb66ff85d548c71515f6689c6dac5 \ + --hash=sha256:e7354fd7527a4b0377ce55f286805b34e8c54b91be865bac273f527e1b839019 \ + --hash=sha256:fae8a7b898c42dffe3f7361c40d5952b6bf32d10c4569098d276b4c547905ee1 + # via -r dependency_support/pip_requirements.in +termcolor==1.1.0 \ + --hash=sha256:1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b + # via -r dependency_support/pip_requirements.in +werkzeug==2.3.3 \ + --hash=sha256:4866679a0722de00796a74086238bb3b98d90f423f05de039abb09315487254a \ + --hash=sha256:a987caf1092edc7523edb139edb20c70571c4a8d5eed02e0b547b4739174d091 + # via + # -r dependency_support/pip_requirements.in + # flask diff --git a/dependency_support/rules_hdl/workspace.bzl b/dependency_support/rules_hdl/workspace.bzl index 9fbff3b3b2..2c52560493 100644 --- a/dependency_support/rules_hdl/workspace.bzl +++ b/dependency_support/rules_hdl/workspace.bzl @@ -29,14 +29,14 @@ def repo(): ], ) - # Commit on 2023-09-28, current as of 2023-09-28. - git_hash = "b3d3a2a727f8950eaacddf2b02390a93e8df9ffa" - git_sha256 = "99158b6434427285d76ed6a4f629c838601d94f7b331430603306d55af816e58" + # Commit on 2023-10-04 -- Merge pull request #196 from mithro/openroad-upgrade + git_hash = "64688e60b06b5e3bcf277468d9afdc1fa0a7b98c" + archive_sha256 = "2643614fa0625500284937012af7df74579ccd2298559231f7e78328dce15d6d" maybe( http_archive, name = "rules_hdl", - sha256 = git_sha256, + sha256 = archive_sha256, strip_prefix = "bazel_rules_hdl-%s" % git_hash, urls = [ "https://github.com/hdl/bazel_rules_hdl/archive/%s.tar.gz" % git_hash, diff --git a/docs_src/README.md b/docs_src/README.md index a1fe3dffb9..014922d15d 100644 --- a/docs_src/README.md +++ b/docs_src/README.md @@ -96,6 +96,11 @@ bazel 5.2.0 ~/xls$ # This is important. Without this step, you may experience cryptic error messages: ~/xls$ sudo apt install python3-distutils python3-dev libtinfo5 python-is-python3 +~/xls$ # We're also going to update the Python/pip dependency lock file for your Python +~/xls$ # version, since it's locked to one version by default. Without this, you may +~/xls$ # also experience cryptic error messages. +~/xls$ bazel run -c opt -- //xls/dependency_support:pip_requirements.update + ~/xls$ # Now build/test in optimized build mode. ~/xls$ # If you don't plan on using the C++ frontend, which is not needed to get started, ~/xls$ # use this command line: diff --git a/xls/build_rules/py_proto_library.bzl b/xls/build_rules/py_proto_library.bzl deleted file mode 100644 index 967c4a852a..0000000000 --- a/xls/build_rules/py_proto_library.bzl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2020 The XLS Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Adapter between open source and Google-internal py_proto_library rules.""" - -load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") - -def xls_py_proto_library( - name, - internal_deps, # @unused - srcs, - deps = []): - py_proto_library( - name = name, - srcs = srcs, - deps = deps, - ) diff --git a/xls/codegen/BUILD b/xls/codegen/BUILD index 15e447beac..f326578cb8 100644 --- a/xls/codegen/BUILD +++ b/xls/codegen/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") # cc_proto_library is used in this file package( @@ -558,18 +558,9 @@ cc_proto_library( deps = [":module_signature_proto"], ) -xls_py_proto_library( +py_proto_library( name = "module_signature_py_pb2", - srcs = ["module_signature.proto"], - internal_deps = [ - ":module_signature_proto", - ":xls_metrics_proto", - "//xls/ir:xls_type_proto", - ], - deps = [ - ":xls_metrics_py_pb2", - "//xls/ir:xls_type_py_pb2", - ], + deps = [":module_signature_proto"], ) proto_library( @@ -585,16 +576,9 @@ cc_proto_library( ], ) -xls_py_proto_library( +py_proto_library( name = "xls_metrics_py_pb2", - srcs = ["xls_metrics.proto"], - internal_deps = [ - ":xls_metrics_proto", - "//xls/ir:op_proto", - ], - deps = [ - "//xls/ir:op_py_pb2", - ], + deps = [":xls_metrics_proto"], ) proto_library( @@ -607,12 +591,9 @@ cc_proto_library( deps = [":verilog_line_map_proto"], ) -xls_py_proto_library( +py_proto_library( name = "verilog_line_map_py_pb2", - srcs = ["verilog_line_map.proto"], - internal_deps = [ - ":verilog_line_map_proto", - ], + deps = [":verilog_line_map_proto"], ) cc_test( diff --git a/xls/contrib/xlscc/BUILD b/xls/contrib/xlscc/BUILD index a3e0ff9413..65a8e3cac7 100644 --- a/xls/contrib/xlscc/BUILD +++ b/xls/contrib/xlscc/BUILD @@ -18,8 +18,8 @@ # Email xls-team@ or seanhaskell@ if a dependency is desired. # pytype binary only +load("@rules_python//python:proto.bzl", "py_proto_library") load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") # cc_proto_library is used in this file package( @@ -44,10 +44,9 @@ cc_proto_library( deps = [":hls_block_proto"], ) -xls_py_proto_library( +py_proto_library( name = "hls_block_py_pb2", - srcs = ["hls_block.proto"], - internal_deps = [":hls_block_proto"], + deps = [":hls_block_proto"], ) proto_library( @@ -62,10 +61,9 @@ cc_proto_library( deps = [":metadata_output_proto"], ) -xls_py_proto_library( +py_proto_library( name = "metadata_output_py_pb2", - srcs = ["metadata_output.proto"], - internal_deps = [":metadata_output_proto"], + deps = [":metadata_output_proto"], ) build_test( diff --git a/xls/delay_model/BUILD b/xls/delay_model/BUILD index 9b855dbf22..44dc5a9bcf 100644 --- a/xls/delay_model/BUILD +++ b/xls/delay_model/BUILD @@ -15,7 +15,7 @@ load("@xls_pip_deps//:requirements.bzl", "requirement") # pytype binary, test, library -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") load("//xls/build_rules:xls_build_defs.bzl", "xls_delay_model_generation") package( @@ -184,10 +184,9 @@ proto_library( srcs = ["delay_model.proto"], ) -xls_py_proto_library( +py_proto_library( name = "delay_model_py_pb2", - srcs = ["delay_model.proto"], - internal_deps = [":delay_model_proto"], + deps = [":delay_model_proto"], ) py_binary( diff --git a/xls/fuzzer/BUILD b/xls/fuzzer/BUILD index 0330089f78..2cc33e6536 100644 --- a/xls/fuzzer/BUILD +++ b/xls/fuzzer/BUILD @@ -15,7 +15,7 @@ load("@xls_pip_deps//:requirements.bzl", "requirement") # pytype test and library -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") load("//xls/fuzzer:build_defs.bzl", "generate_crasher_regression_tests") # cc_proto_library is used in this file @@ -560,10 +560,9 @@ cc_proto_library( deps = [":sample_summary_proto"], ) -xls_py_proto_library( +py_proto_library( name = "sample_summary_py_pb2", - srcs = ["sample_summary.proto"], - internal_deps = [":sample_summary_proto"], + deps = [":sample_summary_proto"], ) proto_library( @@ -611,10 +610,9 @@ cc_proto_library( deps = [":ast_generator_options_proto"], ) -xls_py_proto_library( +py_proto_library( name = "ast_generator_options_py_pb2", - srcs = ["ast_generator_options.proto"], - internal_deps = [":ast_generator_options_proto"], + deps = [":ast_generator_options_proto"], ) proto_library( @@ -892,10 +890,9 @@ cc_proto_library( deps = [":sample_proto"], ) -xls_py_proto_library( +py_proto_library( name = "sample_py_pb2", - srcs = ["sample.proto"], - internal_deps = [":sample_proto"], + deps = [":sample_proto"], ) proto_library( diff --git a/xls/ir/BUILD b/xls/ir/BUILD index 5cbcde1737..698f8e0370 100644 --- a/xls/ir/BUILD +++ b/xls/ir/BUILD @@ -19,8 +19,8 @@ load("@xls_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary") # pytype library only +load("@rules_python//python:proto.bzl", "py_proto_library") load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") # cc_proto_library is used in this file package( @@ -374,10 +374,9 @@ proto_library( srcs = ["op.proto"], ) -xls_py_proto_library( +py_proto_library( name = "op_py_pb2", - srcs = ["op.proto"], - internal_deps = [":op_proto"], + deps = [":op_proto"], ) cc_library( @@ -1187,10 +1186,9 @@ cc_proto_library( deps = [":xls_type_proto"], ) -xls_py_proto_library( +py_proto_library( name = "xls_type_py_pb2", - srcs = ["xls_type.proto"], - internal_deps = [":xls_type_proto"], + deps = [":xls_type_proto"], ) proto_library( @@ -1203,12 +1201,9 @@ cc_proto_library( deps = [":channel_proto"], ) -xls_py_proto_library( +py_proto_library( name = "channel_py_pb2", - srcs = ["channel.proto"], - internal_deps = [ - ":channel_proto", - ], + deps = [":channel_proto"], ) cc_library( diff --git a/xls/scheduling/BUILD b/xls/scheduling/BUILD index bbf8037034..abcbd0c8b0 100644 --- a/xls/scheduling/BUILD +++ b/xls/scheduling/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") # cc_proto_library is used in this file package( @@ -26,10 +26,9 @@ proto_library( srcs = ["pipeline_schedule.proto"], ) -xls_py_proto_library( +py_proto_library( name = "pipeline_schedule_py_pb2", - srcs = ["pipeline_schedule.proto"], - internal_deps = [":pipeline_schedule_proto"], + deps = [":pipeline_schedule_proto"], ) cc_proto_library( diff --git a/xls/synthesis/BUILD b/xls/synthesis/BUILD index 8645fc4323..d630075634 100644 --- a/xls/synthesis/BUILD +++ b/xls/synthesis/BUILD @@ -18,7 +18,7 @@ load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") # cc_proto_library is used in this file # pytype binary, test, library -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") package( default_visibility = ["//xls:xls_internal"], @@ -44,18 +44,14 @@ proto_library( ], ) -xls_py_proto_library( +py_proto_library( name = "synthesis_service_py_pb2", - srcs = ["synthesis_service.proto"], - internal_deps = [":synthesis_service_proto"], - deps = [":synthesis_py_pb2"], + deps = [":synthesis_service_proto"], ) -xls_py_proto_library( +py_proto_library( name = "synthesis_py_pb2", - srcs = ["synthesis.proto"], - internal_deps = [":synthesis_proto"], - deps = ["//xls/codegen:module_signature_py_pb2"], + deps = [":synthesis_proto"], ) cc_proto_library( diff --git a/xls/tools/BUILD b/xls/tools/BUILD index eb38684dfa..92d533d496 100644 --- a/xls/tools/BUILD +++ b/xls/tools/BUILD @@ -15,7 +15,7 @@ load("@xls_pip_deps//:requirements.bzl", "requirement") # pytype binary and test -load("//xls/build_rules:py_proto_library.bzl", "xls_py_proto_library") +load("@rules_python//python:proto.bzl", "py_proto_library") # cc_proto_library is used in this file package( @@ -916,11 +916,9 @@ proto_library( srcs = ["scheduling_options_flags.proto"], ) -xls_py_proto_library( +py_proto_library( name = "scheduling_options_flags_py_pb2", - srcs = ["scheduling_options_flags.proto"], - internal_deps = [":scheduling_options_flags_proto"], - deps = [], + deps = [":scheduling_options_flags_proto"], ) cc_proto_library( @@ -1454,11 +1452,9 @@ proto_library( srcs = ["design_stats.proto"], ) -xls_py_proto_library( +py_proto_library( name = "design_stats_py_pb2", - srcs = ["design_stats.proto"], - internal_deps = [":design_stats_proto"], - deps = [], + deps = [":design_stats_proto"], ) py_binary(