-
Notifications
You must be signed in to change notification settings - Fork 31
Support NixOS resource dirs #546
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
base: main
Are you sure you want to change the base?
Conversation
Previously, CppInterOp assumed that the resource dir would end in the clang major version. This is common, but it's not always the case. On NixOS, for example, we have something like this: ``` ❯ clang++ -print-resource-dir /nix/store/xl0vlc2wdchfbq8536zs19pj2r3xdmma-clang-wrapper-19.1.5/resource-root ``` I have updated the function to check that the path contains the major version, rather than ending in it. This is still a useful version check, though it's not as precise as it was before.
clang-tidy review says "All clean, LGTM! 👍" |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #546 +/- ##
=======================================
Coverage 75.94% 75.94%
=======================================
Files 9 9
Lines 3646 3646
=======================================
Hits 2769 2769
Misses 877 877
🚀 New features to boost your workflow:
|
Can we somehow add a test for this? |
Seems possible, if we were to:
I didn't bother, since that didn't seem worth the effort. If this is required, please let me know where the scripts should live. |
Perhaps we can move the compatibility check logic into a new function that takes a string and then implement a test based on the expected strings? |
Although it wouldn't cover NixOS, if you can suggest another OS which is not following the typical pattern, but for which a docker image exists on Docker hub (I couldn't find an image for NixOS), I should be able to construct a workflow for this operating system, and therefore provide a way to test this change. |
Previously, CppInterOp assumed that the resource dir would end in the clang major version. This is common, but it's not always the case. On NixOS, for example, we have something like this:
I have updated the function to check that the path contains the major version, rather than ending in it. This is still a useful version check, though it's not as precise as it was before.