pkl
pkl copied to clipboard
Inconsistent handling of HTTP redirects and file symlinks
I just did some manual testing. Currently, Pkl handles HTTP redirects and file symlinks differently:
- HTTP redirects:
A program imports both
https://example.com/bar.pkl
andhttps://example.com/redirect-to-bar.pkl
.
- Each import fetches/parses/evaluates the module separately.
- The resulting modules are incompatible. Their source code could be the same or different.
- Error and trace messages contain separate URLs.
- File symlinks:
A program imports both
path/to/bar.pkl
andpath/to/symlink-to-bar.pkl
.
- The module is fetched/parsed/evaluated only once.
- The resulting modules are compatible. They are the same module.
- Error and trace messages contain the URL of the import that was accessed first.
In other words: Files are canonicalized, HTTP URLs aren't. I think both should be.