Skip to content
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

Fix refresh_compile_commands target. #18

Merged
merged 1 commit into from Sep 26, 2022

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Sep 25, 2022

It appears to me that this select statement in rust-deps/BUILD.bazel is incorrectly using absolute paths to targets that aren't located at the root, but rather located within the same module. Fixing them to be local targets seems to make refresh_compile_commands now work. However, I'm confused why this didn't cause a broader breakage so I'm unsure if I totally understand what's going on here.

Fixes #16

It appears to me that this select statement in rust-deps/BUILD.bazel is incorrectly using absolute paths to targets that aren't located at the root, but rather located within the same module. Fixing them to be local targets seems to make refresh_compile_commands now work. However, I'm confused why this didn't cause a broader breakage so I'm unsure if I totally understand what's going on here.
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes things work for me but still not 100% what's going on with all this. Good to get @mrbbot sign off first.

Copy link
Contributor

@mrbbot mrbbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, using relative paths here makes way more sense. 🙂 I'm also unsure why this didn't break other things though. 😕

Just to note, when I try to run bazel run //:refresh_compile_commands on my M1 Mac I see the following errors. The command still succeeds, and compile_commands.json is still generated.

In file included from external/capnp-cpp/src/capnp/c++.capnp.c++:4:
external/capnp-cpp/src/capnp/c++.capnp.h:10:2: error: "Version mismatch between generated code and library headers.  You must use the same version of the Cap'n Proto compiler and library."
#error "Version mismatch between generated code and library headers.  You must use the same version of the Cap'n Proto compiler and library."
 ^
1 error generated.
...lots more of these...

I get what this error is saying, but I'm confused why multiple versions of Cap’n Proto are being used here. Is it trying to use the version on my PATH?

@jasnell jasnell merged commit 5200f13 into main Sep 26, 2022
@jasnell jasnell deleted the kenton/fix-refresh-compile-commands branch September 26, 2022 13:21
@kentonv
Copy link
Member Author

kentonv commented Sep 26, 2022

@mrbbot Hmm I'm surprised that refresh_compile_commands needs to actually run the compiler, and it's worrying that it seems to be picking up the system-installed capnp headers and letting them take precedence over the local ones... hopefully this isn't resulting in incorrect compile commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacOS-build appears to have broken refresh_compile_commands
3 participants