Skip to content
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

[Bug] CCL should not auto-normalize :up found in directory components passed to make-pathname #477

Open
fosskers opened this issue Jan 28, 2024 · 2 comments

Comments

@fosskers
Copy link

fosskers commented Jan 28, 2024

The implications of this line (and perhaps the usage of remove-up elsewhere) violate the spec's stated difference between :up and :back. :up requires a probe of the filesystem to determine what the path actually resolves to, while :back does not. I don't see remove-up doing such a probe.

Either way, automatically doing this even were :back present is inconsistent with how pathname literals are interpreted. For instance:

(inspect #p"/foo/bar/../stuff.txt")

You will see that :UP is still present in the struct and the path has not been normalized. Other main implementations also do not do auto-normalization within make-pathname.

@fosskers fosskers changed the title [Bug] CCL should not auto-interpret :up found in directory components passed to make-pathname [Bug] CCL should not auto-normalize :up found in directory components passed to make-pathname Jan 28, 2024
@Gleefre
Copy link

Gleefre commented Jan 30, 2024

FWIW there is no corresponding page in the CLHS: https://www.lispworks.com/documentation/HyperSpec/Body/19_bb.htm only lists sections up to 19.2.2.5.

This probably due to this (cited from the home page of cl-community-spec):

There are still some issues. One of them is that I started out using not the latest version of the draft, so that X3J13 changes were not included.

@fosskers
Copy link
Author

fosskers commented Jan 31, 2024

The section numbers seem to be different, but here is the corresponding section from the LW Hyperspec: https://www.lispworks.com/documentation/HyperSpec/Body/19_bbdc.htm

The part in question is this:

``Syntactic'' means that the action of :back depends only on the pathname and not on the contents of the file system.

``Semantic'' means that the action of :up depends on the contents of the file system; to resolve a pathname containing :up to a pathname whose directory component contains only :absolute and strings requires probing the file system.

So there are two issues here:

  1. CCL is interpreting :up's behaviour as :back's behaviour.
  2. It is automatically normalizing paths via (1) when make-pathname is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants