You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pull Request #47 changed the sources list to be transformed through File.getCanonicalPath().
Additionally, in SbtJsTask.executeSourceFilesJs, a file is transformed by File.getCanonicalPath().
I question the use of .getCanonicalPath() over .getAbsolutePath(). On UNIX environments, .getCanonicalPath() will resolve symbolic links. With the inconsistent usage of .getCanonicalPath() throughout SbtJsTask, I think this causes issues when mapping output files to source files, or trying to locate source/output files relative to some folders.
I have created an example using Play to demonstrate this in practice at objectmastery/canonical-error-example. The example uses a project/subproject setup, with a symbolic link from the main project to the sub project. This reflects a setup I already have working fine on Windows, with a subproject being symbolically linked to by multiple other main projects (code sharing! yay!).
Of course, there's always a chance .getCanonicalPath() is all fine and I'm just doing something strange, so feel free to point that out instead.
The text was updated successfully, but these errors were encountered:
I think it should probably use getAbsolutePath, sbt's relativeTo will fail if there are symlinks underneath a the parent directory to somewhere outside of the structure.
Pull Request #47 changed the sources list to be transformed through
File.getCanonicalPath()
.Additionally, in
SbtJsTask.executeSourceFilesJs
, a file is transformed byFile.getCanonicalPath()
.I question the use of
.getCanonicalPath()
over.getAbsolutePath()
. On UNIX environments,.getCanonicalPath()
will resolve symbolic links. With the inconsistent usage of.getCanonicalPath()
throughoutSbtJsTask
, I think this causes issues when mapping output files to source files, or trying to locate source/output files relative to some folders.I have created an example using Play to demonstrate this in practice at objectmastery/canonical-error-example. The example uses a project/subproject setup, with a symbolic link from the main project to the sub project. This reflects a setup I already have working fine on Windows, with a subproject being symbolically linked to by multiple other main projects (code sharing! yay!).
Of course, there's always a chance
.getCanonicalPath()
is all fine and I'm just doing something strange, so feel free to point that out instead.The text was updated successfully, but these errors were encountered: