-
Notifications
You must be signed in to change notification settings - Fork 45
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
Replaced m4, flex, and bison targets with jmillikin's rules. #341
Conversation
m4_register_toolchains(version = "1.4.18") | ||
bison_register_toolchains(version = "3.3.2") | ||
flex_register_toolchains(version = "2.6.4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move these to dependency_support.bzl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to but unfortunately I'd need to load these rules first, which happens in dependency_support.bzl
😞. I can do so if you can suggest where I should load the rules in the first place
"out_src": attr.output( | ||
mandatory = True, | ||
doc = "Output files generated by the action.", | ||
), | ||
"tools": attr.label_list( | ||
allow_files = True, | ||
cfg = "exec", | ||
doc = "Additional tools of the action.", | ||
"yacc_src": attr.label( | ||
doc = "The yacc file to run on.", | ||
allow_single_file = True, | ||
mandatory = True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a backwards incompatible change. Would this cause errors for downstream users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my knowledge this rule is only used internally so the change should not have an impact. Their existence in a private
directory was to discourage users from loading them (as buildifier will complain with bzl-visibility
).
Also, the Bazel Test Log from the last build is not visible to me. It's asking me to log in. |
I think since the build failed during repo fetch no uuid for the test was ever uploaded. It seems like an edge case of the way we upload to build buddy |
@QuantamHD finally got CI passing, this change is now ready for another review! |
So I still have a concern with this change. Lots of downstream repos import bazel_rules_hdl into their own repo and M4 and others not being the dependency support means they won't be available in downstream repos. |
@QuantamHD It seemed to me that edit: An example of a similar change would be if |
poke @QuantamHD 😄 |
@QuantamHD Ah ok. I think for this change CI should cover that concern unless you are aware of existing gaps. For Verilator in particular the following test should cover the ability to compile Verilator and use it to generate outputs: bazel_rules_hdl/verilator/tests/BUILD Lines 62 to 71 in c2ef195
Dependencies of this target would either fail to build or the unit test would fail if there was a major issue in the code. I feel for this change that the impact is covered by similarly existing tests. Additionally, this works in my own workspace where I have the exact lines of code you referenced and heavy use of Verilator and Verilog. |
But that's within this WORKSPACE file. If bazel_rules was instantiated in another workspace my expectation is that that test would fail because the rules required to build openroad or one of the other binaries would fail to find an m4 dependency |
@QuantamHD As long as the contract is folks load the following somewhere in their workspace and all the external transitive dependencies for load("@rules_hdl//dependency_support:dependency_support.bzl", rules_hdl_dependency_support = "dependency_support")
rules_hdl_dependency_support()
load("@rules_hdl//:init.bzl", rules_hdl_init = "init")
rules_hdl_init() Here we see the dependencies being initialized from the repo, not independently. So updating the pin of |
Okay I see. LGTM! I missed the fact that those were in the init function the first time around. My bad. |
All good, thank you for the review! |
This updates the rules to use rules_m4, rules_bison, and rules_flex to eliminate deficiencies (most notably the use of genrule in my case) which make building the rules hard on other platforms like Windows.