Commit Graph

19585 Commits

Author SHA1 Message Date
Johannes Altmanninger
8fd0399ed3 Remove runaway kw_builtin in not statement definition
This was added accidentally in 971d257e67 (Port AST to Rust,
2023-04-02).  It does not seem to be causing an observable effect
(although I didn't try hard).
2024-12-16 06:33:47 +01:00
Johannes Altmanninger
ac951427af Fix alt-l on multiline tokens
This would invoke test with extra arguments.
2024-12-16 06:33:47 +01:00
Fabian Boehm
95f4c9c07e One more FreeBSD-only-in-CI
Some checks failed
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Lock threads / lock (push) Has been cancelled
2024-12-15 17:38:37 +01:00
Fabian Boehm
8add30e3bf pexpects: Disable exit on CI Darwin/FreeBSD 2024-12-15 17:33:12 +01:00
Fabian Boehm
cb3fbd3a5c pexpects: Disable 2 only on CI
As the comment says
2024-12-15 17:32:47 +01:00
Fabian Boehm
9b9663ea44 CHANGELOG: We need a C compiler even for the main binary
Not just libc.c, but also the rsconf tests.
2024-12-15 17:15:35 +01:00
David Adam
a23cd62ec7 RPM/Debian packaging: update dependencies to match reality 2024-12-15 23:53:55 +08:00
David Adam
489d6b9dd8 CHANGELOG: work on 4.0.0 2024-12-15 23:52:30 +08:00
Fabian Boehm
10ac98e2ea installable: Only panic without sphinx if FISH_BUILD_DOCS=1
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
It's pretty annoying that this panics without sphinx, because the
install itself would be *working*.

So instead we tell the user that they need to clean or set
$FISH_BUILD_DOCS if they want to try again.
2024-12-15 09:00:16 +01:00
Fabian Boehm
46ce01223b staticbuilds: Fix aarch64 cross-compile
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
We get "undefined reference to `__memmove_chk'" when compiling
pcre2 (via pcre2-sys) on newer Ubuntu.

That one is used with higher fortify_source levels, and Ubuntu 24.04
defaults to 3, while my arch system (where I cannot reproduce)
defaults to 2.
2024-12-14 13:39:20 +01:00
Fabian Boehm
50c737fa55 CHANGELOG 2024-12-14 12:14:55 +01:00
Fabian Boehm
a98997fab0 curses: Just use our hardcoded xterm-256color entry as the fallback
The values we would try are:

xterm-256color, xterm, ansi, dumb

This is a pretty useless list, because systems without
"xterm-256color" but with "ansi" basically don't exist,
and it is very likely that the actual terminal is more
xterm-compatible than it is ansi.

So instead we just use our xterm-256color definition, which has a high
likelihood of being basically correct.
2024-12-14 12:10:34 +01:00
Fabian Boehm
cc8fa0f780 completions/rclone: Make version check more lenient
This has been observed to be "rclone 1.68.2" instead of "rclone
v1.68.2", missing the "v".
2024-12-14 11:20:29 +01:00
Fabian Boehm
378e9b236a Silence time_t deprecation
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This is not something that affects us or we can do anything about.
2024-12-14 09:34:52 +01:00
Johannes Altmanninger
0a145cff3c Fix clippy lints 2024-12-14 09:31:20 +01:00
Johannes Altmanninger
f9febba2b0 Fix replacing completions with a -foo prefix
Fixes #10904
2024-12-14 09:31:20 +01:00
Fabian Boehm
84d8655677 fmt!
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-12-13 21:57:07 +01:00
Fabian Boehm
abc1a45ea1 Shorten error for broken $TERM 2024-12-13 21:46:17 +01:00
Fabian Boehm
be16eeef69 Make --install install without confirmation, and not exit 2024-12-13 19:19:26 +01:00
Fabian Boehm
6d28845c2b Automatically attempt to install
This is fairly subtle.

When installable, and we either can't find the version file or it is
outdated, we ask the user to confirm installation (just like `--install`).

We do that only if we are really truly interactive (with a tty!) to
avoid `fish -c` running into problems.
This check could be tightened even more, because currently:

```fish
fish -ic 'echo foo'
```

asks, while

```fish
fish -ic 'echo foo' < /dev/null
```

does not.

`fish -c` will still error out if it can't find the config, but it
will just run if it is out of date.
2024-12-13 19:19:26 +01:00
Fabian Boehm
99fa8aaaa7 Really hide install() from clippy
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
2024-12-11 17:21:34 +01:00
Fabian Boehm
fa298c41e0 Hide install() from clippy
Not checkable because it would require sphinx
2024-12-11 17:18:34 +01:00
Fabian Boehm
327aa964e9 Disable default features for cargo test
Unfortunately it does not appear like #[cfg(test)] works for build.rs?

Investigating a better solution, but this is a good idea anyway (or `make
test` would generate man pages via build.rs!)
2024-12-11 17:05:38 +01:00
Fabian Boehm
6c852655dd Disable man page building in clippy
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
This would otherwise break any clippy run if you didn't have sphinx installed.
2024-12-11 16:56:14 +01:00
Fabian Boehm
0e0d56d805 format 2024-12-11 16:51:25 +01:00
Fabian Boehm
2d2f18c159 installable builds: Fail when building man pages fails
This is unfortunately necessary, because otherwise it would not rerun
the build script just because you installed sphinx.

Because we use the man pages for --help output, they're pretty
necessary.

To override it, you can set $FISH_BUILD_DOCS=0, like

```fish
FISH_BUILD_DOCS=0 cargo install --path .
```
2024-12-11 16:49:49 +01:00
David Adam
c58313fb2b README: minor formatting update
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-12-11 08:04:52 +08:00
David Adam
662607fb2a README: minor formatting update 2024-12-11 08:04:15 +08:00
David Adam
6ae887383c README: improve instructions on building from source
Closes #10894.
2024-12-11 08:04:00 +08:00
David Adam
1b33e4b9a6 CHANGELOG: work on 4.0.0 2024-12-11 08:03:26 +08:00
Fabian Boehm
0083192fcb Read git SHA ourselves if it is unavailable
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
`git describe` *may* fail e.g. for `sudo make install`,
so we just read the SHA ourselves.
2024-12-09 16:57:47 +01:00
Peter Ammon
5c8b6adc2c Fix infinite prompt loop if status message is printed in prompt
Some checks failed
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Lock threads / lock (push) Has been cancelled
fish will print messages for some jobs when they exit abnormally, such as
with SIGABRT. If a job exits abnormally inside the prompt, then (prior to
this commit) fish would print the message and re-trigger the prompt, which
could result in an infinite loop. This has existed for a very long time.

Fix it by reaping jobs after running the prompt, and NOT triggering a
redraw based on that reaping. We still print the message but the prompt is
not executed.

Add a test.

Fixes #9796
2024-12-08 18:12:59 -08:00
Peter Ammon
c97b1a992c
Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
Fabian Boehm
56a1403350 Revert "Enable gettext without the _nl_msg_cat_cntr gnuism"
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This built on my test system, might be version differences.

(it's also not enough to make it *work*, but a necessary step)

This reverts commit 6fded249cd.
2024-12-08 22:04:59 +01:00
Fabian Boehm
6fded249cd Enable gettext without the _nl_msg_cat_cntr gnuism
This should allow e.g. musl to be translated.
2024-12-08 21:53:20 +01:00
Johannes Altmanninger
421ce13be6 Fix replacing completions spuriously quoting ~
Commit 29dc30711 (Insert some completions with quotes instead of
backslashes, 2024-04-13) wrongly copmletes

	$ cat ~/space

to

	$ cat '~/path with spaces'

Today completions can be either replacing or appending.  We never quote
(but backslash-escape) appending completions (unless they "append"
to an empty token).  We always quote replacing completions. The
assumption in this part of the code is that replacing completions
can be quoted without changing meaning.

This assumption is wrong for tildes.  For the backslash-escaping code
path, we take care of this edge case via a special DONT_ESCAPE_TILDES
flag. However that flag does not take effect when using quotes for
escaping. Fix that.

Unfortunately, e97a4fab7 (Escape : and = in file completions,
2024-04-19) introduced a (hopefully temporary) code clone in
escape_separators, which made added an extra step to debugging here.
2024-12-08 15:27:08 +01:00
Fabian Boehm
99b5e6e0e7 completions/cargo: Complete packages to uninstall
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-12-08 09:13:20 +01:00
Fabian Boehm
004953a3b2 Revert "BuiltinData to use const constructor function"
Unfortunately, this does not work with rust 1.70.

This reverts commit 7e516925e9.
2024-12-08 07:52:57 +01:00
Peter Ammon
7e516925e9
BuiltinData to use const constructor function
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This makes the list of builtins one line per builtin. No functional change.
2024-12-07 10:37:53 -08:00
Peter Ammon
0b68fbfd85
Clean up some stale comments 2024-12-07 10:37:53 -08:00
Fabian Boehm
fcf8ed0628 Clarify docs on self-installing builds
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-12-07 13:13:18 +01:00
Fabian Boehm
210d687b2b CHANGELOG installable fish
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-12-06 22:13:34 +01:00
Fabian Boehm
74e0436c3c Document installable builds 2024-12-06 22:12:26 +01:00
Fabian Boehm
3360dcbebc Make static builds on Github Actions
For x86_64 and cross-compiled for aarch64, manually triggered

It *seems* to work, but I had to explicitly disable gettext for it (which is AFAICT currently non-functional under musl anyway).

Also it will create one .zip containing two .tar.xzs. It is about 8MB, which should be fine, tbh.
2024-12-06 22:12:26 +01:00
Fabian Boehm
1599293796 Build man pages into installable fish
This calls sphinx-build from build.rs to include the man pages in the binary.

We don't abort if sphinx doesn't exist, but we do if it failed.
2024-12-06 22:12:26 +01:00
Fabian Boehm
2343a6b1f1 docs: Read version from the version file
Makes it possible to generate the man pages without fish_indent
available.

(not the html docs because they highlight via fish_indent!)
2024-12-06 22:12:26 +01:00
Fabian Boehm
7c73c5fec0 Make fish installable
When built with the default "installable" feature, the data files (share/) are
included in the fish binary itself.

Run `fish --install` or `fish --install=noconfirm` (for
non-interactive use) to install fish's data files into ~/.local/share/fish/install

To figure out if the data files are out of date, we write the current version
to a file on install, and read it on start.

CMake disables the default features so nothing changes for that, but this allows installing via `cargo install`,
and even making a static binary that you can then just upload and have extract itself.

We set $__fish_help_dir to empty for installable builds, because we do not have
a way to generate html docs (because we need fish_indent for highlighting).
The man pages are found via $__fish_data_dir/man
2024-12-06 22:12:26 +01:00
Fabian Boehm
7827a8e533 Make bin path an Option
It is possible we cannot acquire this
2024-12-06 22:12:26 +01:00
Fabian Boehm
aa30b4db4b Set crate version to 4.0.0-alpha1
The next version is gonna be 4.0.0
2024-12-06 22:12:26 +01:00
Fabian Boehm
378dc9123a git_version_gen: Just print the version
This was needed because we #included it in C++, but now it's easier to
have just the version in there
2024-12-06 22:12:26 +01:00