-
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
Stardoc fails in Bazel version 4.0.0 if load of @rules_cc in .bzl files #92
Comments
Hi Lisa, that certainly sounds problematic. The lack of an informative error message should be fixed as of bazelbuild/bazel@9f60686, but that commit isn't in 4.0.0 (see bazelbuild/bazel#13077). Can you try running with Bazel at head and see if you get a more useful error? |
Thanks @brandjon for your quick reply! We will try with the patch you refer to and see what error message we get then. |
@brandjon It seems that commit that improves error messages was merged to bazel/master 7/1 and Bazel 4.0.0 was released 21/1. In order words, that commit is already present in 4.0.0 and example provided by @lisaonduty already contains that fix. If you want/can continue this discussion we probably should make a separate ticket for this. |
Bazel 4.0.0 has baseline bazelbuild/bazel@37a429a, from Nov 18. The error message commit came during the (rather long, it seems) canarying period. |
@brandjon All right. Thank you for your clarification. In that case 4.0.0 does not contain that fix. But our local Bazel uplift that we call "4.0.0" is based on that release commit. So in reality it's 4.0.0 plus some more commits. That error fix commit is part of our baseline so we already running it. |
So to confirm, a build of Bazel containing the Jan 7 fix for better error reporting in Stardoc still fails to give a useful error message for why Stardoc now fails on .bzl files that load from |
@brandjon Yes. Your summary is correct. Sorry for the confusion. We were able to find the root of the problem as well as fix it so for us there is no urgency. You can follow instructions provided by @lisaonduty so you can both reproduce the error that she reported as we ll to see if error message is something you can improve upon. |
Hi,
We were working on upgrading our Bazel version from 3.7.0 to 4.0.0 when our Stardoc document rules failed to build. The only information we received was that it was a Starlark evaluation error:
Fortunate we had some documentation rules that still could build so from that we realized (after digging for hours) that it failed for the documents that used cc-rules in the .bzl files. These contained load statement of rules_cc:
So to resolve this and be able to upgrade our Bazel version we needed to remove all these load statements and use native calls instead.
I made a general .bzl rule in a local copy of Bazel cpp example (bazel/example/cpp)
which I share below.
In 3.7.0 it works fine to have it like this:
We added the following in the BUILD file:
And made a new .bzl file with the following content:
And the markdown document was successfully generated when executing the following command:
But when building with Bazel version 4.0.0 it fails. To resolve this we needed to remove the load statement in hello.bzl:
And use the native call instead:
And then we could also remove the target "rules_cc" from deps.
On the side note we would also like to mention that we think that it's unfortunate that we needed to specify all internal dependencies for rules_cc but that was the only way we found out to get successful builds.
We use Stardoc version 0.4.0
We would be grateful to get your feedback on this and to confirm if this is a bug.
Since the Bazel version 4.0.0 is considered as a long term supported version (LTS) it feels extra important that Stardoc is compatible with that version.
Thanks and Regards
Lisa
The text was updated successfully, but these errors were encountered: