-
Notifications
You must be signed in to change notification settings - Fork 141
Failed to run in the project ApolloAuto #62
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
Comments
Hey @simon13579! Thanks for trying the tool and for writing in. Looks like there's a pretty custom build flow here--and Bazel is helpfully telling us what's wrong. :refresh_all is already assuming you want all targets, but the list of targets is being respecified by Could you try making that command bazel run That'll try to get the compile commands for all targets. If you're looking to get them for just some of the buildable targets, you can specify them with the We don't currently have support for specifying the targets to analyze at runtime, as opposed to in a BUILD file, but I suppose we could add that if you'd like to. I think it should work, but we'd have to be careful to add + between targets. as we parse. We should probably at least warn about this case. I'll go ahead and add that warning. For (4), I really want to dive into why the tool is forcing you to manually set exclude_headers. Any chance you could copy in the error message? I'd expect it to just default to None and be fine (as it does for me), and want to fix whatever's forcing you to make that change. Cheers, |
Hello @cpsauer , Thanks for your kind support! For (4), if I don't set exclude_headers, it report the error:
And as you suggested, the below two methods both works for me which is great 👍 :
Thanks, |
Great! Glad those worked. Sounds like you're fine with those fixes rather than needing to specify targets from the command line? Thanks for the error message. Gah that's bad, and a bug I definitely didn't want to have slip through. Do you know what Bazel version you're on? If you use bazelisk, could I ask you to try (at least) bazel rolling and latest to see if we can narrow down what versions it's failing? Thanks so much for your patience and tenacity in working through these. |
Hello Chris, Yes, those fixes are good enough for me, thanks for your great work!
Thanks, |
Simon, you're very welcome! Glad to hear. [I therefore won't add the feature to specify targets at runtime right now because I think we want to encourage people to configure things with a BUILD file, absent a burning need. I can however imagine how we'd add it in the future if it were needed. Note to future self: Be careful about merging flags that might each contain |
Re Bazel 3.4.1: That's quite an old version my friend. I can indeed reproduce the issue if I go back that far, but I think I should probably just be advising that you update, since lots of Bazel bugs have been fixed since then. Hopefully that works; I didn't see a .bazelversion file in ApolloAuto. BTW, if you're using this tool for clangd, I think you'll probably end up wanting headers at some point. You'll know if you see erroneous red underlines in headers. But it's probably worth updating bazel and removing the exclude_headers line. Anyway, I'll close for now, since I think we've resolved the issues. But you know how to find me. |
@simon13579, I'm curious how this ended up! We had someone else run into the |
@simon13579, heads that @cyy5358 contributed a fix, now merged, that will let you not exclude_headers on older bazel versions if you so need! |
Hello,
Thanks for building this tool. Now I am trying to use it to the code ApolloAuto (https://github.com/ApolloAuto/apollo). I check out the code of Apollo v6.0 and make the below changes:
I replace the line 251
bazel build ${CMDLINE_OPTIONS} ${job_args} -- ${formatted_targets}
of the file https://github.com/ApolloAuto/apollo/blob/master/scripts/apollo_build.sh bybazel run @hedron_compile_commands//:refresh_all -- ${CMDLINE_OPTIONS} ${job_args} -- ${formatted_targets}
Update the python in the container to python 3.7
Add a new line
exclude_headers = "all"
in the file BUILD which is in the folder Apollo/.cache/bazel/540135163923dd7d5820f3ee4b306b32/external/hedron_compile_commands. If I don't manually add this, it will report error that it expect the setting of exclude_headersBut when I run it, it reports the error as below:
The text was updated successfully, but these errors were encountered: