Repository navigation
fix(idl): recognize equivalent paths for pragma once - #67
Conversation
Use filesystem identities for include guards and cycle detection while preserving resolved paths for diagnostics and dependency tracking. Add regression tests for path aliases, distinct files, virtual loaders, and platform-specific filesystem behavior. Fixes zero-objects#65
|
Thank you, this is in. I read it and ran it on Linux ( It is in our main repository with you as the author, unchanged except for the line endings of One thing before I merge it here: the |
|
Thank you! I am sorry I missed that! It should be fixed now! |
fix(idl): recognize equivalent paths for pragma once
Summary
Fixes #65.
When a file containing
#pragma onceis included through different paths, the filesystem loader now identifies those paths using their canonical filesystem identity. The preprocessor uses that identity for include guards and cycle detection while retaining the resolved path for diagnostics, include resolution, and dependency tracking. Virtual loaders continue to use exact-name identity by default.Specification Reference
N/A —
#pragma onceis a supported extension; this change does not claim IDL standard compliance for it.Test Coverage
cargo test --workspacepassed locally.cargo clippy --workspace --all-targets -- -D warningspassed locally.cargo fmt --all -- --checkpassed locally.Regression coverage includes direct and transitive aliases, distinct files with the same basename, root-file aliases, cycles, Windows case variants, Unix symlinks and non-UTF-8 targets, and virtual loader identities.
On Linux with Rust 1.97.1, workspace formatting and Clippy passed. The focused tests also passed:
cargo test -p zerodds-idl-parse -p zerodds-idl-composeThe full workspace test suite was not completed.
Breaking Change?
The new
FileLoader::identitymethod has a default implementation.Checklist
feat(scope): .../fix(scope): .../docs(scope): .../chore(scope): ...).Please let me know if the new public API needs a changelog entry. Spec coverage documentation is not applicable to this extension.