Skip to content

saw inappropriately expands symbolic links #2082

@sauclovian-g

Description

@sauclovian-g
% bin/saw test.saw 
[00:18:44.386] Loading file ".../saw-script/test.saw"
[00:18:44.387] .../saw-script/test.saw:4:21-4:28: Type mismatch.
   :

Well and good. But now,

% ln -s test.saw other.saw
% bin/saw other.saw       
[00:19:06.439] Loading file ".../saw-script/test.saw"
[00:19:06.440] .../saw-script/test.saw:4:21-4:28: Type mismatch.

Notice that it has expanded the symbolic link other.saw and this causes it to report errors with the name of the link target rather than the filename I gave it. Experimentation shows that if the path to other.saw includes symbolic links to directories, it expands those as well.

This is generally not what you want -- in almost all cases you want tools to use and report the filenames you give them and not try to reinterpret them. Doing so can in some cases lead to confusion (particularly, but not only, if there are automounters involved) and it can also create testing and debugging headaches. (For example: if you check out and build two different versions of saw in different trees, now you can't compare the output from test runs.)

Metadata

Metadata

Labels

tooling: test infrastructureIssues involving test infrastructure or test execution, or making SAW more testabletopics: error-messagesIssues involving the messages SAW produces on errortype: bugIssues reporting bugs or unexpected/unwanted behaviorusabilityAn issue that impedes efficient understanding and use

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions