-
-
Notifications
You must be signed in to change notification settings - Fork 78
Ensure functionality of spacefish on the 3.0 release of fish #128
Conversation
I realized that we rely on it to auto-run the test script
Fish plans to deprecate caret stderr redirection in favor of POSIX-compatible redirection (fish-shell/fish-shell#4394)
I'm having a heck of a time trying to figure out what is causing this failure. I was thinking it had to do with the new |
After a little bit of chatting on the fish-shell gitter, this bit of advice might help us isolate the failure: |
Here's the rest of the conversation, where @faho discusses the solution he found: The failure was resolved in the end with the following PR to fishtape: jorgebucaran/fishtape#35 |
Hmm... 🤔 |
Necessary due to the following update: fish-shell/fish-shell#3350
It appeared that pwd -P was only added as part of fish 3.0.0 and would not be available on fish 2.7.1
functions/__sf_section_dir.fish
Outdated
@@ -27,11 +27,12 @@ function __sf_section_dir -d "Display the current truncated directory" | |||
|
|||
set -l dir | |||
set -l tmp | |||
set -l resolvedPwd (pwd -P 2>/dev/null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For easy compatibility with 2.7.0, put ; or pwd
in there, because that didn't have the -P
option and will error out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this causes a bug on 2.7.0 due to pwd
being the logical location while the git root is a physical location.
It seems to work consistently now when using command pwd -P
. Do you see any drawbacks to this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this causes a bug on 2.7.0 due to pwd being the logical location while the git root is a physical location.
In 2.7.0, the pwd is the physical location, always.
So pwd
prints the same thing in 2.7.0, as pwd -P
does in 3.0.
Using just pwd
causes a bug in 3.0, not 2.7.
Just to be clear, my proposal is:
set -l resolvedPWD (pwd -P 2>/dev/null; or pwd)
which will try pwd -P
, which will fail if the option isn't supported, and then it'll run pwd
.
It seems to work consistently now when using command pwd -P. Do you see any drawbacks to this approach?
It's an additional fork (command pwd
takes a millisecond or so on my system, hot-cache, while the builtin is unmeasurable). Plus, it's an additional external command you require.
pwd (with -P) is a POSIX requirement, but still.
Not something that's hugely important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Yes, you're right. It was 3.0 that caused the bug.
Thank you for the clarification. 😄
I've gone ahead and removed Appveyor and Cygwin-related testing from the project. I'll look into re-adding Cygwin (and possibly WSL) coverage with Travis in a future PR. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems fishtape is having compatibility issues, heh.
https://travis-ci.org/matchai/spacefish/jobs/473447715#L149
So it seems... 🤔 |
@@ -4,6 +4,10 @@ function setup | |||
spacefish_test_setup | |||
end | |||
|
|||
function teardown | |||
set USER $LOGNAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will reset the user to be the username that initially logged in.
It seems this wasn't being reset after setting user to "ROOT".
## [1.12.4](v1.12.3...v1.12.4) (2019-01-02) ### Bug Fixes * fix bugs caused by the 3.0 release of fish ([#128](#128)) ([16539f5](16539f5))
🎉 This PR is included in version 1.12.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
@@ -18,7 +18,7 @@ | |||
# | |||
|
|||
function mock -a cmd -a argument -a exit_code -a executed_code -d "Mock library for fish shell testing" | |||
set -l cmd_blacklist "builtin" "functions" "eval" "command" | |||
set -l cmd_blacklist "builtin" "functions" "eval" "command" "argparse" "read" "set" "status" "test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing [
, the alternate name for test
. Though, technically, there's a few more. See https://github.com/fish-shell/fish-shell/blob/master/src/parser_keywords.cpp. So the list is
"[" and argparse begin break builtin case command continue else end exec for function if not or read return set status switch test while
(yes, [
is the only one that needs to be quoted)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a pain in the butt to maintain as things are added over time. Can fish do this for us? Is there a command to list all builtins automatically?
`builtin -n`, though that lists _all_ builtins, even the ones you are
allowed to override, like `cd`.
Am Mi., 9. Jan. 2019, 11:17 hat Snuggle <notifications@github.com>
geschrieben:
… ***@***.**** commented on this pull request.
------------------------------
In tests/mock.fish
<#128 (comment)>:
> @@ -18,7 +18,7 @@
#
function mock -a cmd -a argument -a exit_code -a executed_code -d "Mock library for fish shell testing"
- set -l cmd_blacklist "builtin" "functions" "eval" "command"
+ set -l cmd_blacklist "builtin" "functions" "eval" "command" "argparse" "read" "set" "status" "test"
This seems like a pain in the butt to maintain as things are added over
time. Can fish do this for us? Is there a command to list all builtins
automatically?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#128 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AE8fVx6YEIeQwYzn2FhvyVOGiJ26oMnGks5vBcGdgaJpZM4ZkF3r>
.
|
@matchai Could we possibly replace this list of builtins with the above? It seems like it would be much easier to maintain. |
As part of #136, the mock code is no longer in the repo. |
Description
All the following changes should be backward compatible with fish 2.7.1:
2>
instead of^
Motivation and Context
Closes #127
Types of changes
How Has This Been Tested?
Checklist: