-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fish_realpath
should behave like the realpath
command when invoked with no options
#3400
Comments
I'd like to get this squared away before we release 2.4.0 in order not to have to change its behaviour later. |
Why is just this one builtin using |
Okay, I've got an implementation that seems to mirror GNU realpath. We have two internal implementations. Which one is used depends on the autoconf HAVE_REALPATH_NULL value so I need to copy the fix to the other implementation and update unit tests. Should be ready by tomorrow evening if not this evening.
I honestly don't know other than everyone seemed to think it was a good idea at the time it was discussed and implemented. So I'm also going to fix the naming per your suggestion. P.S., The reason this bug exists is I blindly assumed the |
Can anyone explain to me why we have the autoconf HAVE_REALPATH_NULL symbol today? It was introduced ten years ago by @axel in commit 06fd1aa. That distinction between realpath(3) implementations made sense ten years ago. Today it appears that every implementation we run on supports passing NULL for the resolved_path argument. The reason I ask is that I am reticent to duplicate the fix I mentioned above into the code for the none Also, of course, I can merge my change that fixes the fish realpath builtin behavior on systems that do support NULL for the second argument. While not fixing it for systems that do support NULL as the second argument for realpath(3). |
Nope! The behaviour was specified in POSIX.1-2008 so I think we can nuke it. |
The intent when implementing
fish_realpath
was that is would behave like both the BSD and GNUrealpath
command when invoked with no options. Which means that the all but the final path component must exist and be resolvable. I expected the libc realpath implementation (e.g., "man 3 realpath") to provide that baseline behavior. That expectation was incorrect. See, for example, PR #3374, which added another workaround for a missingrealpath
command but did not address the problem with the fish implementation. This issue is being opened to ensure thefish_realpath
builtin is fixed to provide the behavior that is expected by 99.9% ofrealpath
invocations.The text was updated successfully, but these errors were encountered: