-
Notifications
You must be signed in to change notification settings - Fork 107
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
Document preferred way to add opt only compile flags with rules based toolchain #325
Comments
You are prodding in eerily similar code right now to me. I found it super handy to put a print inside The code you have above looks right. That generates:
For If you change it to I'm trying to convert
This makes me think there is something wrong with the definitions for the external features for |
thanks for the debugging tip! that's very useful. with working on the unix toolchain conversion are you removing the reliance on the legacy features? im considering looking into that but if you're already nearly done with that I wouldn't have to! |
Keith, I'm starting with "Port, line for line, the old syntax over to rules". I don't have any legacy features converted right now. Now I know to check in with you before starting so we don't duplicate each other :) |
Similar to this but without needing to modify builtins, etc. you can accomplish this with cquery. e.g.
If your goals involve a straight port, in theory you could resurrect the comparator tests: https://github.com/bazelbuild/rules_cc/blob/0.0.1/tools/migration/ctoolchain_comparator.py |
that's a great tip! note that for use with the rule based toolchain if you have a toolchain like: cc_toolchain(
name = "clang_toolchain",
... The target you need to use is |
It seems like in the proto representation from this i get 3 duplicate entries 1 after the other, any idea how to eliminate that? it just adds some noise to diffs |
A common pattern in the previous CC toolchain was to have some compile flags split on dbg/fastbuild/opt. I don't see any docs or examples of how to do that with the rule based toolchain. My first attempt was this:
But the flags aren't added, so I assume that's not the right move. I found another example where the user just overrode the feature instead:
https://github.com/lowRISC/opentitan/blob/7704c7a75d9fff2fdfb42e40d5bd311ac9f94f9b/toolchain/BUILD#L193-L202
The text was updated successfully, but these errors were encountered: