feat(windivert-sys): refactor path handling with path_macro2 and improve build scripts #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses critical CI build failures and enhances path handling robustness for cross-platform compatibility. Below are the details of the issues encountered and the corresponding solutions implemented.
Issues Encountered in CI Build
vendorDirectory: Thevendordirectory (containing third-party dependencies) was absent in the target path during CI runs. This caused failures when thestaticfeature is enabled (requires dependency source/binary files from the vendor submodule).build.rsfailed to locate thevendor/dlldirectory. The root cause was a hardcoded Windows-style path string ("vendor\include"), which is incompatible with cross-platform build environments.Relevant modification measures:
path_macro2macros to improve cross-platform compatibility and maintainability.path_macro2as a build dependency inCargo.toml.path!andpath_const!macros to format paths in the compiler configurations (gnu.rs and msvc.rs), thereby generating path formats compatible with the respective systems.Could you please review this PR when you have time? Let me know if there are any adjustments needed for better compatibility or maintainability!