implement and use portable implementation of canonical file paths, see #909, this time against dev branch