hedronvision / bazel-compile-commands-extractor

Goal: Enable awesome tooling for Bazel users of the C language family.
Other
696 stars 112 forks source link

Fix: assertion when using zig toolchain #162

Closed nosamad closed 9 months ago

nosamad commented 10 months ago

The zig toolchain uses the file extension .obj instead of .o

cpsauer commented 10 months ago

Hello again @nosamad! Definitely down to merge. Couple quick questions: 1) For my learning, what changed your thinking vs last time? (I thought zig had been respecting Bazel's -o after all?) A windows case? 2) For the split, maybe we should split on ': ', in case there are multiple absolute windows paths?

Thanks so much for working to leave things better than you found them :) Chris

cpsauer commented 9 months ago

^ Went ahead and did that--I'll merge, but would still love it if you'd reply when you get a chance!

nosamad commented 9 months ago

Hello again @nosamad! Definitely down to merge. Couple quick questions: 1) For my learning, what changed your thinking vs last time? (I thought zig had been respecting Bazel's -o after all?) A windows case? I think it is a windows case. As far as I know, there is no option of defining the Artefact File-Extension through a toolchain definition - but I didn't review what they do, so maybe there is a possibility. 2) For the split, maybe we should split on ': ', in case there are multiple absolute windows paths? I don't know if this approach would be sufficient, as dep-Files are valid Makefiles and theoretically every valid Makefile Expression is allowed in the context of targets and prerequisites of a rule - which also can be defined through the command line (gcc). Does a simple Makefile-Parser exist in python? On the other hand your "simple" approach works in most cases :)

Thanks so much for working to leave things better than you found them :) Actually thank you for your nice work! Chris Sorry for the late response.

nosamad commented 9 months ago

Hello again @nosamad! Definitely down to merge. Couple quick questions: 1) For my learning, what changed your thinking vs last time? (I thought zig had been respecting Bazel's -o after all?) A windows case? I think it is a windows case. As far as I know, there is no option of defining the Artefact File-Extension through a toolchain definition - but I didn't review what they do, so maybe there is a possibility. 2) For the split, maybe we should split on ': ', in case there are multiple absolute windows paths? I don't know if this approach would be sufficient, as dep-Files are valid Makefiles and theoretically every valid Makefile Expression is allowed in the context of targets and prerequisites of a rule - which also can be defined through the command line (gcc). Does a simple Makefile-Parser exist in python? On the other hand your "simple" approach works in most cases :)

Thanks so much for working to leave things better than you found them :) Actually thank you for your nice work! Chris Sorry for the late response.

Sorry I was so in a hurry that I missed your main points. Are you calling the compiler for depfile creation? I will investigate further, but it will take some time. Maybe we should provide some integration tests?

Thanks