-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bazel,dvsim] remove gen-binaries.py
's reliance on meson_init.sh
script
#12447
Comments
gen-binaries.py
scriptgen-binaries.py
and run-some.py
scripts with bazel rules
gen-binaries.py
and run-some.py
scripts with bazel rulesgen-binaries.py
and run-some.py
scripts with bazel rules
I thought P0 meant "people are blocked and no-one can do any work". I can't believe that applies here. Anyway... I think this is slightly backwards: the gen-binaries script generates one or more randomised binaries using the random instruction generator. There's no real interaction with Bazel, except that we've historically used the meson toolchain file to figure out what the underlying riscv toolchain should be. As far as I can tell, all we really need is to get Bazel to tell us how to run an assembler and linker. This is not otherwise part of the software build system, so I don't see any need for replacing it with Bazel rules. |
hmm, after digging into the script more, its seems the
When meson is removed, ninja will be removed too (essentially meson just generates ninja build files). To convert this setup to use bazel, we have a couple options:
Unfortunately with option 1, since the With option 2, dvsim.py will still invoke bazel, but bazel won't invoke itself under the hood, which would be the more appropriate way of doing things. Does that make sense? Basically, option 2, will look pretty much like what I have described above, with the exception that the first task will require additional bazel rules / macros be developed. |
To be clear, we're running ninja because it's an easy way to build stuff in parallel. I could have done it with Make or any other similar system. This has absolutely nothing to do with the Meson vs. Bazel change, except possibly a missing build dependency. If you're feeling absolutely allergic to keeping ninja installed, please port the script to use Make. (But I would view this as rather pointless busy-work, so I'd suggest not doing so). Looking at your two options, (1) is kind of what I'm talking about above, but pulling in the juggernaut that is Bazel when all we want to do is run some commands in parallel. This seems a bit nuts to me. (2) is fine, I guess. But the existing script isn't completely trivial and it ties yet more of the non-SW ecosystem into having to run arcane Bazel commands. I'm not happy about this, but I guess I've lost the argument. My preferred option: Treat ninja as a tool that we expect to be installed (and track it with whatever runes are required to get the hermetic properties that you want). Leave gen-binaries.py unchanged (I guess you'll have to rename it to |
Oh, sorry, I missed something: I'd expect the Bazel-driven wrapper for |
After our offline discussion, I came to the understanding that the
Thanks for clearing this up @rswarbrick ! |
gen-binaries.py
and run-some.py
scripts with bazel rulesgen-binaries.py
's reliance on meson_init.sh
script
gen-binaries.py
's reliance on meson_init.sh
scriptgen-binaries.py
's reliance on meson_init.sh
script
Meson will soon be removed from our project and replaced entirely with bazel (lowRISC#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes lowRISC#12447. Signed-off-by: Timothy Trippel <[email protected]>
Meson will soon be removed from our project and replaced entirely with bazel (lowRISC#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes lowRISC#12447. Signed-off-by: Timothy Trippel <[email protected]>
Meson will soon be removed from our project and replaced entirely with bazel (lowRISC#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes lowRISC#12447. Signed-off-by: Timothy Trippel <[email protected]>
Meson will soon be removed from our project and replaced entirely with bazel (lowRISC#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes lowRISC#12447. Signed-off-by: Timothy Trippel <[email protected]>
Meson will soon be removed from our project and replaced entirely with bazel (lowRISC#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes lowRISC#12447. Signed-off-by: Timothy Trippel <[email protected]>
Meson will soon be removed from our project and replaced entirely with bazel (#12449). This updates the the OTBN `gen-binaries.py` script to not rely on the presence of the `.env` file that was produced by the `meson_init.sh` script to provide locations to the RV32 toolchain. Instead, the `gen-binaries.py` script now uses environment variables to get the locations of the RV32 toolchain tools, which are populated via queries to bazel. This fixes #12447. Signed-off-by: Timothy Trippel <[email protected]>
The OTBN
gen-binaries.py
script is used by thehw/ip/otbn/dv/uvm/otbn_sim_cfg.hjson
dvsim.py config file to build the necessary OTBN images to run simulations. Specifically, thegen-binaries.py
script invokes meson-generated ninja build rules under the hood to generate the binaries. Once we deprecate meson, this approach will no longer work. To migrate these tools to make use of bazel, what needs to happen is:gen-binaries.py
script and determine if additional bazel rules must be added (in addition to the OTBN rules that already exist) to build the necessary OTBN binaries (I think the answer should be no?)hw/ip/otbn/dv/uvm/otbn_sim_cfg.hjson
config file to invoke bazel directly to build OTBN images that thegen-binaries.py
script (and therefore meson) would normally buildgen-binaries.py
scriptrun-some.py
script with a set of opentitan_functestsrun-some.py
scriptPLEASE DISREGARD THE ABOVE TASKS IN FAVOR OF THE ONES LISTED BELOW.
(the solution to this issue has evolved)
The text was updated successfully, but these errors were encountered: