Commit graph

9275 commits

Author SHA1 Message Date
David Adam
4548f4f4b0 fish.spec: run all tests 2019-01-05 17:28:37 +08:00
David Adam
2c01e67a74 histfile tests: tweak expect commands to avoid crash on 32-bit platforms
Rather than killing the process with close, read EOF after sending the
"exit" command and wait for OS cleanup (per the expect examples).

Not cleaning up with wait caused expect to crash on all 32-bit platforms
including i586 and armv7l with "alloc: invalid block: 0xbf993ccb: 3d 3b".

64-bit platforms were not affected, for reasons that are not clear.
2019-01-05 16:03:15 +08:00
Mahmoud Al-Qudsi
4f196eef64 Bypass mutually exclusive CMake checks
There are some redundant CMake checks, in the sense that they are either
not needed or cannot possibly match if a previous check already passed.
2019-01-04 14:46:36 -06:00
Mahmoud Al-Qudsi
5196a42165 Prevent CMake configure checks for affecting future checks
Using CMAKE_PUSH_CHECK_STATE/CMAKE_POP_CHECK_STATE to prevent CMake
checks from permanently altering the environment used by future checks.
2019-01-04 14:30:14 -06:00
Mahmoud Al-Qudsi
490432c177 Globally set the _GNU_SOURCE define for CMake configuration checks 2019-01-04 14:18:02 -06:00
Fabian Homborg
04f1ea0680 share/config: Don't split /etc/paths entries on spaces
This used `read -la`, which _splits_.

Instead, don't do that, each line is its own entry.

Fixes #5481.

[ci skip]
2019-01-04 14:50:12 +01:00
Benjamin Nied
eabda835d5 fish.spec: switch to using a common rpm macro
CentOS 7 does not have rhel_version as one of its macros, so trying to
build results in CMake errors, since we get `cmake` instead of
`cmake3`. These additional conditions allow the spec to build
successfully on CentOS 7.

Using %rhel should allow one set of conditionals to work across CentOS 7
and RHEL 7.

This has been tested on both.
2019-01-04 21:16:51 +08:00
Fabian Homborg
9d4e460b29 string: Fix crash with _GLIBCXX_ASSERTIONS
This asserted because we accessed wcstring::front() when it was empty.

Instead, check explicitly for it being empty before.

Fixes #5479
2019-01-04 08:45:53 +01:00
Fabian Homborg
3a885d5e82 tests/cd: cd back before cleaning up
Otherwise this'd run afoul of OpenIndiana's "no removing $PWD" rule. Spoilsports!

See #5472.
2019-01-03 23:21:26 +01:00
David Adam
9fb18f6322 README: update to version-independent OBS repository
[ci skip]
2019-01-03 23:34:26 +08:00
Fabian Homborg
72c0213d42 docs: Document $hostname
Fixes #5469.

[ci skip]
2019-01-03 12:31:35 +01:00
Takuya Noguchi
6b37ff0502 Update ppa repo to fish shell 3.x
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-03 11:32:17 +01:00
Fabian Homborg
12d7c7feb6 Switch to readdir from readdir_r
It's deprecated in glibc, and does not work properly on Solaris.

Fixes #5458.
2019-01-03 11:19:45 +01:00
Fabian Homborg
f3e87b7996 tests/psub: Don't use grep -o and diff -q
These aren't available on OpenIndiana.

`grep -o` is easily changed to `string`, `diff -q` imitated with
`comm` and `test`.

See #5472.
2019-01-03 11:05:03 +01:00
Mahmoud Al-Qudsi
380bae80bf Fix wcstod_l detection under Linux
This was broken in a8eb02f9f5 when the
detection was corrected for FreeBSD. This patch makes the detection work
for both Linux and FreeBSD instead of one or the other (tested).
2019-01-02 19:07:53 -06:00
Mahmoud Al-Qudsi
3444e1db18 Fix unsafe locale usage in wcstod_l fallback
Using `setlocale` is both not thread-safe and not correct, as
a) The global locale is usually stored in static storage, so
   simultaneous calls to `setlocale` can result in corruption, and
