Skip to content
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

Failure in checks/colon-delimited-var.fish on OpenIndiana #6556

Closed
Mno-hime opened this issue Jan 30, 2020 · 11 comments
Closed

Failure in checks/colon-delimited-var.fish on OpenIndiana #6556

Mno-hime opened this issue Jan 30, 2020 · 11 comments
Assignees
Labels
bug
Milestone

Comments

@Mno-hime
Copy link

@Mno-hime Mno-hime commented Jan 30, 2020

fish 3.1 beta1 test suite compiled with GCC 6.5 fails on OpenIndiana with:

Testing file checks/colon-delimited-var.fish ... Failure in checks/colon-delimited-var.fish:

  The CHECK on line 8 wants:
    a:.:b

  which failed to match line stdout:1:
    /usr/xpg4/bin:a:.:b

  when running command:
    env PATH="a::b" CDPATH="d::e" MANPATH="x::y" ../test/root/bin/fish checks/colon-delimited-var.fish
@krobelus
Copy link
Member

@krobelus krobelus commented Jan 30, 2020

Could this be due to the vendor directories for configuration snippets?
Some file in $vendor_confdirs in share/config.fish could add the PATH entry.

What changed is that /usr/local/share/fish/vendor_conf.d/*.fish are included by default, even if running from a different prefix (like the tests do).

@zanchey zanchey added the bug label Jan 30, 2020
@zanchey zanchey added this to the fish-future milestone Jan 30, 2020
@zanchey
Copy link
Member

@zanchey zanchey commented Jan 30, 2020

Nope, this is added deliberately in share/config.fish:

# This is a Solaris-specific test to modify the PATH so that
# Posix-conformant tools are used by default. It is separate from the
# other PATH code because this directory needs to be prepended, not
# appended, since it contains POSIX-compliant replacements for various
# system utilities.
#
if test -d /usr/xpg4/bin
not contains -- /usr/xpg4/bin $PATH
and set PATH /usr/xpg4/bin $PATH
end

From all the way back in 2006! 8a2846e

I actually think we should drop these kind of platform hacks but at the very least it should be skipped when the tests are running.

@faho
Copy link
Member

@faho faho commented Jan 30, 2020

I actually think we should drop these kind of platform hacks

The one reason I can see for this is that we used to call external tools quite a bit, and the solaris ones are... different, so this would help. But since this was introduced we've reduced our dependence on external tools quite a bit (e.g. via string and math), so this has even less of a reason for existing.

So: Yes, let's remove it, but preferably for 3.2. For 3.1 I'd just accept the failure - turning the test off doesn't seem like it'd help much.

@Mno-hime
Copy link
Author

@Mno-hime Mno-hime commented Jan 31, 2020

Just FYI, I run the build and test with GNU utilities taking precedence in the $PATH.

Anyway, I am happy to give patch a shot, when there's one.

@zanchey
Copy link
Member

@zanchey zanchey commented Jan 31, 2020

Something like this should work:

diff --git a/share/config.fish b/share/config.fish
index 400556832..6157c7c1c 100644
--- a/share/config.fish
+++ b/share/config.fish
@@ -123,7 +123,7 @@ end
 # system utilities.
 #

-if test -d /usr/xpg4/bin
+if begin; not set -q FISH_UNIT_TESTS_RUNNING; and test -d /usr/xpg4/bin; end
     not contains -- /usr/xpg4/bin $PATH
     and set PATH /usr/xpg4/bin $PATH
 end

(or just patch the test to use /usr/xpg4/bin as the test path, I suppose)

@faho
Copy link
Member

@faho faho commented Jan 31, 2020

Something like this should work:

TBH I'd rather just remove that code entirely:

diff --git a/share/config.fish b/share/config.fish
index 400556832..acba33c09 100644
--- a/share/config.fish
+++ b/share/config.fish
@@ -115,19 +115,6 @@ function : -d "no-op function"
     true
 end

-#
-# This is a Solaris-specific test to modify the PATH so that
-# Posix-conformant tools are used by default. It is separate from the
-# other PATH code because this directory needs to be prepended, not
-# appended, since it contains POSIX-compliant replacements for various
-# system utilities.
-#
-
-if test -d /usr/xpg4/bin
-    not contains -- /usr/xpg4/bin $PATH
-    and set PATH /usr/xpg4/bin $PATH
-end
-

Granted it's a bit late in the cycle, but it would be nice to know what, if anything, breaks.

@ridiculousfish
Copy link
Member

@ridiculousfish ridiculousfish commented Jan 31, 2020

Patching the test in 3.1, and removing the xpg4 check in master, seems sensible to me.

@zanchey
Copy link
Member

@zanchey zanchey commented Feb 2, 2020

If @Mno-hime can confirm that my patch works I'll do that.

@Mno-hime
Copy link
Author

@Mno-hime Mno-hime commented Feb 2, 2020

I run the @faho's change now, happy to test a 3.1-specific one too.

@zanchey
Copy link
Member

@zanchey zanchey commented Feb 3, 2020

@Mno-hime
Copy link
Author

@Mno-hime Mno-hime commented Feb 3, 2020

@zanchey That works for me too. Thanks!

@zanchey zanchey self-assigned this Feb 7, 2020
@zanchey zanchey removed this from the fish-future milestone Feb 7, 2020
@zanchey zanchey added this to the fish 3.2.0 milestone Feb 7, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug
Projects
None yet
Development

No branches or pull requests

5 participants