mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
Do not embed man pages in CMake builds
Commit0709e4be8b(Use standalone code paths by default, 2025-10-26) mainly wanted to embed internal functions to unbreak upgrade scenarios. Embedding man pages in CMake has small-ish disadvantages: 1. extra space usage 2. less discoverability 3. a "cyclic" dependency: 1. "sphinx-docs" depends on "fish_indent" 2. "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, just to re-run sphinx-build. The significant one is number 3. It can be worked around by running sphinx-build with stale "fish_indent" but I don't think we want to do that. Let's backtrack a little by stopping embedding man pages in CMake builds; use the on-disk man pages (which we still install). The remaining "regression" from0709e4be8bis that "ninja -Cbuild fish" needs to rebuild whenever anything in "share/" changes. I don't know if that's also annoying? Since man pages for "build/fish" are not in share/, expose the exact path as $__fish_man_dir.
This commit is contained in:
13
tests/checks/__fish_tried_to_embed_manpages.fish
Normal file
13
tests/checks/__fish_tried_to_embed_manpages.fish
Normal file
@@ -0,0 +1,13 @@
|
||||
# RUN: %fish %s
|
||||
|
||||
set -l value (string join , \
|
||||
embed-manpages="$(__fish_tried_to_embed_manpages && echo true || echo false)" \
|
||||
"build-system=$(status build-info | string replace -rf 'Build system: (.*)' '$1')"
|
||||
)
|
||||
switch $value
|
||||
case embed-manpages=true,build-system=Cargo
|
||||
case embed-manpages=false,build-system=CMake
|
||||
case '*'
|
||||
echo Expected embedded man pages to be detected as true iff using Cargo
|
||||
echo got: $value
|
||||
end
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
# NOTE: When our executable is located outside the build directory, these are different.
|
||||
# CHECKERR: config: paths.data: {{.*}}/share
|
||||
# CHECKERR: config: paths.man: {{.*/user_doc/man|\|not found\|}}
|
||||
# CHECKERR: config: paths.doc: {{.*/user_doc/html|\|not found\|}}
|
||||
|
||||
# CHECKERR: config: sourcing {{.+}}/etc/config.fish
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# RUN: %fish %s
|
||||
|
||||
# Override the test-override again.
|
||||
__fish_data_with_file functions/__fish_print_help.fish source
|
||||
|
||||
# REQUIRES: command -v sphinx-build
|
||||
# REQUIRES: command -v man
|
||||
# REQUIRES: test "$FISH_BUILD_DOCS" != "0"
|
||||
|
||||
# Override the test-override again.
|
||||
__fish_data_with_file functions/__fish_print_help.fish source
|
||||
|
||||
set -l deroff col -b -p -x
|
||||
|
||||
set -lx MANWIDTH 80
|
||||
|
||||
Reference in New Issue
Block a user