b) `setlocale` changes the locale for the entire application, not
   just the calling thread. This means that even if we wrapped the
   `wcstod_l` in a mutex to prevent the previous point, the results
   would still be incorrect because this would incorrectly influence the
   results of locale-aware functions executed in other threads while
   this thread is executing.

The previous comment mentioned that `uselocale` hadn't worked. I'm not
sure what the failing implementation looked like, but `uselocale` can be
tricky. The committed implementation passes the tests for me under Linux
and FreeBSD.
2019-01-02 18:43:43 -06:00
Mahmoud Al-Qudsi
bc0a0b4bc8 Fix wcstod_l infinite recursion under FreeBSD
This was the actual issue leading to memory corruption under FreeBSD in
issue #5453, worked around by correcting the detection of `wcstod_l` so
that our version of the function is not called at all.

If we are 100% certain that `wcstod_l` does not exist, then then the
existing code is fine. But given that our checks have failed seperately
on two different platforms already (FreeBSD and Cygwin/newlib), it's a
good precaution to take.
2019-01-02 18:43:43 -06:00
Mahmoud Al-Qudsi
7af0cad23d Fall back to CMake's pkg-config-based search for curses
CMake seems to have trouble finding libraries from multiarch packages
that do not have the compatibility symlink installed to the
arch-independent library directory. Users must either manually supply
the path to the library in question via command-line parameters or we
can fall back to CMake's alternate method of finding packages based off
of pkg-config rather than using the hard-coded `FindCurses` CMake module
specific to the CMake version/distribution installed.
2019-01-02 18:38:55 -06:00
Mahmoud Al-Qudsi
74422e476b Define _GNU_SOURCE for wcstod_l check 2019-01-02 14:05:49 -06:00
Sean Molenaar
41b3331175 Add support for wayland copy/paste 2019-01-02 16:46:04 +01:00
David Adam
7191a42ca0 fish.spec: turn the BUILD_SHARED_LIBS option off
PCRE2 should only be built as a static library.

Closes #5448.
2019-01-02 21:38:30 +08:00
David Adam
6783c63eee fish.spec: tidy up extra CMake arguments 2019-01-02 21:36:55 +08:00
Mahmoud Al-Qudsi
ef23923c8d Drop use of deprecated bzero(3)
Use `memset(__, 0, __)` instead. Also fixes #5461 by not needing `bzero`
from `strings.h` anymore.
2019-01-02 00:28:25 -06:00
Mahmoud Al-Qudsi
d1913f0df0 Add workaround for Cygwin process management and job control bugs
We cannot wait by pgroup under Cygwin for unknown reasons. Always
wait on jobs by individual processes. See code for more information.
2019-01-02 00:14:07 -06:00
David Adam
63e70d601d autoconf: quiet warning by using AC_LANG_PROGRAM
e4b6007f33 introduced the following warning:

configure.ac:327: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call
detected in body

Fix by using the right autoconf macros for the job.
2019-01-01 22:10:22 +08:00
Fabian Homborg
ea6631641f tests/read.expect: Skip /dev/stdin if it doesn't exist
Fixes a failing test on alpine/musl.
2019-01-01 14:52:26 +01:00
Fabian Homborg
7afd7a1985 tests/histfile Remove history --save
This might crash on arch on sr.ht?
2019-01-01 14:52:26 +01:00
Fabian Homborg
8b5fa6f572 tests/test9: Guard locale
Musl!
2019-01-01 14:52:26 +01:00
Fabian Homborg
a84d22b926 tests/printf: Skip locale test on musl
It does not provide a `locale`, so we can't list the locales.
2019-01-01 14:52:26 +01:00
Fabian Homborg
217486e547 math: Use simpler format string
It seems like musl's printf here fails on `%*lc`. So we use `%*ls`,
which we already use in string, so it should work.
2019-01-01 14:52:26 +01:00
Fabian Homborg
ba8748877a tests/functions: Don't compare diff output
Turns out busybox diff (used on alpine) defaults to unified output,
which we can't use because that prints filenames, and those are
tempfiles made by psub.

