Commit Graph

474 Commits

Author SHA1 Message Date
Johannes Altmanninger
8756bc3afb Update changelog 2026-03-27 22:24:03 +08:00
Helen Chong
ae4e258884 chore(update-dependencies.sh): pin Catppuccin theme repository commit for fetching
See also https://github.com/catppuccin/fish/pull/41

Closes #12525
2026-03-15 16:14:39 +08:00
Daniel Rainer
c5e4fed021 format: use 4-space indents in more files
Change some files which have lines whose indentation is not a multiple
of the 4 spaces specified in the editorconfig file.

Some of these changes are fixes or clear improvements (e.g. in Rust
macros which rustfmt can't format properly). Other changes don't clearly
improve the code style, and in some cases it might actually get worse.

The goal is to eventually be able to use our editorconfig for automated
style checks, but there are a lot of cases where conforming to the
limited editorconfig style spec does not make sense, so I'm not sure how
useful such automated checks can be.

Closes #12408
2026-03-09 16:52:07 +11:00
Daniel Rainer
29160a1592 gettext: support non-ASCII msgids for Rust
The `msguniq` call for deduplicating the msgids originating from Rust
previously did not get a header entry (empty msgid with msgstr
containing metadata). This works fine as long as all msgids are
ASCII-only. But when a non-ASCII character appears in a msgid, `msguniq`
errors out without a header specifying the encoding. To resolve this,
add the header to the input of this `msguniq` invocation and then remove
the header again using sed to prevent duplicating it for the outer
msguniq call at the end of the file.

Closes #12491
2026-03-03 15:14:39 +11:00
Daniel Rainer
3e7e57945c format: replace style.fish by xtask
Replace the `build_tools/style.fish` script by an xtask. This eliminates
the need for a fish binary for performing the formatting/checking. The
`fish_indent` binary is still needed. Eventually, this should be made
available as a library function, so the xtask can use that instead of
requiring a `fish_indent` binary in the `$PATH`.

The new xtask is called `format` rather than `style`, because that's a
more fitting description of what it does (and what the script it
replaces did).

The old script's behavior is not replicated exactly:
- Specifying `--all` and explicit paths is supported within a single
  invocation.
- Explicit arguments no longer have to be files. If a directory is
  specified, all files within it will be considered.
- The git check for un-staged changes is no longer filtered by file
  names, mainly to simplify the implementation.
- A warning is now printed if neither the `--all` flag nor a path are
  provided as arguments. The reason for this is that one might assume
  that omitting these arguments would default to formatting everything
  in the current directory, but instead no formatting will happen in
  this case.
- The wording of some messages is different.

The design of the new code tries to make it easy to add formatters for
additional languages, or change the ones we already have. This is
achieved by separating the code into one function per language, which
can be modified without touching the code for the other languages.
Adding support for a new formatter/language only requires adding a
function which builds the formatter command line based on the arguments
to the xtask, and calling that function from the main `format` function.

Closes #12467
2026-02-24 16:33:04 +11:00
David Adam
5b360238b2 dput_cf_gen: drop -x flag, only used for development 2026-02-21 10:58:12 +08:00
David Adam
5b44c9668f add script to generate a dput.cf for Ubuntu PPA uploads 2026-02-21 10:38:24 +08:00
David Adam
13a2ccae66 release.sh: add a couple of explanatory comments 2026-02-10 14:29:16 +08:00
Pothi Kalimuthu
65e726324a Fix the link to GitHub repo 2026-02-08 23:38:46 +08:00
Johannes Altmanninger
4e7e0139fd Update to sphinx 9.1
sphinx==9.1.0 depends on Python>=3.12,
so change our pinning policy to fit.
Note we still support Python 3.9 in user-facing code.

Steps:
1. edit updatecli.d/python.yml
2. remove bad "uv lock" from build_tools/update-dependencies.sh
   (didn't respect exclude-newer)
3. updatecli apply --config updatecli.d/python.yml
4. uv lock --upgrade --exclude-newer="$(date --date='7 days ago' --iso-8601)"
2026-02-08 13:12:41 +11:00
Johannes Altmanninger
c044e1d433 update-dependencies.sh: update and pin 3rd party github workflows 2026-02-08 13:12:41 +11:00
Johannes Altmanninger
14832117b6 release.sh: regression fixes
The error check in make_tarball.sh gives a false negative when building
from a release tag.
2026-02-03 12:10:40 +11:00
Daniel Rainer
e0916e793b format: don't use tabs for indentation
This is done in accordance with our editorconfig file.

Part of #12408
2026-02-03 11:26:59 +11:00
Johannes Altmanninger
0ae3b33f2f tarball: remove unused git-archive knob
The problem introduced by 081c469f6f (tarball: include
.cargo/config.toml again, 2026-01-13) seems solved by 09d8570922
(debian packaging: generate patches automatically, 2026-02-01),
so the argument to make_tarball.sh is no longer needed.
2026-02-02 12:22:45 +11:00
Johannes Altmanninger
73e3b47ebd tarball: capture Git version
Commit 92dae88f62 (tarball: remove redundant "version" file,
2026-01-12) committed to using Cargo.toml as single source of truth
for our version string.

This works fine for tarballs built from a tag, but those built from
an arbitrary Git commit will show a misleading version ("4.3.3"
instead of something like "4.3.3-190-g460081725b5-dirty").

Fix this by copying the Git version to the tarball's Cargo.{toml,lock}.

It's not clear if we really need this (it's only for nightly builds)
so we might end up reverting this.

Ref: https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$BdRagDGCV-8yVjBs0i3QyWUdBK820vTmjuSBqgpsuJY

Note that OBS builds are probably still broken from 081c469f6f
(tarball: include .cargo/config.toml again, 2026-01-13); see
https://github.com/fish-shell/fish-shell/pull/12292#discussion_r2694000477
2026-02-01 20:13:13 +11:00
andreacfromtheapp
c2f7c5fbeb feat: add catpuccin themes
Apologies about the unsolicited PR. I hope this helps.

Adding Catppuccin themes from: https://github.com/catppuccin/fish

They note:

Q: Where's the Latte theme?
A: All three themes contain Latte as the light variant. Install any of
them, and then set your system or terminal theme to light mode.

Not sure about Fish Shell policy to keep them up to date here, I hope
this is not a nuissance.

Closes #12299
2026-01-30 15:34:43 +11:00
Daniel Rainer
b62fa06753 asan: remove redundant handling
The special exit handling when running with address sanitization no
longer seems necessary. Our tests all pass without it.

Similarly, the leak sanitizer suppression is no longer needed, since we
don't get any warnings when running our checks without it.

Because our Rust code no longer has any ASAN-specific behavior, we don't
need the `asan` feature anymore.

Closes #12366
2026-01-25 03:19:22 +01:00
Daniel Rainer
20cc07c5cd xtask: add html-docs task
This task is a bit annoying to implement because `sphinx-build` depends
on `fish_indent`, so that needs to be built, and the binary location
added to `PATH`.

Building `fish_indent` can be avoided by setting the `--fish-indent`
argument to the path to an existing `fish_indent` executable.

Use the new xtask in CMake builds. To do so without having to add
configuration options about where to put the docs, or having to copy
them from the default location to `build/user_doc`, we instead get rid of
the `user_doc` directory and change the code which accesses the docs to
read them from the non-configurable default output location in Cargo's
target directory.

Part of #12292
2026-01-21 17:43:26 +01:00
Daniel Rainer
07394a1621 style.fish: canonicalize workspace root
Use a canonicalized absolute path for the workspace root to make errors
containing paths easier to read.

Closes #12359
2026-01-21 17:43:26 +01:00
Johannes Altmanninger
081c469f6f tarball: include .cargo/config.toml again
The problem worked around by commit e4674cd7b5 (.cargo/config.toml:
exclude from tarball, 2025-01-12) is as follows:
our OBS packages are built by doing something like

	tar xf $tarball && tar xf $vendor_tarball

except that the tool apparently break when a file is present in
both tarballs.

Our workaround is to not include .cargo/config.toml in the tarball.

The workaround seems too broad. It need not affect all tarballs
but only the ones used by OBS. We want to add xtask aliases to
.cargo/config.toml. They will be used by CMake targets (sphinx-doc),
so they should be available to tarball consumers.

Restrict the scope of the workaround: add back .cargo/config.toml
to the export, and allow opting in to this behavioer by passing a
negative pathspec

	build_tools/make_tarball.sh :/!.cargo/config.toml
2026-01-14 18:28:04 +01:00
Daniel Rainer
860f75ee97 tarballs: append to cargo config
This allows putting other configuration into the config file without it
being deleted for tarballs.

https://github.com/fish-shell/fish-shell/pull/12292#discussion_r2678697643
2026-01-12 19:49:32 +01:00
Johannes Altmanninger
b60582ff75 build.rs: remove code duplication in version computation
get_version() in build.rs duplicates some logic in
build_tools/git_version_gen.sh. There are some differences

1. When computing the Git hash, get_version() falls back to reading
  .git/HEAD directly if "git describe" fails
1.1. Git is not installed
     Not sure if this is a good strong reason. If you don't have
     Git installed, how would you have created ".git"? If the exact
     Git SHA is important, maybe we should use something like gitoxide
     for this rather than implementing our own.
1.2. there is a permission problem
     The case mentiond in 0083192fcb (Read git SHA ourselves if it
     is unavailable, 2024-12-09) doesn't seem to happen with current
     versions of Git: "sudo git describe" works fine.  Something like
     "sudo -u postgres git describe" doesn't. We could support that
     but let's wait until we know of a use case.
1.3 there are no tags
    (when doing "cargo install --git", as mentioned in 0dfc490721
    (build.rs: Use Cargo_PKG_VERSION if no version could be found,
    2024-06-10)).
    Missing tags are no longer a problem because we read the version
    from Cargo.toml now. Tweak the script to make sure that the
    version is 4.3.3-g${git_sha} instead of just ${git_sha}.

2. get_version() falls back to jj too.
   That was added for jj workspaces that don't have a Git worktree;
   but those should be one their way out; when using jj's Git backend,
   all workspaces will get an associated worktre.
2026-01-12 12:17:48 +01:00
Johannes Altmanninger
92dae88f62 tarball: remove redundant "version" file
Use the version in Cargo.toml instead.

Print a warning if the Cargo.toml version is not a prefix of the Git
version.  This can happen legit scenarios, see 0dfc490721 (build.rs:
Use Cargo_PKG_VERSION if no version could be found, 2024-06-10)
but the next commit will fix that.

Also remove stale comments in git_version_gen.sh.
2026-01-12 12:17:48 +01:00
Johannes Altmanninger
f7d9c92820 git_version_gen: don't silence stderr
This should never fail, and error output doesn't hurt here.
2026-01-12 12:17:48 +01:00
Daniel Rainer
860bba759d git_version_gen: always output to stdout
Now that the script no longer writes to files, we can remove the
`--stdout` flag and instead output to stdout by default.

Closes #12307
2026-01-12 12:17:27 +01:00
Daniel Rainer
564ef66665 git_version_gen: remove obsolete code
The `git_version_gen.sh` script is no longer used to write any files, so
remove the logic for it.

This code included handling for permission problems when running `git
describe`. It was introduced by
15f1b5f368, but unfortunately without
mentioning which CVE caused the change in git. I found CVE-2022-24765,
which was published not long before the commit was made, and its
description looks like it's fitting. On a recent version of git
(2.52.0), I had no problems running `make && sudo make install`, so it
seems like this issue might no longer be relevant. One suboptimal thing
to note is that `sudo make install` currently builds `fish_indent` even
if it was built via `make` before, which is not great, but unrelated to
these changes.

Part of #12307
2026-01-12 12:17:27 +01:00
Daniel Rainer
557f6d1743 check: allow overriding default Rust toolchain
This is useful for running the checks with a toolchain which is
different from the default toolchain, for example to check if everything
works with our MSRV, or on beta/nightly toolchains. Additionally,
providing a way to run using the nightly toolchain allows writing
wrappers around `check.sh` which make use of nightly-only features.

The toolchain could be changed using `rustup toolchain default`, but if
the toolchain should only be used for a specific run, this is
inconvenient, and it does not allow for concurrent builds using
different toolchains.

Closes #12281
2026-01-06 17:54:56 +00:00
Johannes Altmanninger
7ebd2011ff update-dependencies.sh: fix uv lock --check command 2026-01-03 15:54:04 +01:00
Johannes Altmanninger
931072f5d1 macos packages: don't add redundant hardlinks to fat binary
Commit 7b4802091a installs fish_indent and fish_key_reader as
hardlinks to fish.  When we create our fat binary for macOS, we add
3 of these X86 binaries to the fattened one,
resulting in a corrupted Mach-O binary. Fix that.

Fixes #12224
2025-12-29 16:19:48 +01:00
Johannes Altmanninger
354dc3d272 docs: use correct version file for HTML docs from tarball
Prior to commit 135fc73191 (Remove man/HTML docs from tarball, require
Sphinx instead, 2025-11-20), HTML docs were built from a Git worktree.

Now they are built in the tarball.  We call
build_tools/git_version_gen.sh from doc_src so it fails to find the
version file. Fix that.

Fixes #12228
2025-12-29 16:19:47 +01:00
Johannes Altmanninger
767115a93d build_tools/make_macos_pkg.sh: fix when no CMake option is passed 2025-12-29 16:19:47 +01:00
Johannes Altmanninger
443fd604cc build_tools/release.sh: don't add dch entry for snapshot version 2025-12-28 10:55:09 +01:00
Johannes Altmanninger
9e022ff7cf build_tools/release.sh: fix undefined variable for next milestone 2025-12-28 10:52:20 +01:00
Johannes Altmanninger
b72127a0b7 build_tools/release-notes.sh: fix RST syntax 2025-12-28 10:03:08 +01:00
Johannes Altmanninger
0ab2a46424 build_tools/release.sh: docs have been removed from tarball
See 135fc73191 (Remove man/HTML docs from tarball, require Sphinx
instead, 2025-11-20).
2025-12-28 10:03:08 +01:00
Daniel Rainer
5c3941f0dd check.sh: rename template to gettext template
This is done in preparation for a second temporary directory used for
Fluent ID extraction.

Closes #12203
2025-12-24 00:47:01 +00:00
Daniel Rainer
d4745b633b check.sh: don't build docs of dependencies
We only run `cargo doc` here to check for issues with fish's
documentation, so there is no need to build docs of dependencies.

Closes #12201
2025-12-24 00:21:41 +00:00
Daniel Rainer
9b75b6ee88 l10n: move po/ to localization/po/
This is done in preparation for Fluent's FTL files, which will be placed
in `localization/fluent/`. Having a shared parent reduces top-level
clutter in the repo and makes it easier to find the localization files
for translators, including realizing that both PO and FTL files exist.

We keep PO and FTL files in separate directories because we need to
rebuild on any changes in the PO directory (technically only when there
are changes to `*.po` files, but due to technical limitations we can't
reliably trigger rebuilds only if those changes but not other files in
the same directory.) Changes to FTL files do not require rebuilds for
dev builds, since for these `rust-embed` does not actually embed them
into the binary but rather loads them from the file system at runtime.

Closes #12193
2025-12-21 12:11:49 +01:00
Daniel Rainer
c9fcd31480 widecharwidth: extract into separate crate
This should help with improving incremental build speed. Extracting this
code is easy, since it does not have dependencies. It also unblocks
further extraction of code which depends on widecharwidth.

Closes #12181
2025-12-18 15:13:50 +01:00
Johannes Altmanninger
1db4dc4c3e build_tools/update-dependencies.sh: add dependency cooldown for Python packages
See
https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
2025-12-16 13:19:16 +01:00
Johannes Altmanninger
548f37eabb Simplify make_tarball.sh
Note that we don't need to set the mtime anymore -- it was added in
5b5b53872c (tarball generation: include config.h.in, set mode and
ownership, 2013-09-09) for autotools' multi-stage builds.
2025-12-14 15:37:46 +01:00
Johannes Altmanninger
135fc73191 Remove man/HTML docs from tarball, require Sphinx instead
Advantages of prebuilt docs:
- convenient for users who compile the tarball
- convenient for packagers who don't have sphinx-build packaged
  (but packaging/installing that should be easy nowadays?
  see https://github.com/fish-shell/fish-shell/issues/12052#issuecomment-3520336984)

Disadvantages:
- Extra build stage / code path
- Users who switch from building from tarball to building from source
  might be surprised to lose docs.
- People put the [tarballs into Git repositories](https://salsa.debian.org/debian/fish), which seems weird.

Remove the tarball.

Let's hope this is not too annoying to users who build on outdated
distros that don't have sphinx -- but those users can probably use
our static builds, skipping all compilation.

To avoid breaking packagers who use `-DBUILD_DOCS=OFF` (which still
installs prebuilt docs), rename the option.

Closes #12088
2025-12-14 15:37:46 +01:00
Daniel Rainer
3e2336043a gettext-extract: fix race condition
Multiple gettext-extraction proc macro instances can run at the same
time due to Rust's compilation model. In the previous implementation,
where every instance appended to the same file, this has resulted in
corruption of the file. This was reported and discussed in
https://github.com/fish-shell/fish-shell/pull/11928#discussion_r2488047964
for the equivalent macro for Fluent message ID extraction. The
underlying problem is the same.

The best way we have found to avoid such race condition is to write each
entry to a new file, and concatenate them together before using them.
It's not a beautiful approach, but it should be fairly robust and
portable.

Closes #12125
2025-12-10 16:15:07 +01:00
Daniel Rainer
4642b28ea7 gettext: enable default features for extraction
There was a mismatch between the extraction done from
`build_tools/check.sh` and the one done in
`build_tools/fish_xgettext.fish`, resulting in messages guarded by
default features being extracted by the former but not the latter.
This brings them in sync.

Ideally, we would enable all features for extraction, but compiling with
`--all-features` is broken and manually keeping the features lists
updated is tedious and error prone, so we'll settle on only using
default features for now.

Closes #12103
2025-11-30 09:20:33 +01:00
David Adam
5130fc6f17 build_tools: add script to get supported Ubuntu versions 2025-11-29 00:05:24 +08:00
David Adam
b0a04f8648 release.sh: update Debian changelog as part of release 2025-11-28 21:21:27 +08:00
Johannes Altmanninger
0c67d0565a Commit help_sections data file
The help_sections.rs file was added to the tarball only as a quick hack.
There is a cyclic dependency between docs and fish:

"fish_indent" via "crates/build-man-pages" depends on "doc_src/".
So every "touch doc_src/foo.rst && ninja -Cbuild sphinx-docs"
re-builds fish.

In future "fish_indent" should not depend on "crates/build-man-pages".
Until then, a following commit wants to break this cyclic dependency
in a different way: we won't embed man pages (matching historical
behavior), which means that CMake builds won't need to run
sphinx-build.

But sphinx-build is also used for extracting help sections.

Also, the fix for #12082 will use help sections elsewhere in the code.

Prepare to remove the dependency on doc_src by committing the help
sections (we already do elsewhere).
2025-11-23 12:30:22 +01:00
Johannes Altmanninger
4f5cad977c release.yml: assert that Sphinx is installed on macOS package builder 2025-11-23 12:30:22 +01:00
Johannes Altmanninger
bed2da9b83 Check license of dependencies in CI 2025-11-23 12:30:22 +01:00
Johannes Altmanninger
a8bf4db32d release.sh: minor fixes
After pushing to the fish-site repo, make sure to update the local
repo's view of origin/master to what we have successfully pushed.
2025-11-16 11:33:11 +01:00