Make sure that canonical_path doesn't change the path when it is called and preserves the relative paths correctly when being executed by the link resources.