Instead, we use builtins to print the first line and compare the others.
2019-01-01 14:52:26 +01:00
Fabian Homborg
54438f8dc1 tests/invocation: Check for tput 2019-01-01 14:52:26 +01:00
Fabian Homborg
e7221a21ef tests/invocation: Disable bad-switch test
This isn't all that important, and it breaks on musl just because the message is different.
Just skip it for now, until we figure out how to better test this.
2019-01-01 14:52:26 +01:00
Fabian Homborg
e83c0b1a53 tests/read: Set TERM=xterm explicitly 2019-01-01 14:52:26 +01:00
Fabian Homborg
b7369213e2 tests/interactive: Scope variables correctly
This `set TERM`. Which, if $TERM is inherited, is already exported,
but not if it isn't.

This is the case on sr.ht's arch images, so we failed without a TERM variable.
2019-01-01 14:52:26 +01:00
Fabian Homborg
1074a59d75 tests/invocation: Set colors after $TERM
builds.sr.ht doesn't set $TERM, so this failed.
2019-01-01 14:52:26 +01:00
Takuya Noguchi
7aca69780c Replace deprecated options with newly introduced options for gem.
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-01 14:28:13 +01:00
Fabian Homborg
9dc79cd8d5 completions/screen: Replace eval with var-as-command
[ci skip]
2019-01-01 14:04:47 +01:00
Fabian Homborg
4b8da10215 completions/modinfo: Don't check uname
This checks if uname exists (we already call it elsewhere without
check, nobody has complained, uname is in POSIX), then calls to see if
it's "Linux", and only then offers any completions.

Since we don't have any other version to offer, the check is worse
than useless.
2019-01-01 13:57:32 +01:00
Mahmoud Al-Qudsi
131f0f2de5 Speed up wait.expect test
(This is being committed to a branch on the main repository so I can
verify that Travis is able to run this OK.)
2018-12-31 19:36:08 -06:00
Curtis Jiang
f871951a87 fix OpenWrt and opkg support (#5454)
* add OpenWrt and opkg support

Signed-off-by: Curtis Jiang <jqqqqqqqqqq@qq.com>

* fix opkg list

Signed-off-by: Curtis Jiang <jqqqqqqqqqq@qq.com>
2018-12-31 16:48:03 +01:00
Fabian Homborg
9b980f5e6e Use fstatvfs if ST_LOCAL is available
Allows us to sometimes use mmap on NetBSD (proper capitalization is
important).
2018-12-31 14:24:24 +01:00
Fabian Homborg
e9ad88d4b0 Don't set the title on NetBSD's wscon
We might want to check the terminfo "XT" capability here, but for now
let's do the quick fix.
2018-12-31 14:24:23 +01:00
Fabian Homborg
b77a909a4f Make a few variables const
These are then passed to tparm, but we explicitly cast the const
away.
2018-12-31 14:24:23 +01:00
Fabian Homborg
58ceb00781 Make a few methods const
This helps on netbsd, because enter_standout_mode et al are const
there.

These methods don't alter their argument, so they should have been
const to begin with.
2018-12-31 14:24:23 +01:00
Fabian Homborg
c5f9f59555 Always cast to non-const for tparm
This is non-const on macOS, but some of the args we pass are always
const on netbsd.

I have no idea why you'd ever want this to modify its argument, but whatever.
2018-12-31 14:24:23 +01:00
Fabian Homborg
a608e5d581 cmake: Check for TPARM_VARARGS 2018-12-31 14:24:22 +01:00
Fabian Homborg
3e03625113 Don't try to use fstatfs on netbsd
I can find a man page for it, but it doesn't seem to work.
2018-12-31 14:24:22 +01:00
Fabian Homborg
e4b6007f33 Check for dirfd in autoconf build
This commit via
https://anonhg.netbsd.org/pkgsrc/file/tip/shells/fish/patches/patch-configure.ac,
credit to jklos@pkgsrc.org.
2018-12-31 14:24:22 +01:00
Fabian Homborg
ee5e4cf8e2 Use int tputs_arg_t on netbsd 2018-12-31 14:24:22 +01:00