-
Notifications
You must be signed in to change notification settings - Fork 31
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
Resolution of File Locations Does Not Respect Symbolic Links #370
Comments
This is not the issue, it seems to be dependent on the working directory. |
The issue comes from the use of working directory to generate path names.
When filename does not contain a path (just a name) then Java prepends the working directory name. However, the JVM resolves symlinks at startup when determining the working directory name. Thus paths generated with the above will always resolve paths and thus fail on symlinks. The only way to fix this would be to pass in the working directory as an argument to the process and use that instead of Java's understanding of the working directory.
|
I looked at the underlying issue nasa/fprime#1604. I think the issue is that when we run If this is correct, then I see two ways to fix it: (1) get the FPP locations to respect the symlinks or (2) provide the -p input with regard to the real path names (in addition to they symlinked path names). |
When the file name string comes in on the command line, it gets converted to an FPP file here: If the file names being passed in on the command line are relative to the working directory, then the JVM resolution of the working directory would be an issue here. If that's the case, then the following could also fix it: (3) don't use relative file path names, e.g., run |
After thinking on this more, I believe the correct fix is to have CMake, which calls into FPP, respect the resolved paths that the JVM deals in. Thus I will add an issue over there! |
Closing in favor of: nasa/fprime#2455 |
Sounds good! I opened an issue to document this idiosyncrasy in the User's Guide. See #371. |
https://github.com/fprime-community/fpp/blob/63799b4b1fbe57db87f9445d7a31fc5ff1c2d2da/compiler/lib/src/main/scala/codegen/CppWriter/CppWriterState.scala#L45
By calling
.normalize
after.toAbsolutePath
causes links to resolve into a "real path". When F´ is building within a symlinked directory this causes incorrect include paths to be generated becauseremoveLongestPathPrefix
does not deal in realpaths and thus does not strip off the prefix when it should.It is recommended that
.normalize
be removed in the above call, and all uses of.normalize
should be reviewed.The text was updated successfully, but these errors were encountered: