apple / apple/pkl

Inconsistent handling of HTTP redirects and file symlinks

Open
#254 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
11.5k
Forks
402
Avg merge
1d 15h
Merged PRs (30d)
20

Description

I just did some manual testing. Currently, Pkl handles HTTP redirects and file symlinks differently:

1. HTTP redirects:
A program imports both `https://example.com/bar.pkl` and
`https://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.

2. File symlinks:
A program imports both `path/to/bar.pkl` and `path/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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the module import handling for HTTP redirects and file symlinks, comparing where each source is canonicalized. The change is done when both import forms resolve to one compatible module and error and trace messages consistently use the canonicalized source.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.