mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-18 20:53:40 +08:00
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
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.
This commit is contained in:
parent
46ce01223b
commit
10ac98e2ea
|
@ -185,11 +185,13 @@ This will place the binaries in ``~/.cargo/bin/``, but you can place them wherev
|
||||||
|
|
||||||
This build won't have the HTML docs (``help`` will open the online version) or translations.
|
This build won't have the HTML docs (``help`` will open the online version) or translations.
|
||||||
|
|
||||||
It requires sphinx by default, if sphinx-build is not available you can build without man pages by running it with $FISH_BUILD_DOCS set to 0::
|
It will try to build the man pages with sphinx-build. If that is not available and you would like to include man pages, you need to install it and retrigger the build script, e.g. by setting FISH_BUILD_DOCS=1::
|
||||||
|
|
||||||
FISH_BUILD_DOCS=0 cargo install --path .
|
FISH_BUILD_DOCS=1 cargo install --path .
|
||||||
|
|
||||||
You can also link it statically (but not against glibc) and move it to other computers.
|
Setting it to "0" disables the inclusion of man pages.
|
||||||
|
|
||||||
|
You can also link this build statically (but not against glibc) and move it to other computers.
|
||||||
|
|
||||||
Contributing Changes to the Code
|
Contributing Changes to the Code
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
6
build.rs
6
build.rs
|
@ -378,7 +378,11 @@ fn build_man(build_dir: &Path) {
|
||||||
// which is unfortunate - but the docs are pretty important because they're also used for --help.
|
// which is unfortunate - but the docs are pretty important because they're also used for --help.
|
||||||
match Command::new("sphinx-build").args(args).spawn() {
|
match Command::new("sphinx-build").args(args).spawn() {
|
||||||
Err(x) if x.kind() == std::io::ErrorKind::NotFound => {
|
Err(x) if x.kind() == std::io::ErrorKind::NotFound => {
|
||||||
panic!("Could not find sphinx-build to build man pages.\nInstall sphinx or disable building the docs by setting $FISH_BUILD_DOCS=0.");
|
if env::var("FISH_BUILD_DOCS") == Ok("1".to_string()) {
|
||||||
|
panic!("Could not find sphinx-build to build man pages.\nInstall sphinx or disable building the docs by setting $FISH_BUILD_DOCS=0.");
|
||||||
|
}
|
||||||
|
println!("cargo:warning=Cannot find sphinx-build to build man pages.");
|
||||||
|
println!("cargo:warning=If you install it now you need to run `cargo clean` and rebuild, or set $FISH_BUILD_DOCS=1 explicitly.");
|
||||||
}
|
}
|
||||||
Err(x) => {
|
Err(x) => {
|
||||||
// Another error - permissions wrong etc
|
// Another error - permissions wrong etc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user