mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-09 17:01:16 -03:00
Compare commits
1 Commits
curly-unde
...
Integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4110b0b0ee |
@@ -1,27 +0,0 @@
|
||||
image: alpine/edge
|
||||
packages:
|
||||
- cargo
|
||||
- clang17-libclang
|
||||
- cmake
|
||||
- ninja
|
||||
- pcre2-dev
|
||||
- py3-pexpect
|
||||
- python3
|
||||
- rust
|
||||
- tmux
|
||||
sources:
|
||||
- https://github.com/fish-shell/fish-shell
|
||||
tasks:
|
||||
- build: |
|
||||
cd fish-shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja .. \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_DATADIR=share \
|
||||
-DCMAKE_INSTALL_DOCDIR=share/doc/fish \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=/etc
|
||||
ninja
|
||||
- test: |
|
||||
cd fish-shell/build
|
||||
ninja test
|
||||
@@ -1,23 +0,0 @@
|
||||
image: archlinux
|
||||
packages:
|
||||
- cmake
|
||||
- ninja
|
||||
- python
|
||||
- python-pexpect
|
||||
- tmux
|
||||
sources:
|
||||
- https://git.sr.ht/~faho/fish
|
||||
tasks:
|
||||
- build: |
|
||||
cd fish
|
||||
mkdir build || :
|
||||
cd build
|
||||
cmake -G Ninja .. \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_DATADIR=share \
|
||||
-DCMAKE_INSTALL_DOCDIR=share/doc/fish \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=/etc
|
||||
ninja
|
||||
- test: |
|
||||
cd fish/build
|
||||
ninja test
|
||||
@@ -1,30 +0,0 @@
|
||||
image: freebsd/latest
|
||||
packages:
|
||||
- cmake
|
||||
- gcc
|
||||
- gettext
|
||||
- gmake
|
||||
- llvm
|
||||
- terminfo-db
|
||||
- ninja
|
||||
- pcre2
|
||||
- py311-pexpect
|
||||
- python
|
||||
- rust
|
||||
- tmux
|
||||
sources:
|
||||
- https://github.com/fish-shell/fish-shell
|
||||
tasks:
|
||||
- build: |
|
||||
cd fish-shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja .. \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_DATADIR=share \
|
||||
-DCMAKE_INSTALL_DOCDIR=share/doc/fish \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=/etc
|
||||
ninja
|
||||
- test: |
|
||||
cd fish-shell/build
|
||||
ninja test
|
||||
@@ -1,8 +0,0 @@
|
||||
# This file is _not_ included in the tarballs for now
|
||||
# Binary builds on Linux packaging infrastructure need to overwrite it to make `cargo vendor` work
|
||||
# Releases and development builds made using OBS/Launchpad will _not_ reflect the contents of this
|
||||
# file
|
||||
|
||||
[resolver]
|
||||
# Make cargo 1.84+ respect MSRV (rust-version in Cargo.toml)
|
||||
incompatible-rust-versions = "fallback"
|
||||
91
.cirrus.yml
91
.cirrus.yml
@@ -1,91 +0,0 @@
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: 100
|
||||
CI: 1
|
||||
|
||||
linux_task:
|
||||
matrix:
|
||||
- name: alpine
|
||||
container: &step
|
||||
image: ghcr.io/krobelus/fish-ci/alpine:latest
|
||||
memory: 4GB
|
||||
- name: jammy
|
||||
container:
|
||||
<<: *step
|
||||
image: ghcr.io/krobelus/fish-ci/jammy:latest
|
||||
# - name: jammy-asan
|
||||
# container:
|
||||
# <<: *step
|
||||
# image: ghcr.io/krobelus/fish-ci/jammy-asan:latest
|
||||
# - name: focal-32bit
|
||||
# container:
|
||||
# <<: *step
|
||||
# image: ghcr.io/krobelus/fish-ci/focal-32bit:latest
|
||||
tests_script:
|
||||
# cirrus at times gives us 32 procs and 2 GB of RAM
|
||||
# Unrestriced parallelism results in OOM
|
||||
- lscpu || true
|
||||
- (cat /proc/meminfo | grep MemTotal) || true
|
||||
- mkdir build && cd build
|
||||
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCTEST_PARALLEL_LEVEL=6 ..
|
||||
- ninja -j 6 fish
|
||||
- ninja fish_run_tests
|
||||
only_if: $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
|
||||
linux_arm_task:
|
||||
matrix:
|
||||
- name: focal-arm64
|
||||
arm_container:
|
||||
image: ghcr.io/fish-shell/fish-ci/focal-arm64
|
||||
- name: jammy-armv7-32bit
|
||||
arm_container:
|
||||
image: ghcr.io/fish-shell/fish-ci/jammy-armv7-32bit
|
||||
tests_script:
|
||||
# cirrus at times gives us 32 procs and 2 GB of RAM
|
||||
# Unrestriced parallelism results in OOM
|
||||
- lscpu || true
|
||||
- (cat /proc/meminfo | grep MemTotal) || true
|
||||
- mkdir build && cd build
|
||||
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCTEST_PARALLEL_LEVEL=6 ..
|
||||
- ninja -j 6 fish
|
||||
- file ./fish
|
||||
- ninja fish_run_tests
|
||||
# CI task disabled during RIIR transition
|
||||
only_if: false && $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
|
||||
freebsd_task:
|
||||
matrix:
|
||||
# - name: FreeBSD 14
|
||||
# freebsd_instance:
|
||||
# image_family: freebsd-14-0-snap
|
||||
- name: FreeBSD 13
|
||||
freebsd_instance:
|
||||
image: freebsd-13-2-release-amd64
|
||||
# - name: FreeBSD 12.3
|
||||
# freebsd_instance:
|
||||
# image: freebsd-12-3-release-amd64
|
||||
tests_script:
|
||||
- pkg install -y cmake-core devel/pcre2 devel/ninja misc/py-pexpect git-lite terminfo-db
|
||||
# libclang.so is a required build dependency for rust-c++ ffi bridge
|
||||
- pkg install -y llvm
|
||||
# BSDs have the following behavior: root may open or access files even if
|
||||
# the mode bits would otherwise disallow it. For example root may open()
|
||||
# a file with write privileges even if the file has mode 400. This breaks
|
||||
# our tests for e.g. cd and path. So create a new unprivileged user to run tests.
|
||||
- pw user add -n fish-user -s /bin/csh -d /home/fish-user
|
||||
- mkdir -p /home/fish-user
|
||||
- chown -R fish-user /home/fish-user
|
||||
- mkdir build && cd build
|
||||
- chown -R fish-user ..
|
||||
- sudo -u fish-user -s whoami
|
||||
# FreeBSD's pkg currently has rust 1.66.0 while we need rust 1.70.0+. Use rustup to install
|
||||
# the latest, but note that it only installs rust per-user.
|
||||
- sudo -u fish-user -s fetch -qo - https://sh.rustup.rs > rustup.sh
|
||||
- sudo -u fish-user -s sh ./rustup.sh -y --profile=minimal
|
||||
# `sudo -s ...` does not invoke a login shell so we need a workaround to make sure the
|
||||
# rustup environment is configured for subsequent `sudo -s ...` commands.
|
||||
# For some reason, this doesn't do the job:
|
||||
# - sudo -u fish-user sh -c 'echo source \$HOME/.cargo/env >> $HOME/.cshrc'
|
||||
- sudo -u fish-user -s cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCTEST_PARALLEL_LEVEL=1 ..
|
||||
- sudo -u fish-user sh -c '. $HOME/.cargo/env; ninja -j 6 fish'
|
||||
- sudo -u fish-user sh -c '. $HOME/.cargo/env; ninja fish_run_tests'
|
||||
only_if: $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
@@ -6,3 +6,5 @@
|
||||
BasedOnStyle: Google
|
||||
ColumnLimit: 100
|
||||
IndentWidth: 4
|
||||
# We don't want OCLint pragmas to be reformatted.
|
||||
CommentPragmas: '^!OCLINT'
|
||||
|
||||
26
.cppcheck.rules
Normal file
26
.cppcheck.rules
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<![CDATA[
|
||||
<!-- Sadly we can't enable the following two rules since doing so causes false
|
||||
positives in standard header files rather than just project specific
|
||||
source files. If we can find a way to enable these rules by also
|
||||
excluding system include files we should do so.
|
||||
<rule version="1">
|
||||
<pattern> wcwidth \(</pattern>
|
||||
<message>
|
||||
<id>wcwidthForbidden</id>
|
||||
<severity>warning</severity>
|
||||
<summary>Always use fish_wcwidth rather than wcwidth.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<rule version="1">
|
||||
<pattern> wcswidth \(</pattern>
|
||||
<message>
|
||||
<id>wcswidthForbidden</id>
|
||||
<severity>warning</severity>
|
||||
<summary>Always use fish_wcswidth rather than wcswidth.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
<--!>
|
||||
]]>
|
||||
12
.cppcheck.suppressions
Normal file
12
.cppcheck.suppressions
Normal file
@@ -0,0 +1,12 @@
|
||||
// suppress all instances of varFuncNullUB: "Passing NULL after the last typed
|
||||
// argument to a variadic function leads to undefined behaviour." That's
|
||||
// because all the places we do this are valid and won't cause problems even
|
||||
// on a ILP64 platform because we're careful about using NULL rather than 0.
|
||||
varFuncNullUB
|
||||
// Suppress the warning about unmatched suppressions. At the moment these
|
||||
// warnings are emitted even when removing the suppression comment results in
|
||||
// the warning being suppressed. In other words this unmatchedSuppression
|
||||
// warnings are false positives.
|
||||
unmatchedSuppression
|
||||
// Suppress this one because it reports assert(condition && "message"), which we use all over the place
|
||||
incorrectStringBooleanError
|
||||
@@ -12,7 +12,7 @@ max_line_length = 100
|
||||
[{Makefile,*.in}]
|
||||
indent_style = tab
|
||||
|
||||
[*.{md,rst}]
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{sh,ac}]
|
||||
@@ -20,9 +20,3 @@ indent_size = 2
|
||||
|
||||
[Dockerfile]
|
||||
indent_size = 2
|
||||
|
||||
[share/{completions,functions}/**.fish]
|
||||
max_line_length = unset
|
||||
|
||||
[{COMMIT_EDITMSG,git-revise-todo}]
|
||||
max_line_length = 80
|
||||
|
||||
22
.gitattributes
vendored
22
.gitattributes
vendored
@@ -5,10 +5,8 @@
|
||||
|
||||
# let git show off diff hunk headers, help git diff -L:
|
||||
# https://git-scm.com/docs/gitattributes
|
||||
*.c diff=cpp
|
||||
*.h diff=cpp
|
||||
*.cpp diff=cpp
|
||||
*.py diff=py
|
||||
*.rs diff=rust
|
||||
# add a [diff "fish"] to git config with pattern
|
||||
*.fish diff=fish
|
||||
|
||||
@@ -20,15 +18,13 @@
|
||||
/debian/* export-ignore
|
||||
/.github export-ignore
|
||||
/.github/* export-ignore
|
||||
/.builds export-ignore
|
||||
/.builds/* export-ignore
|
||||
# to make cargo vendor work correctly
|
||||
/.cargo/ export-ignore
|
||||
/.cargo/config.toml export-ignore
|
||||
|
||||
# for linguist, which drives GitHub's language statistics
|
||||
alpine.js linguist-vendored
|
||||
doc_src/** linguist-documentation
|
||||
# for linguist; let github identify our project as C++ instead of C due to pcre2
|
||||
/pcre2-10.22/ linguist-vendored
|
||||
/pcre2-10.22/* linguist-vendored
|
||||
/muparser-2.2.5/ linguist-vendored
|
||||
/muparser-2.2.5/* linguist-vendored
|
||||
angular.js linguist-vendored
|
||||
/doc_src/* linguist-documentation
|
||||
*.fish linguist-language=fish
|
||||
# see 70f2899fcd which attempts to "rig the count"
|
||||
share/completions/*.fish linguist-documentation
|
||||
tests/*.in linguist-language=fish
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
---
|
||||
name: "Bug Report"
|
||||
about: "Simple template for bug reports"
|
||||
title: ""
|
||||
labels: []
|
||||
assignees: []
|
||||
---
|
||||
|
||||
<!--
|
||||
Please tell us which fish version you are using by executing the following:
|
||||
|
||||
fish --version
|
||||
echo $version
|
||||
|
||||
Please tell us which operating system (output of `uname`) and terminal you are using.
|
||||
Please tell us which operating system and terminal you are using. The output of `uname -a` and `echo $TERM` may be helpful in this regard although other commands might be relevant in your specific situation.
|
||||
|
||||
Please tell us if you tried fish without third-party customizations by executing this command and whether it affected the behavior you are reporting:
|
||||
|
||||
sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= XDG_DATA_DIRS= fish'
|
||||
sh -c 'env HOME=$(mktemp -d) fish'
|
||||
|
||||
Tell us how to reproduce the problem. Including an asciinema.org recording is useful for problems that involve the visual display of fish output such as its prompt.
|
||||
-->
|
||||
|
||||
**YOUR TEXT HERE**
|
||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -8,4 +8,4 @@ Fixes issue #
|
||||
<!-- Just check off what what we know been done so far. We can help you with this stuff. -->
|
||||
- [ ] Changes to fish usage are reflected in user documentation/manpages.
|
||||
- [ ] Tests have been added for regressions fixed
|
||||
- [ ] User-visible changes noted in CHANGELOG.rst <!-- Don't document changes for completions inside CHANGELOG.rst, there are lot of such edits -->
|
||||
- [ ] User-visible changes noted in CHANGELOG.md
|
||||
|
||||
66
.github/workflows/autolabel_prs.yml
vendored
66
.github/workflows/autolabel_prs.yml
vendored
@@ -1,66 +0,0 @@
|
||||
name: Auto-Label PRs
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
label-and-milestone:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v2
|
||||
|
||||
- name: Set label and milestone
|
||||
id: set-label-milestone
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const completionsLabel = 'completions';
|
||||
const completionsMilestone = 'fish next-3.x';
|
||||
|
||||
// Get changed files in the pull request
|
||||
const prNumber = context.payload.pull_request.number;
|
||||
const { data: files } = await github.rest.pulls.listFiles({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: prNumber,
|
||||
});
|
||||
|
||||
// Check if any file matches /share/completions/*.fish and no change is outside of /share/
|
||||
const completionsRegex = new RegExp('^share/completions/.*\.fish');
|
||||
const isCompletions = files.some(file => completionsRegex.test(file.filename))
|
||||
&& files.every(file => file.filename.startsWith('share/'));
|
||||
|
||||
if (isCompletions) {
|
||||
// Add label to PR
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
labels: [completionsLabel],
|
||||
});
|
||||
console.log(`PR ${prNumber} assigned label "${completionsLabel}"`);
|
||||
|
||||
// Get the list of milestones
|
||||
const { data: milestones } = await github.rest.issues.listMilestones({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
});
|
||||
|
||||
// Find the milestone id
|
||||
const milestone = milestones.find(milestone => milestone.title === completionsMilestone);
|
||||
|
||||
if (milestone) {
|
||||
// Set the milestone for the PR
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
milestone: milestone.number
|
||||
});
|
||||
console.log(`PR ${prNumber} assigned milestone "${completionsMilestone}"`);
|
||||
} else {
|
||||
console.error(`Milestone "${completionsMilestone}" not found`);
|
||||
}
|
||||
}
|
||||
25
.github/workflows/lockthreads.yml
vendored
25
.github/workflows/lockthreads.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: 'Lock threads'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 18 * * 1'
|
||||
# │ │ │ │ │
|
||||
# min 0-59 ┘ │ │ │ └ weekday 0-6
|
||||
# hour 0-23 ┘ │ └ month 1-12
|
||||
# └ day 1-31
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
permissions:
|
||||
issues: write # for dessant/lock-threads to lock issues
|
||||
pull-requests: write # for dessant/lock-threads to lock PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v4
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-inactive-days: '365'
|
||||
pr-inactive-days: '365'
|
||||
exclude-any-issue-labels: 'question, needs more info'
|
||||
42
.github/workflows/mac_codesign.yml
vendored
42
.github/workflows/mac_codesign.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: macOS build and codesign
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Enables manual trigger from GitHub UI
|
||||
|
||||
jobs:
|
||||
build-and-code-sign:
|
||||
runs-on: macos-latest
|
||||
environment: macos-codesign
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Rust 1.73.0
|
||||
uses: dtolnay/rust-toolchain@1.73.0
|
||||
with:
|
||||
targets: x86_64-apple-darwin
|
||||
- name: Install Rust Stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin
|
||||
- name: build-and-codesign
|
||||
run: |
|
||||
cargo install apple-codesign
|
||||
mkdir -p "$FISH_ARTEFACT_PATH"
|
||||
echo "$MAC_CODESIGN_APP_P12_BASE64" | base64 --decode > /tmp/app.p12
|
||||
echo "$MAC_CODESIGN_INSTALLER_P12_BASE64" | base64 --decode > /tmp/installer.p12
|
||||
echo "$MACOS_NOTARIZE_JSON" > /tmp/notarize.json
|
||||
./build_tools/make_pkg.sh -s -f /tmp/app.p12 -i /tmp/installer.p12 -p "$MAC_CODESIGN_PASSWORD" -n -j /tmp/notarize.json
|
||||
rm /tmp/installer.p12 /tmp/app.p12 /tmp/notarize.json
|
||||
env:
|
||||
MAC_CODESIGN_APP_P12_BASE64: ${{ secrets.MAC_CODESIGN_APP_P12_BASE64 }}
|
||||
MAC_CODESIGN_INSTALLER_P12_BASE64: ${{ secrets.MAC_CODESIGN_INSTALLER_P12_BASE64 }}
|
||||
MAC_CODESIGN_PASSWORD: ${{ secrets.MAC_CODESIGN_PASSWORD }}
|
||||
MACOS_NOTARIZE_JSON: ${{ secrets.MACOS_NOTARIZE_JSON }}
|
||||
# macOS runners keep having issues loading Cargo.toml dependencies from git (GitHub) instead
|
||||
# of crates.io, so give this a try. It's also sometimes significantly faster on all platforms.
|
||||
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
||||
FISH_ARTEFACT_PATH: /tmp/fish-built
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macOS Artefacts
|
||||
path: /tmp/fish-built/*
|
||||
if-no-files-found: error
|
||||
166
.github/workflows/main.yml
vendored
166
.github/workflows/main.yml
vendored
@@ -1,166 +0,0 @@
|
||||
name: make fish_run_tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
CTEST_PARALLEL_LEVEL: "4"
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
# Generate a locale that uses a comma as decimal separator.
|
||||
sudo locale-gen fr_FR.UTF-8
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
- name: make
|
||||
run: |
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
ubuntu-32bit-static-pcre2:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
with:
|
||||
targets: "i586-unknown-linux-gnu" # rust-toolchain wants this comma-separated
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install gettext python3-pexpect g++-multilib tmux
|
||||
- name: cmake
|
||||
env:
|
||||
CFLAGS: "-m32"
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -DFISH_USE_SYSTEM_PCRE2=OFF -DRust_CARGO_TARGET=i586-unknown-linux-gnu ..
|
||||
- name: make
|
||||
run: |
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
ubuntu-asan:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Rust has two different memory sanitizers of interest; they can't be used at the same time:
|
||||
# * AddressSanitizer detects out-of-bound access, use-after-free, use-after-return,
|
||||
# use-after-scope, double-free, invalid-free, and memory leaks.
|
||||
# * MemorySanitizer detects uninitialized reads.
|
||||
#
|
||||
RUSTFLAGS: "-Zsanitizer=address"
|
||||
# RUSTFLAGS: "-Zsanitizer=memory -Zsanitizer-memory-track-origins"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# All -Z options require running nightly
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
# ASAN uses `cargo build -Zbuild-std` which requires the rust-src component
|
||||
# this is comma-separated
|
||||
components: rust-src
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
- name: cmake
|
||||
env:
|
||||
CC: clang
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
# Rust's ASAN requires the build system to explicitly pass a --target triple. We read that
|
||||
# value from CMake variable Rust_CARGO_TARGET (shared with corrosion).
|
||||
cmake .. -DASAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu -DCMAKE_BUILD_TYPE=Debug
|
||||
- name: make
|
||||
run: |
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
env:
|
||||
FISH_CI_SAN: 1
|
||||
ASAN_OPTIONS: check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1:fast_unwind_on_malloc=0
|
||||
# use_tls=0 is a workaround for LSAN crashing with "Tracer caught signal 11" (SIGSEGV),
|
||||
# which seems to be an issue with TLS support in newer glibc versions under virtualized
|
||||
# environments. Follow https://github.com/google/sanitizers/issues/1342 and
|
||||
# https://github.com/google/sanitizers/issues/1409 to track this issue.
|
||||
# UPDATE: this can cause spurious leak reports for __cxa_thread_atexit_impl() under glibc.
|
||||
LSAN_OPTIONS: verbosity=0:log_threads=0:use_tls=1:print_suppressions=0
|
||||
run: |
|
||||
llvm_version=$(clang --version | awk 'NR==1 { split($NF, version, "."); print version[1] }')
|
||||
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$llvm_version
|
||||
export LSAN_OPTIONS="$LSAN_OPTIONS:suppressions=$PWD/build_tools/lsan_suppressions.txt"
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
# Our clang++ tsan builds are not recognizing safe rust patterns (such as the fact that Drop
|
||||
# cannot be called while a thread is using the object in question). Rust has its own way of
|
||||
# running TSAN, but for the duration of the port from C++ to Rust, we'll keep this disabled.
|
||||
|
||||
# ubuntu-threadsan:
|
||||
#
|
||||
# runs-on: ubuntu-latest
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - uses: dtolnay/rust-toolchain@1.70
|
||||
# - name: Install deps
|
||||
# run: |
|
||||
# sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
# - name: cmake
|
||||
# env:
|
||||
# FISH_CI_SAN: 1
|
||||
# CC: clang
|
||||
# run: |
|
||||
# mkdir build && cd build
|
||||
# cmake ..
|
||||
# - name: make
|
||||
# run: |
|
||||
# make
|
||||
# - name: make fish_run_tests
|
||||
# run: |
|
||||
# make -C build fish_run_tests
|
||||
|
||||
macos:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
env:
|
||||
# macOS runners keep having issues loading Cargo.toml dependencies from git (GitHub) instead
|
||||
# of crates.io, so give this a try. It's also sometimes significantly faster on all platforms.
|
||||
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- name: Install deps
|
||||
run: |
|
||||
# --break-system-packages because homebrew has now declared itself "externally managed".
|
||||
# this is CI so we don't actually care.
|
||||
sudo pip3 install --break-system-packages pexpect
|
||||
brew install tmux
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -DWITH_GETTEXT=NO -DCMAKE_BUILD_TYPE=Debug ..
|
||||
- name: make
|
||||
run: |
|
||||
make -C build VERBOSE=1
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
41
.github/workflows/rust_checks.yml
vendored
41
.github/workflows/rust_checks.yml
vendored
@@ -1,41 +0,0 @@
|
||||
name: Rust checks
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: cargo fmt
|
||||
run: cargo fmt --check --all
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev
|
||||
- name: cmake
|
||||
run: |
|
||||
cmake -B build
|
||||
- name: cargo clippy
|
||||
# This used to have --deny=warnings, but that turns rust release day
|
||||
# into automatic CI failure day, so we don't do that.
|
||||
run: cargo clippy --workspace --all-targets
|
||||
|
||||
# Disabling for now because it also checks "advisories",
|
||||
# making CI fail for reasons unrelated to the patch
|
||||
# cargo-deny:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: EmbarkStudios/cargo-deny-action@v1
|
||||
80
.github/workflows/staticbuild.yml
vendored
80
.github/workflows/staticbuild.yml
vendored
@@ -1,80 +0,0 @@
|
||||
name: staticbuilds
|
||||
|
||||
on:
|
||||
# release:
|
||||
# types: [published]
|
||||
# schedule:
|
||||
# - cron: "14 13 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CTEST_PARALLEL_LEVEL: "1"
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||
|
||||
jobs:
|
||||
staticbuilds-linux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Prepare
|
||||
run: |
|
||||
sudo apt install python3-sphinx
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
rustup target add aarch64-unknown-linux-musl
|
||||
sudo apt install musl-tools crossbuild-essential-arm64 python3-pexpect tmux -y
|
||||
- name: Build
|
||||
run: |
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" CMAKE_WITH_GETTEXT=0 CC=aarch64-linux-gnu-gcc RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc -C link-arg=-lgcc -C link-arg=-D_FORTIFY_SOURCE=0" cargo build --release --target aarch64-unknown-linux-musl --bin fish
|
||||
cargo build --release --target x86_64-unknown-linux-musl
|
||||
- name: Test
|
||||
run: |
|
||||
test -e tests/test_driver.py && tests/test_driver.py -f /tmp target/x86_64-unknown-linux-musl/release/
|
||||
- name: Compress
|
||||
run: |
|
||||
tar -cazf fish-static-x86_64-$(git describe).tar.xz -C target/x86_64-unknown-linux-musl/release/ fish
|
||||
tar -cazf fish-static-aarch64-$(git describe).tar.xz -C target/aarch64-unknown-linux-musl/release/ fish
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fish-static-linux
|
||||
path: |
|
||||
fish-*.tar.xz
|
||||
retention-days: 14
|
||||
staticbuilds-macos:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Prepare
|
||||
run: |
|
||||
sudo pip3 install --break-system-packages sphinx
|
||||
rustup target add x86_64-apple-darwin
|
||||
rustup target add aarch64-apple-darwin
|
||||
- name: Build
|
||||
run: |
|
||||
PCRE2_SYS_STATIC=1 cargo build --release --target aarch64-apple-darwin --bin fish
|
||||
PCRE2_SYS_STATIC=1 cargo build --release --target x86_64-apple-darwin --bin fish
|
||||
- name: Compress
|
||||
run: |
|
||||
tar -cazf fish-macos-aarch64.tar.xz -C target/aarch64-apple-darwin/release/ fish
|
||||
tar -cazf fish-macos-x86_64.tar.xz -C target/x86_64-apple-darwin/release/ fish
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fish-static-macos
|
||||
path: |
|
||||
fish-macos-*.tar.xz
|
||||
retention-days: 14
|
||||
31
.gitignore
vendored
31
.gitignore
vendored
@@ -38,6 +38,16 @@ Desktop.ini
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
|
||||
# These file names can appear anywhere in the hierarchy. They tend to be OS
|
||||
# or build system artifacts.
|
||||
autom4te.cache
|
||||
aclocal.m4
|
||||
Makefile
|
||||
config.h
|
||||
config.cache
|
||||
config.h.in
|
||||
config.status
|
||||
messages.pot
|
||||
.directory
|
||||
.fuse_hidden*
|
||||
@@ -45,6 +55,7 @@ messages.pot
|
||||
|
||||
# Directories that only contain transitory files from building and testing.
|
||||
/doc/
|
||||
/obj/
|
||||
/share/man/
|
||||
/share/doc/
|
||||
/test/
|
||||
@@ -56,6 +67,8 @@ messages.pot
|
||||
/command_list.txt
|
||||
/command_list_toc.txt
|
||||
/compile_commands.json
|
||||
/confdefs.h
|
||||
/configure
|
||||
/doc.h
|
||||
/fish
|
||||
/fish.pc
|
||||
@@ -67,12 +80,12 @@ messages.pot
|
||||
/toc.txt
|
||||
/version
|
||||
fish-build-version-witness.txt
|
||||
__pycache__
|
||||
|
||||
# File names that can appear below the project root that represent artifacts
|
||||
# from building and testing.
|
||||
/doc_src/commands.hdr
|
||||
/doc_src/index.hdr
|
||||
/pcre2-*/configure.lineno
|
||||
/po/*.gmo
|
||||
/share/__fish_build_paths.fish
|
||||
/share/pkgconfig
|
||||
@@ -89,19 +102,3 @@ __pycache__
|
||||
/tags
|
||||
xcuserdata/
|
||||
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
debug/
|
||||
target/
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||
*.pdb
|
||||
|
||||
# Generated by clangd
|
||||
/.cache
|
||||
|
||||
# JetBrains editors.
|
||||
.idea/
|
||||
|
||||
95
.oclint
Normal file
95
.oclint
Normal file
@@ -0,0 +1,95 @@
|
||||
rules:
|
||||
rule-configurations:
|
||||
#
|
||||
# This is the default value (as of the time I wrote this) but I'm making
|
||||
# it explicit since it needs to agree with the value used by clang-format.
|
||||
# Thus, if we ever change the fish style to allow longer or shorter lines
|
||||
# this should be changed (as well as the corresponding .clang-format file).
|
||||
#
|
||||
- key: LONG_LINE
|
||||
value: 100
|
||||
#
|
||||
# The default limit for the length of variable names is 20. Long names are
|
||||
# problematic but twenty chars results in way too many errors. So increase
|
||||
# the limit to something more reasonable.
|
||||
#
|
||||
- key: LONG_VARIABLE_NAME
|
||||
value: 30
|
||||
#
|
||||
# This allows us to avoid peppering our code with inline comments such as
|
||||
#
|
||||
# scoped_lock locker(m_lock); //!OCLINT(side-effect)
|
||||
#
|
||||
# Specifically, this config key tells oclint that the named classes have
|
||||
# RAII behavior so the local vars are actually used.
|
||||
#
|
||||
- key: RAII_CUSTOM_CLASSES
|
||||
value: scoped_lock scoped_buffer_t builtin_commandline_scoped_transient_t scoped_push
|
||||
|
||||
# We're slightly more persmissive regarding the total number of lines in a
|
||||
# function. Default is 50.
|
||||
- key: LONG_METHOD
|
||||
value: 60
|
||||
|
||||
# We're slightly more persmissive regarding the number of non-comment
|
||||
# lines in a function. Default is 30.
|
||||
- key: NCSS_METHOD
|
||||
value: 40
|
||||
|
||||
# We're willing to allow slighly more linearly independent paths through a
|
||||
# function. Most of our code has a lot of `switch` blocks or consecutive
|
||||
# `if` tests that are straightforward to interpret but which increase this
|
||||
# metric. Default is 10.
|
||||
- key: CYCLOMATIC_COMPLEXITY
|
||||
value: 14
|
||||
|
||||
# We're willing to allow slighly more execution paths through a function.
|
||||
# Default is 200.
|
||||
- key: NPATH_COMPLEXITY
|
||||
value: 300
|
||||
|
||||
disable-rules:
|
||||
#
|
||||
# A few instances of "useless parentheses" errors are meaningful. Mostly
|
||||
# in the context of the `return` statement. Unfortunately the vast
|
||||
# majority would result in removing parentheses that decreases
|
||||
# readability. So we're going to ignore this warning and rely on humans to
|
||||
# notice when the parentheses are truly not needed.
|
||||
#
|
||||
# Also, some macro expansions, such as FD_SET(), trigger this warning and
|
||||
# we don't want to suppress each of those individually.
|
||||
#
|
||||
- UselessParentheses
|
||||
#
|
||||
# OCLint wants variable names to be at least three characters in length.
|
||||
# Which would be fine if it supported a reasonable set of exceptions
|
||||
# (e.g., "i", "j", "k") and allowed adding additional exceptions to match
|
||||
# conventions employed by a project. Since it doesn't, and thus generates
|
||||
# a lot of really annoying warnings, we're going to disable this rule.
|
||||
#
|
||||
- ShortVariableName
|
||||
#
|
||||
# This rule flags perfectly reasonable conditions like `if (!some_condition)`
|
||||
# and is therefore just noise. Disable this rule.
|
||||
#
|
||||
- InvertedLogic
|
||||
#
|
||||
# The idea behind the "double negative" rule is sound since constructs
|
||||
# like "!!(var & flag)" should be written as "static_cast<bool>(var &
|
||||
# flag)". Unfortunately this rule has way too many false positives;
|
||||
# especially in the context of assert statements. So disable this rule.
|
||||
#
|
||||
- DoubleNegative
|
||||
#
|
||||
# Avoiding bitwise operators in a conditional is a good idea with one
|
||||
# exception: testing whether a bit flag is set. Which happens to be the
|
||||
# only time you'll see something like `if (j->flags & JOB_CONSTRUCTED)`
|
||||
# in fish source.
|
||||
#
|
||||
- BitwiseOperatorInConditional
|
||||
#
|
||||
# I don't think I've ever seen a case where assigning a value to a
|
||||
# parameter inside the function body was unclear, let along dangerous or
|
||||
# an error. This rule is therefore just noise. Disable this rule.
|
||||
#
|
||||
- ParameterReassignment
|
||||
94
.travis.yml
Normal file
94
.travis.yml
Normal file
@@ -0,0 +1,94 @@
|
||||
language: cpp
|
||||
dist: trusty
|
||||
sudo: required
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- bc
|
||||
- expect
|
||||
- gettext
|
||||
- libncurses5-dev
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- bc
|
||||
- expect
|
||||
- gettext
|
||||
- lib32ncurses5-dev
|
||||
- g++-multilib
|
||||
env:
|
||||
- CXXFLAGS="-g -O2 -m32" CFLAGS="-g -m32"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- bc
|
||||
- expect
|
||||
- gettext
|
||||
- libncurses5-dev
|
||||
- cmake
|
||||
env:
|
||||
- USE_CMAKE="1" # Dummy value, shows up in the Travis UI only
|
||||
script:
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=$HOME/prefix . || cat CMakeFiles/CMakeError.log &&
|
||||
make -j2 &&
|
||||
make install &&
|
||||
make test SHOW_INTERACTIVE_LOG=1
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env:
|
||||
- CXXFLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=address" ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1
|
||||
before_install: export CXX=clang++-3.8
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-precise-3.8
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- clang-3.8
|
||||
- llvm-3.8 # for llvm-symbolizer
|
||||
- bc
|
||||
- expect
|
||||
- gettext
|
||||
- libncurses5-dev
|
||||
- os: osx
|
||||
before_install:
|
||||
- brew update
|
||||
- brew install pcre2 # use system PCRE2
|
||||
- brew outdated xctool || brew upgrade xctool # for xcode... soon.
|
||||
env:
|
||||
- CXXFLAGS="-g -O2 -lstdc++"
|
||||
fast_finish: true
|
||||
|
||||
script:
|
||||
- autoreconf --no-recursive
|
||||
- ./configure --prefix=$HOME/prefix || cat config.log
|
||||
- make -j2 &&
|
||||
make test DESTDIR=$HOME/prefix/ SHOW_INTERACTIVE_LOG=1 &&
|
||||
make uninstall &&
|
||||
echo "Checking for leftover files after make uninstall" &&
|
||||
find $HOME/prefix/ -type f -print -exec false '{}' +
|
||||
|
||||
notifications:
|
||||
# Some items are encrypted so that notifications from other repositories
|
||||
# don't flood the official repositories.
|
||||
irc:
|
||||
channels:
|
||||
#- "irc.oftc.net#fish"
|
||||
secure: "eRk9KGZ5+mrlD2SoI8yg2Sp8OYrh7YPyGe3WCDQUwTnNgNDII34rbM9a6UOA/l7AeWSNY8joLq5xVLCU4wpFgUcJ11SYIpMnLosZK29OW4ubDOHmdBDvJ971rLgAVG9cXngZtIxEVVxN/jnS1Qr8GKZx4DjkaTMgz1pemb4WxCc="
|
||||
template:
|
||||
- "%{repository}#%{build_number} (%{commit} on %{branch} by %{author}): %{message} Details at %{build_url}"
|
||||
use_notice: true
|
||||
skip_join: true
|
||||
webhooks:
|
||||
urls:
|
||||
#- https://webhooks.gitter.im/e/61821cec3015bf0f8bb1
|
||||
secure: fPfOmxnC3MCsfR1oocVFeWLawGcRZkn+8fNHlSOeZ+SqqoZfcCHgQTvQ22TqmVl1yvkXbNlaXjo6dbVzTOAh7r7H0bRMEKBVh3dQS7wqjB1sKivpXd8PAS3BTj5MQpGeJzdHnDuwVlwDktGtfHfhGeq1Go/4IosOq8u+6RTe28g=
|
||||
57
BSDmakefile
57
BSDmakefile
@@ -1,46 +1,35 @@
|
||||
# This is a very basic `make` wrapper around the CMake build toolchain.
|
||||
#
|
||||
# Supported arguments:
|
||||
# PREFIX: sets the installation prefix
|
||||
# GENERATOR: explicitly specifies the CMake generator to use
|
||||
|
||||
# By default, bmake will try to cd into ./obj before anything else. Don't do that.
|
||||
# by default bmake will cd into ./obj first
|
||||
.OBJDIR: ./
|
||||
|
||||
CMAKE?=cmake
|
||||
|
||||
# Before anything else, test for CMake, which is the only requirement to be able to run
|
||||
# this Makefile CMake will perform the remaining dependency tests on its own.
|
||||
.BEGIN:
|
||||
@which $(CMAKE) >/dev/null 2>/dev/null || \
|
||||
(echo 'Please install CMake and then re-run the `make` command!' 1>&2 && false)
|
||||
# test for cmake, which is the only requirement to be able to run this Makefile
|
||||
# cmake will perform the remaining dependency tests on its own
|
||||
@which cmake >/dev/null 2>/dev/null || (echo 'Please install cmake and then re-run the `make` command!' 1>&2 && false)
|
||||
|
||||
# Prefer to use ninja, if it is installed
|
||||
_GENERATOR!=which ninja 2>/dev/null >/dev/null && echo Ninja || echo "Unix Makefiles"
|
||||
# Use ninja, if it is installed
|
||||
_GENERATOR!=which ninja 2>/dev/null >/dev/null && echo Ninja || echo "'Unix Makefiles'"
|
||||
GENERATOR?=$(_GENERATOR)
|
||||
|
||||
.if $(GENERATOR) == "Ninja"
|
||||
BUILDFILE=build.ninja
|
||||
.else
|
||||
BUILDFILE=Makefile
|
||||
.endif
|
||||
|
||||
PREFIX?=/usr/local
|
||||
|
||||
.PHONY: build/fish
|
||||
build/fish: build/$(BUILDFILE)
|
||||
$(CMAKE) --build build
|
||||
.if $(GENERATOR) == "Ninja"
|
||||
BUILDFILE=build/build.ninja
|
||||
.else
|
||||
BUILDFILE=build/Makefile
|
||||
.endif
|
||||
|
||||
# Don't split the mkdir into its own rule because that would cause CMake to regenerate the build
|
||||
# files after each build (because it adds the mdate of the build directory into the out-of-date
|
||||
# calculation tree). GNUmake supports order-only dependencies, BSDmake does not seem to.
|
||||
build/$(BUILDFILE):
|
||||
.DEFAULT: build/fish
|
||||
build/fish: build/$(BUILDFILE)
|
||||
cmake --build build
|
||||
|
||||
build:
|
||||
mkdir -p build
|
||||
cd build; $(CMAKE) .. -G "$(GENERATOR)" -DCMAKE_INSTALL_PREFIX="$(PREFIX)" -DCMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
|
||||
build/$(BUILDFILE): build
|
||||
cd build; cmake .. -G $(GENERATOR) -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DCMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
|
||||
.PHONY: install
|
||||
install: build/fish
|
||||
$(CMAKE) --build build --target install
|
||||
cmake --build build --target install
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@@ -48,11 +37,7 @@ clean:
|
||||
|
||||
.PHONY: test
|
||||
test: build/fish
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: fish_run_tests
|
||||
fish_run_tests: build/fish
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
cmake --build build --target test
|
||||
|
||||
.PHONY: run
|
||||
run: build/fish
|
||||
|
||||
966
CHANGELOG.md
Normal file
966
CHANGELOG.md
Normal file
@@ -0,0 +1,966 @@
|
||||
# fish 3.0.3 (released ???)
|
||||
|
||||
This release of fish fixes a number of major issues since fish 3.0.2.
|
||||
|
||||
If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0.2, 3.0.1, 3.0.0 and 3.0b1 (included below).
|
||||
|
||||
---
|
||||
|
||||
# fish 3.0.2 (released February 19, 2019)
|
||||
|
||||
This release of fish fixes an issue discovered in fish 3.0.1.
|
||||
|
||||
### Fixes and improvements
|
||||
|
||||
- The PWD environment variable is now ignored if it does not resolve to the true working directory, fixing strange behaviour in terminals started by editors and IDEs (#5647).
|
||||
|
||||
If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0.1, 3.0.0 and 3.0b1 (included below).
|
||||
|
||||
---
|
||||
|
||||
# fish 3.0.1 (released February 11, 2019)
|
||||
|
||||
This release of fish fixes a number of major issues discovered in fish 3.0.0.
|
||||
|
||||
### Fixes and improvements
|
||||
|
||||
- `exec` does not complain about running foreground jobs when called (#5449).
|
||||
- while loops now evaluate to the last executed command in the loop body (or zero if the body was empty), matching POSIX semantics (#4982).
|
||||
- `read --silent` no longer echoes to the tty when run from a non-interactive script (#5519).
|
||||
- On macOS, path entries with spaces in `/etc/paths` and `/etc/paths.d` now correctly set path entries with spaces. Likewise, `MANPATH` is correctly set from `/etc/manpaths` and `/etc/manpaths.d` (#5481).
|
||||
- fish starts correctly under Cygwin/MSYS2 (#5426).
|
||||
- The `pager-toggle-search` binding (Ctrl-S by default) will now activate the search field, even when the pager is not focused.
|
||||
- The error when a command is not found is now printed a single time, instead of once per argument (#5588).
|
||||
- Fixes and improvements to the git completions, including printing correct paths with older git versions, fuzzy matching again, reducing unnecessary offers of root paths (starting with `:/`) (#5578, #5574, #5476), and ignoring shell aliases, so enterprising users can set up the wrapping command (via `set -g __fish_git_alias_$command $whatitwraps`) (#5412).
|
||||
- Significant performance improvements to core shell functions (#5447) and to the `kill` completions (#5541).
|
||||
- Starting in symbolically-linked working directories works correctly (#5525).
|
||||
- The default `fish_title` function no longer contains extra spaces (#5517).
|
||||
- The `nim` prompt now works correctly when chosen in the Web-based configuration (#5490).
|
||||
- `string` now prints help to stdout, like other builtins (#5495).
|
||||
- Killing the terminal while fish is in vi normal mode will no longer send it spinning and eating CPU. (#5528)
|
||||
- A number of crashes have been fixed (#5550, #5548, #5479, #5453).
|
||||
- Improvements to the documentation and certain completions.
|
||||
|
||||
### Known issues
|
||||
|
||||
There is one significant known issue that was not corrected before the release:
|
||||
|
||||
- fish does not run correctly under Windows Services for Linux before Windows 10 version 1809/17763, and the message warning of this may not be displayed (#5619).
|
||||
|
||||
If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0.0 and 3.0b1 (included below).
|
||||
|
||||
---
|
||||
|
||||
# fish 3.0.0 (released December 28, 2018)
|
||||
|
||||
fish 3 is a major release, which introduces some breaking changes alongside improved functionality. Although most existing scripts will continue to work, they should be reviewed against the list contained in the 3.0b1 release notes below.
|
||||
|
||||
Compared to the beta release of fish 3.0b1, fish version 3.0.0:
|
||||
|
||||
- builds correctly against musl libc (#5407)
|
||||
- handles huge numeric arguments to `test` correctly (#5414)
|
||||
- removes the history colouring introduced in 3.0b1, which did not always work correctly
|
||||
|
||||
There is one significant known issue which was not able to be corrected before the release:
|
||||
|
||||
- fish 3.0.0 builds on Cygwin (#5423), but does not run correctly (#5426) and will result in a hanging terminal when started. Cygwin users are encouraged to continue using 2.7.1 until a release which corrects this is available.
|
||||
|
||||
If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0b1 (included below).
|
||||
|
||||
---
|
||||
|
||||
# fish 3.0b1 (released December 11, 2018)
|
||||
|
||||
fish 3 is a major release, which introduces some breaking changes alongside improved functionality. Although most existing scripts will continue to work, they should be reviewed against the list below.
|
||||
|
||||
## Notable non-backward compatible changes
|
||||
- Process and job expansion has largely been removed. `%` will no longer perform these expansions, except for `%self` for the PID of the current shell. Additionally, job management commands (`disown`, `wait`, `bg`, `fg` and `kill`) will expand job specifiers starting with `%` (#4230, #1202).
|
||||
- `set x[1] x[2] a b`, to set multiple elements of an array at once, is no longer valid syntax (#4236).
|
||||
- A literal `{}` now expands to itself, rather than nothing. This makes working with `find -exec` easier (#1109, #4632).
|
||||
- Literally accessing a zero-index is now illegal syntax and is caught by the parser (#4862). (fish indices start at 1)
|
||||
- Successive commas in brace expansions are handled in less surprising manner. For example, `{,,,}` expands to four empty strings rather than an empty string, a comma and an empty string again (#3002, #4632).
|
||||
- `for` loop control variables are no longer local to the `for` block (#1935).
|
||||
- Variables set in `if` and `while` conditions are available outside the block (#4820).
|
||||
- Local exported (`set -lx`) vars are now visible to functions (#1091).
|
||||
- The new `math` builtin (see below) does not support logical expressions; `test` should be used instead (#4777).
|
||||
- Range expansion will now behave sensibly when given a single positive and negative index (`$foo[5..-1]` or `$foo[-1..5]`), clamping to the last valid index without changing direction if the list has fewer elements than expected.
|
||||
- `read` now uses `-s` as short for `--silent` (à la `bash`); `--shell`'s abbreviation (formerly `-s`) is now `-S` instead (#4490).
|
||||
- `cd` no longer resolves symlinks. fish now maintains a virtual path, matching other shells (#3350).
|
||||
- `source` now requires an explicit `-` as the filename to read from the terminal (#2633).
|
||||
- Arguments to `end` are now errors, instead of being silently ignored.
|
||||
- The names `argparse`, `read`, `set`, `status`, `test` and `[` are now reserved and not allowed as function names. This prevents users unintentionally breaking stuff (#3000).
|
||||
- The `fish_user_abbreviations` variable is no longer used; abbreviations will be migrated to the new storage format automatically.
|
||||
- The `FISH_READ_BYTE_LIMIT` variable is now called `fish_byte_limit` (#4414).
|
||||
- Environment variables are no longer split into arrays based on the record separator character on startup. Instead, variables are not split, unless their name ends in PATH, in which case they are split on colons (#436).
|
||||
- The `history` builtin's `--with-time` option has been removed; this has been deprecated in favor of `--show-time` since 2.7.0 (#4403).
|
||||
- The internal variables `__fish_datadir` and `__fish_sysconfdir` are now known as `__fish_data_dir` and `__fish_sysconf_dir` respectively.
|
||||
|
||||
## Deprecations
|
||||
|
||||
With the release of fish 3, a number of features have been marked for removal in the future. All users are encouraged to explore alternatives. A small number of these features are currently behind feature flags, which are turned on at present but may be turned off by default in the future.
|
||||
|
||||
A new feature flags mechanism is added for staging deprecations and breaking changes. Feature flags may be specified at launch with `fish --features ...` or by setting the universal `fish_features` variable. (#4940)
|
||||
|
||||
- The use of the `IFS` variable for `read` is deprecated; `IFS` will be ignored in the future (#4156). Use the `read --delimiter` option instead.
|
||||
- The `function --on-process-exit` switch will be removed in future (#4700). Use the `fish_exit` event instead: `function --on-event fish_exit`.
|
||||
- `$_` is deprecated and will removed in the future (#813). Use `status current-command` in a command substitution instead.
|
||||
- `^` as a redirection deprecated and will be removed in the future. (#4394). Use `2>` to redirect stderr. This is controlled by the `stderr-nocaret` feature flag.
|
||||
- `?` as a glob (wildcard) is deprecated and will be removed in the future (#4520). This is controlled by the `qmark-noglob` feature flag.
|
||||
|
||||
## Notable fixes and improvements
|
||||
### Syntax changes and new commands
|
||||
- fish now supports `&&` (like `and`), `||` (like `or`), and `!` (like `not`), for better migration from POSIX-compliant shells (#4620).
|
||||
- Variables may be used as commands (#154).
|
||||
- fish may be started in private mode via `fish --private`. Private mode fish sessions do not have access to the history file and any commands evaluated in private mode are not persisted for future sessions. A session variable `$fish_private_mode` can be queried to detect private mode and adjust the behavior of scripts accordingly to respect the user's wish for privacy.
|
||||
- A new `wait` command for waiting on backgrounded processes (#4498).
|
||||
- `math` is now a builtin rather than a wrapper around `bc` (#3157). Floating point computations is now used by default, and can be controlled with the new `--scale` option (#4478).
|
||||
- Setting `$PATH` no longer warns on non-existent directories, allowing for a single $PATH to be shared across machines (eg via dotfiles) (#2969).
|
||||
- `while` sets `$status` to a non-zero value if the loop is not executed (#4982).
|
||||
- Command substitution output is now limited to 10 MB by default, controlled by the `fish_read_limit` variable (#3822). Notably, this is larger than most operating systems' argument size limit, so trying to pass argument lists this size to external commands has never worked.
|
||||
- The machine hostname, where available, is now exposed as the `$hostname` reserved variable. This removes the dependency on the `hostname` executable (#4422).
|
||||
- Bare `bind` invocations in config.fish now work. The `fish_user_key_bindings` function is no longer necessary, but will still be executed if it exists (#5191).
|
||||
- `$fish_pid` and `$last_pid` are available as replacements for `%self` and `%last`.
|
||||
|
||||
### New features in commands
|
||||
- `alias` has a new `--save` option to save the generated function immediately (#4878).
|
||||
- `bind` has a new `--silent` option to ignore bind requests for named keys not available under the current terminal (#4188, #4431).
|
||||
- `complete` has a new `--keep-order` option to show the provided or dynamically-generated argument list in the same order as specified, rather than alphabetically (#361).
|
||||
- `exec` prompts for confirmation if background jobs are running.
|
||||
- `funced` has a new `--save` option to automatically save the edited function after successfully editing (#4668).
|
||||
- `functions` has a new ` --handlers` option to show functions registered as event handlers (#4694).
|
||||
- `history search` supports globs for wildcard searching (#3136) and has a new `--reverse` option to show entries from oldest to newest (#4375).
|
||||
- `jobs` has a new `--quiet` option to silence the output.
|
||||
- `read` has a new `--delimiter` option for splitting input into arrays (#4256).
|
||||
- `read` writes directly to stdout if called without arguments (#4407).
|
||||
- `read` can now read individual lines into separate variables without consuming the input in its entirety via the new `/--line` option.
|
||||
- `set` has new `--append` and `--prepend` options (#1326).
|
||||
- `set` has a new `--show` option to show lots of information about variables (#4265).
|
||||
- `string match` with an empty pattern and `--entire` in glob mode now matches everything instead of nothing (#4971).
|
||||
- `string split` supports a new `--no-empty` option to exclude empty strings from the result (#4779).
|
||||
- `string` has new subcommands `split0` and `join0` for working with NUL-delimited output.
|
||||
- `string` no longer stops processing text after NUL characters (#4605)
|
||||
- `string escape` has a new `--style regex` option for escaping strings to be matched literally in `string` regex operations.
|
||||
- `test` now supports floating point values in numeric comparisons.
|
||||
|
||||
### Interactive improvements
|
||||
- A pipe at the end of a line now allows the job to continue on the next line (#1285).
|
||||
- Italics and dim support out of the box on macOS for Terminal.app and iTerm (#4436).
|
||||
- `cd` tab completions no longer descend into the deepest unambiguous path (#4649).
|
||||
- Pager navigation has been improved. Most notably, moving down now wraps around, moving up from the commandline now jumps to the last element and moving right and left now reverse each other even when wrapping around (#4680).
|
||||
- Typing normal characters while the completion pager is active no longer shows the search field. Instead it enters them into the command line, and ends paging (#2249).
|
||||
- A new input binding `pager-toggle-search` toggles the search field in the completions pager on and off. By default, this is bound to Ctrl-S.
|
||||
- Searching in the pager now does a full fuzzy search (#5213).
|
||||
- The pager will now show the full command instead of just its last line if the number of completions is large (#4702).
|
||||
- Abbreviations can be tab-completed (#3233).
|
||||
- Tildes in file names are now properly escaped in completions (#2274).
|
||||
- Wrapping completions (from `complete --wraps` or `function --wraps`) can now inject arguments. For example, `complete gco --wraps 'git checkout'` now works properly (#1976). The `alias` function has been updated to respect this behavior.
|
||||
- Path completions now support expansions, meaning expressions like `python ~/<TAB>` now provides file suggestions just like any other relative or absolute path. (This includes support for other expansions, too.)
|
||||
- Autosuggestions try to avoid arguments that are already present in the command line.
|
||||
- Notifications about crashed processes are now always shown, even in command substitutions (#4962).
|
||||
- The screen is no longer reset after a BEL, fixing graphical glitches (#3693).
|
||||
- vi-mode now supports ';' and ',' motions. This introduces new {forward,backward}-jump-till and repeat-jump{,-reverse} bind functions (#5140).
|
||||
- The `*y` vi-mode binding now works (#5100).
|
||||
- True color is now enabled in neovim by default (#2792).
|
||||
- Terminal size variables (`$COLUMNS`/`$LINES`) are now updated before `fish_prompt` is called, allowing the prompt to react (#904).
|
||||
- Multi-line prompts no longer repeat when the terminal is resized (#2320).
|
||||
- `xclip` support has been added to the clipboard integration (#5020).
|
||||
- The Alt-P keybinding paginates the last command if the command line is empty.
|
||||
- `$cmd_duration` is no longer reset when no command is executed (#5011).
|
||||
- Deleting a one-character word no longer erases the next word as well (#4747).
|
||||
- Token history search (Alt-Up) omits duplicate entries (#4795).
|
||||
- The `fish_escape_delay_ms` timeout, allowing the use of the escape key both on its own and as part of a control sequence, was applied to all control characters; this has been reduced to just the escape key.
|
||||
- Completing a function shows the description properly (#5206).
|
||||
- Added completions for
|
||||
- `ansible`, including `ansible-galaxy`, `ansible-playbook` and `ansible-vault` (#4697)
|
||||
- `bb-power` (#4800)
|
||||
- `bd` (#4472)
|
||||
- `bower`
|
||||
- `clang` and `clang++` (#4174)
|
||||
- `conda` (#4837)
|
||||
- `configure` (for autoconf-generated files only)
|
||||
- `curl`
|
||||
- `doas` (#5196)
|
||||
- `ebuild` (#4911)
|
||||
- `emaint` (#4758)
|
||||
- `eopkg` (#4600)
|
||||
- `exercism` (#4495)
|
||||
- `hjson`
|
||||
- `hugo` (#4529)
|
||||
- `j` (from autojump #4344)
|
||||
- `jbake` (#4814)
|
||||
- `jhipster` (#4472)
|
||||
- `kitty`
|
||||
- `kldload`
|
||||
- `kldunload`
|
||||
- `makensis` (#5242)
|
||||
- `meson`
|
||||
- `mkdocs` (#4906)
|
||||
- `ngrok` (#4642)
|
||||
- OpenBSD's `pkg_add`, `pkg_delete`, `pkg_info`, `pfctl`, `rcctl`, `signify`, and `vmctl` (#4584)
|
||||
- `openocd`
|
||||
- `optipng`
|
||||
- `opkg` (#5168)
|
||||
- `pandoc` (#2937)
|
||||
- `port` (#4737)
|
||||
- `powerpill` (#4800)
|
||||
- `pstack` (#5135)
|
||||
- `serve` (#5026)
|
||||
- `ttx`
|
||||
- `unzip`
|
||||
- `virsh` (#5113)
|
||||
- `xclip` (#5126)
|
||||
- `xsv`
|
||||
- `zfs` and `zpool` (#4608)
|
||||
- Lots of improvements to completions (especially `darcs` (#5112), `git`, `hg` and `sudo`).
|
||||
- Completions for `yarn` and `npm` now require the `all-the-package-names` NPM package for full functionality.
|
||||
- Completions for `bower` and `yarn` now require the `jq` utility for full functionality.
|
||||
- Improved French translations.
|
||||
|
||||
### Other fixes and improvements
|
||||
- Significant performance improvements to `abbr` (#4048), setting variables (#4200, #4341), executing functions, globs (#4579), `string` reading from standard input (#4610), and slicing history (in particular, `$history[1]` for the last executed command).
|
||||
- Fish's internal wcwidth function has been updated to deal with newer Unicode, and the width of some characters can be configured via the `fish_ambiguous_width` (#5149) and `fish_emoji_width` (#2652) variables. Alternatively, a new build-time option INTERNAL_WCWIDTH can be used to use the system's wcwidth instead (#4816).
|
||||
- `functions` correctly supports `-d` as the short form of `--description`. (#5105)
|
||||
- `/etc/paths` is now parsed like macOS' bash `path_helper`, fixing $PATH order (#4336, #4852) on macOS.
|
||||
- Using a read-only variable in a `for` loop produces an error, rather than silently producing incorrect results (#4342).
|
||||
- The universal variables filename no longer contains the hostname or MAC address. It is now at the fixed location `.config/fish/fish_variables` (#1912).
|
||||
- Exported variables in the global or universal scope no longer have their exported status affected by local variables (#2611).
|
||||
- Major rework of terminal and job handling to eliminate bugs (#3805, #3952, #4178, #4235, #4238, #4540, #4929, #5210).
|
||||
- Improvements to the manual page completion generator (#2937, #4313).
|
||||
- `suspend --force` now works correctly (#4672).
|
||||
- Pressing Ctrl-C while running a script now reliably terminates fish (#5253).
|
||||
|
||||
### For distributors and developers
|
||||
- fish ships with a new build system based on CMake. CMake 3.2 is the minimum required version. Although the autotools-based Makefile and the Xcode project are still shipped with this release, they will be removed in the near future. All distributors and developers are encouraged to migrate to the CMake build.
|
||||
- Build scripts for most platforms no longer require bash, using the standard sh instead.
|
||||
- The `hostname` command is no longer required for fish to operate.
|
||||
|
||||
--
|
||||
|
||||
# fish 2.7.1 (released December 23, 2017)
|
||||
|
||||
This release of fish fixes an issue where iTerm 2 on macOS would display a warning about paste bracketing being left on when starting a new fish session (#4521).
|
||||
|
||||
If you are upgrading from version 2.6.0 or before, please also review the release notes for 2.7.0 and 2.7b1 (included below).
|
||||
|
||||
--
|
||||
|
||||
# fish 2.7.0 (released November 23, 2017)
|
||||
|
||||
There are no major changes between 2.7b1 and 2.7.0. If you are upgrading from version 2.6.0 or before, please also review the release notes for 2.7b1 (included below).
|
||||
|
||||
Xcode builds and macOS packages could not be produced with 2.7b1, but this is fixed in 2.7.0.
|
||||
|
||||
--
|
||||
|
||||
# fish 2.7b1 (released October 31, 2017)
|
||||
|
||||
## Notable improvements
|
||||
- A new `cdh` (change directory using recent history) command provides a more friendly alternative to prevd/nextd and pushd/popd (#2847).
|
||||
- A new `argparse` command is available to allow fish script to parse arguments with the same behavior as builtin commands. This also includes the `fish_opt` helper command. (#4190).
|
||||
- Invalid array indexes are now silently ignored (#826, #4127).
|
||||
- Improvements to the debugging facility, including a prompt specific to the debugger (`fish_breakpoint_prompt`) and a `status is-breakpoint` subcommand (#1310).
|
||||
- `string` supports new `lower` and `upper` subcommands, for altering the case of strings (#4080). The case changing is not locale-aware yet.- `string escape` has a new `--style=xxx` flag where `xxx` can be `script`, `var`, or `url` (#4150), and can be reversed with `string unescape` (#3543).
|
||||
- History can now be split into sessions with the `fish_history` variable, or not saved to disk at all (#102).
|
||||
- Read history is now controlled by the `fish_history` variable rather than the `--mode-name` flag (#1504).
|
||||
- `command` now supports an `--all` flag to report all directories with the command. `which` is no longer a runtime dependency (#2778).
|
||||
- fish can run commands before starting an interactive session using the new `--init-command`/`-C` options (#4164).
|
||||
- `set` has a new `--show` option to show lots of information about variables (#4265).
|
||||
|
||||
## Other significant changes
|
||||
- The `COLUMNS` and `LINES` environment variables are now correctly set the first time `fish_prompt` is run (#4141).
|
||||
- `complete`'s `--no-files` option works as intended (#112).
|
||||
- `echo -h` now correctly echoes `-h` in line with other shells (#4120).
|
||||
- The `export` compatibility function now returns zero on success, rather than always returning 1 (#4435).
|
||||
- Stop converting empty elements in MANPATH to "." (#4158). The behavior being changed was introduced in fish 2.6.0.
|
||||
- `count -h` and `count --help` now return 1 rather than produce command help output (#4189).
|
||||
- An attempt to `read` which stops because too much data is available still defines the variables given as parameters (#4180).
|
||||
- A regression in fish 2.4.0 which prevented `pushd +1` from working has been fixed (#4091).
|
||||
- A regression in fish 2.6.0 where multiple `read` commands in non-interactive scripts were broken has been fixed (#4206).
|
||||
- A regression in fish 2.6.0 involving universal variables with side-effects at startup such as `set -U fish_escape_delay_ms 10` has been fixed (#4196).
|
||||
- Added completions for:
|
||||
- `as` (#4130)
|
||||
- `cdh` (#2847)
|
||||
- `dhcpd` (#4115)
|
||||
- `ezjail-admin` (#4324)
|
||||
- Fabric's `fab` (#4153)
|
||||
- `grub-file` (#4119)
|
||||
- `grub-install` (#4119)
|
||||
- `jest` (#4142)
|
||||
- `kdeconnect-cli`
|
||||
- `magneto` (#4043, #4108)
|
||||
- `mdadm` (#4198)
|
||||
- `passwd` (#4209)
|
||||
- `pip` and `pipenv` (#4448)
|
||||
- `s3cmd` (#4332)
|
||||
- `sbt` (#4347)
|
||||
- `snap` (#4215)
|
||||
- Sublime Text 3's `subl` (#4277)
|
||||
- Lots of improvements to completions.
|
||||
- Updated Chinese and French translations.
|
||||
|
||||
- Improved completions for:
|
||||
- `apt`
|
||||
- `cd` (#4061)
|
||||
- `composer` (#4295)
|
||||
- `eopkg`
|
||||
- `flatpak` (#4456)
|
||||
- `git` (#4117, #4147, #4329, #4368)
|
||||
- `gphoto2`
|
||||
- `killall` (#4052)
|
||||
- `ln`
|
||||
- `npm` (#4241)
|
||||
- `ssh` (#4377)
|
||||
- `tail`
|
||||
- `xdg-mime` (#4333)
|
||||
- `zypper` (#4325)
|
||||
---
|
||||
|
||||
# fish 2.6.0 (released June 3, 2017)
|
||||
|
||||
Since the beta release of fish 2.6b1, fish version 2.6.0 contains a number of minor fixes, new completions for `magneto` (#4043), and improvements to the documentation.
|
||||
|
||||
## Known issues
|
||||
|
||||
- Apple macOS Sierra 10.12.5 introduced a problem with launching web browsers from other programs using AppleScript. This affects the fish Web configuration (`fish_config`); users on these platforms will need to manually open the address displayed in the terminal, such as by copying and pasting it into a browser. This problem will be fixed with macOS 10.12.6.
|
||||
|
||||
If you are upgrading from version 2.5.0 or before, please also review the release notes for 2.6b1 (included below).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.6b1 (released May 14, 2017)
|
||||
|
||||
## Notable fixes and improvements
|
||||
|
||||
- Jobs running in the background can now be removed from the list of jobs with the new `disown` builtin, which behaves like the same command in other shells (#2810).
|
||||
- Command substitutions now have access to the terminal, like in other shells. This allows tools like `fzf` to work properly (#1362, #3922).
|
||||
- In cases where the operating system does not report the size of the terminal, the `COLUMNS` and `LINES` environment variables are used; if they are unset, a default of 80x24 is assumed.
|
||||
- New French (#3772 & #3788) and improved German (#3834) translations.
|
||||
- fish no longer depends on the `which` external command.
|
||||
|
||||
## Other significant changes
|
||||
|
||||
- Performance improvements in launching processes, including major reductions in signal blocking. Although this has been heavily tested, it may cause problems in some circumstances; set the `FISH_NO_SIGNAL_BLOCK` variable to 0 in your fish configuration file to return to the old behaviour (#2007).
|
||||
- Performance improvements in prompts and functions that set lots of colours (#3793).
|
||||
- The Delete key no longer deletes backwards (a regression in 2.5.0).
|
||||
- `functions` supports a new `--details` option, which identifies where the function was loaded from (#3295), and a `--details --verbose` option which includes the function description (#597).
|
||||
- `read` will read up to 10 MiB by default, leaving the target variable empty and exiting with status 122 if the line is too long. You can set a different limit with the `FISH_READ_BYTE_LIMIT` variable.
|
||||
- `read` supports a new `--silent` option to hide the characters typed (#838), for when reading sensitive data from the terminal. `read` also now accepts simple strings for the prompt (rather than scripts) with the new `-P` and `--prompt-str` options (#802).
|
||||
- `export` and `setenv` now understand colon-separated `PATH`, `CDPATH` and `MANPATH` variables.
|
||||
- `setenv` is no longer a simple alias for `set -gx` and will complain, just like the csh version, if given more than one value (#4103).
|
||||
- `bind` supports a new `--list-modes` option (#3872).
|
||||
- `bg` will check all of its arguments before backgrounding any jobs; any invalid arguments will cause a failure, but non-existent (eg recently exited) jobs are ignored (#3909).
|
||||
- `funced` warns if the function being edited has not been modified (#3961).
|
||||
- `printf` correctly outputs "long long" integers (#3352).
|
||||
- `status` supports a new `current-function` subcommand to print the current function name (#1743).
|
||||
- `string` supports a new `repeat` subcommand (#3864). `string match` supports a new `--entire` option to emit the entire line matched by a pattern (#3957). `string replace` supports a new `--filter` option to only emit lines which underwent a replacement (#3348).
|
||||
- `test` supports the `-k` option to test for sticky bits (#733).
|
||||
- `umask` understands symbolic modes (#738).
|
||||
- Empty components in the `CDPATH`, `MANPATH` and `PATH` variables are now converted to "." (#2106, #3914).
|
||||
- New versions of ncurses (6.0 and up) wipe terminal scrollback buffers with certain commands; the `C-l` binding tries to avoid this (#2855).
|
||||
- Some systems' `su` implementations do not set the `USER` environment variable; it is now reset for root users (#3916).
|
||||
- Under terminals which support it, bracketed paste is enabled, escaping problematic characters for security and convience (#3871). Inside single quotes (`'`), single quotes and backslashes in pasted text are escaped (#967). The `fish_clipboard_paste` function (bound to `C-v` by default) is still the recommended pasting method where possible as it includes this functionality and more.
|
||||
- Processes in pipelines are no longer signalled as soon as one command in the pipeline has completed (#1926). This behaviour matches other shells mre closely.
|
||||
- All functions requiring Python work with whichever version of Python is installed (#3970). Python 3 is preferred, but Python 2.6 remains the minimum version required.
|
||||
- The color of the cancellation character can be controlled by the `fish_color_cancel` variable (#3963).
|
||||
- Added completions for:
|
||||
- `caddy` (#4008)
|
||||
- `castnow` (#3744)
|
||||
- `climate` (#3760)
|
||||
- `flatpak`
|
||||
- `gradle` (#3859)
|
||||
- `gsettings` (#4001)
|
||||
- `helm` (#3829)
|
||||
- `i3-msg` (#3787)
|
||||
- `ipset` (#3924)
|
||||
- `jq` (#3804)
|
||||
- `light` (#3752)
|
||||
- `minikube` (#3778)
|
||||
- `mocha` (#3828)
|
||||
- `mkdosfs` (#4017)
|
||||
- `pv` (#3773)
|
||||
- `setsid` (#3791)
|
||||
- `terraform` (#3960)
|
||||
- `usermod` (#3775)
|
||||
- `xinput`
|
||||
- `yarn` (#3816)
|
||||
- Improved completions for `adb` (#3853), `apt` (#3771), `bzr` (#3769), `dconf`, `git` (including #3743), `grep` (#3789), `go` (#3789), `help` (#3789), `hg` (#3975), `htop` (#3789), `killall` (#3996), `lua`, `man` (#3762), `mount` (#3764 & #3841), `obnam` (#3924), `perl` (#3856), `portmaster` (#3950), `python` (#3840), `ssh` (#3781), `scp` (#3781), `systemctl` (#3757) and `udisks` (#3764).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.5.0 (released February 3, 2017)
|
||||
|
||||
There are no major changes between 2.5b1 and 2.5.0. If you are upgrading from version 2.4.0 or before, please also review the release notes for 2.5b1 (included below).
|
||||
|
||||
## Notable fixes and improvements
|
||||
|
||||
- The Home, End, Insert, Delete, Page Up and Page Down keys work in Vi-style key bindings (#3731).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.5b1 (released January 14, 2017)
|
||||
|
||||
## Platform Changes
|
||||
|
||||
Starting with version 2.5, fish requires a more up-to-date version of C++, specifically C++11 (from 2011). This affects some older platforms:
|
||||
|
||||
### Linux
|
||||
|
||||
For users building from source, GCC's g++ 4.8 or later, or LLVM's clang 3.3 or later, are known to work. Older platforms may require a newer compiler installed.
|
||||
|
||||
Unfortunately, because of the complexity of the toolchain, binary packages are no longer published by the fish-shell developers for the following platforms:
|
||||
|
||||
- Red Hat Enterprise Linux and CentOS 5 & 6 for 64-bit builds
|
||||
- Ubuntu 12.04 (EoLTS April 2017)
|
||||
- Debian 7 (EoLTS May 2018)
|
||||
|
||||
Installing newer version of fish on these systems will require building from source.
|
||||
|
||||
### OS X SnowLeopard
|
||||
|
||||
Starting with version 2.5, fish requires a C++11 standard library on OS X 10.6 ("SnowLeopard"). If this library is not installed, you will see this error: `dyld: Library not loaded: /usr/lib/libc++.1.dylib`
|
||||
|
||||
MacPorts is the easiest way to obtain this library. After installing the SnowLeopard MacPorts release from the install page, run:
|
||||
|
||||
```
|
||||
sudo port -v install libcxx
|
||||
```
|
||||
|
||||
Now fish should launch successfully. (Please open an issue if it does not.)
|
||||
|
||||
This is only necessary on 10.6. OS X 10.7 and later include the required library by default.
|
||||
|
||||
## Other significant changes
|
||||
|
||||
- Attempting to exit with running processes in the background produces a warning, then signals them to terminate if a second attempt to exit is made. This brings the behaviour for running background processes into line with stopped processes. (#3497)
|
||||
- `random` can now have start, stop and step values specified, or the new `choice` subcommand can be used to pick an argument from a list (#3619).
|
||||
- A new key bindings preset, `fish_hybrid_key_bindings`, including all the Emacs-style and Vi-style bindings, which behaves like `fish_vi_key_bindings` in fish 2.3.0 (#3556).
|
||||
- `function` now returns an error when called with invalid options, rather than defining the function anyway (#3574). This was a regression present in fish 2.3 and 2.4.0.
|
||||
- fish no longer prints a warning when it identifies a running instance of an old version (2.1.0 and earlier). Changes to universal variables may not propagate between these old versions and 2.5b1.
|
||||
- Improved compatiblity with Android (#3585), MSYS/mingw (#2360), and Solaris (#3456, #3340).
|
||||
- Like other shells, the `test` builting now returns an error for numeric operations on invalid integers (#3346, #3581).
|
||||
- `complete` no longer recognises `--authoritative` and `--unauthoritative` options, and they are marked as obsolete.
|
||||
- `status` accepts subcommands, and should be used like `status is-interactive`. The old options continue to be supported for the foreseeable future (#3526), although only one subcommand or option can be specified at a time.
|
||||
- Selection mode (used with "begin-selection") no longer selects a character the cursor does not move over (#3684).
|
||||
- List indexes are handled better, and a bit more liberally in some cases (`echo $PATH[1 .. 3]` is now valid) (#3579).
|
||||
- The `fish_mode_prompt` function is now simply a stub around `fish_default_mode_prompt`, which allows the mode prompt to be included more easily in customised prompt functions (#3641).
|
||||
|
||||
## Notable fixes and improvements
|
||||
- `alias`, run without options or arguments, lists all defined aliases, and aliases now include a description in the function signature that identifies them.
|
||||
- `complete` accepts empty strings as descriptions (#3557).
|
||||
- `command` accepts `-q`/`--quiet` in combination with `--search` (#3591), providing a simple way of checking whether a command exists in scripts.
|
||||
- Abbreviations can now be renamed with `abbr --rename OLD_KEY NEW_KEY` (#3610).
|
||||
- The command synopses printed by `--help` options work better with copying and pasting (#2673).
|
||||
- `help` launches the browser specified by the `$fish_help_browser variable` if it is set (#3131).
|
||||
- History merging could lose items under certain circumstances and is now fixed (#3496).
|
||||
- The `$status` variable is now set to 123 when a syntactically invalid command is entered (#3616).
|
||||
- Exiting fish now signals all background processes to terminate, not just stopped jobs (#3497).
|
||||
- A new `prompt_hostname` function which prints a hostname suitable for use in prompts (#3482).
|
||||
- The `__fish_man_page` function (bound to Alt-h by default) now tries to recognize subcommands (e.g. `git add` will now open the "git-add" man page) (#3678).
|
||||
- A new function `edit_command_buffer` (bound to Alt-e & Alt-v by default) to edit the command buffer in an external editor (#1215, #3627).
|
||||
- `set_color` now supports italics (`--italics`), dim (`--dim`) and reverse (`--reverse`) modes (#3650).
|
||||
- Filesystems with very slow locking (eg incorrectly-configured NFS) will no longer slow fish down (#685).
|
||||
- Improved completions for `apt` (#3695), `fusermount` (#3642), `make` (#3628), `netctl-auto` (#3378), `nmcli` (#3648), `pygmentize` (#3378), and `tar` (#3719).
|
||||
- Added completions for:
|
||||
- `VBoxHeadless` (#3378)
|
||||
- `VBoxSDL` (#3378)
|
||||
- `base64` (#3378)
|
||||
- `caffeinate` (#3524)
|
||||
- `dconf` (#3638)
|
||||
- `dig` (#3495)
|
||||
- `dpkg-reconfigure` (#3521 & #3522)
|
||||
- `feh` (#3378)
|
||||
- `launchctl` (#3682)
|
||||
- `lxc` (#3554 & #3564),
|
||||
- `mddiagnose` (#3524)
|
||||
- `mdfind` (#3524)
|
||||
- `mdimport` (#3524)
|
||||
- `mdls` (#3524)
|
||||
- `mdutil` (#3524)
|
||||
- `mkvextract` (#3492)
|
||||
- `nvram` (#3524)
|
||||
- `objdump` (#3378)
|
||||
- `sysbench` (#3491)
|
||||
- `tmutil` (#3524)
|
||||
|
||||
---
|
||||
|
||||
# fish 2.4.0 (released November 8, 2016)
|
||||
|
||||
There are no major changes between 2.4b1 and 2.4.0.
|
||||
|
||||
## Notable fixes and improvements
|
||||
- The documentation is now generated properly and with the correct version identifier.
|
||||
- Automatic cursor changes are now only enabled on the subset of XTerm versions known to support them, resolving a problem where older versions printed garbage to the terminal before and after every prompt (#3499).
|
||||
- Improved the title set in Apple Terminal.app.
|
||||
- Added completions for `defaults` and improved completions for `diskutil` (#3478).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.4b1 (released October 18, 2016)
|
||||
|
||||
## Significant changes
|
||||
- The clipboard integration has been revamped with explicit bindings. The killring commands no longer copy from, or paste to, the X11 clipboard - use the new copy (`C-x`) and paste (`C-v`) bindings instead. The clipboard is now available on OS X as well as systems using X11 (e.g. Linux). (#3061)
|
||||
- `history` uses subcommands (`history delete`) rather than options (`history --delete`) for its actions (#3367). You can no longer specify multiple actions via flags (e.g., `history --delete --save something`).
|
||||
- New `history` options have been added, including `--max=n` to limit the number of history entries, `--show-time` option to show timestamps (#3175, #3244), and `--null` to null terminate history entries in the search output.
|
||||
- `history search` is now case-insensitive by default (which also affects `history delete`) (#3236).
|
||||
- `history delete` now correctly handles multiline commands (#31).
|
||||
- Vi-style bindings no longer include all of the default emacs-style bindings; instead, they share some definitions (#3068).
|
||||
- If there is no locale set in the environment, various known system configuration files will be checked for a default. If no locale can be found, `en_US-UTF.8` will be used (#277).
|
||||
- A number followed by a caret (e.g. `5^`) is no longer treated as a redirection (#1873).
|
||||
- The `$version` special variable can be overwritten, so that it can be used for other purposes if required.
|
||||
|
||||
## Notable fixes and improvements
|
||||
- The `fish_realpath` builtin has been renamed to `realpath` and made compatible with GNU `realpath` when run without arguments (#3400). It is used only for systems without a `realpath` or `grealpath` utility (#3374).
|
||||
- Improved color handling on terminals/consoles with 8-16 colors, particularly the use of bright named color (#3176, #3260).
|
||||
- `fish_indent` can now read from files given as arguments, rather than just standard input (#3037).
|
||||
- Fuzzy tab completions behave in a less surprising manner (#3090, #3211).
|
||||
- `jobs` should only print its header line once (#3127).
|
||||
- Wildcards in redirections are highlighted appropriately (#2789).
|
||||
- Suggestions will be offered more often, like after removing characters (#3069).
|
||||
- `history --merge` now correctly interleaves items in chronological order (#2312).
|
||||
- Options for `fish_indent` have been aligned with the other binaries - in particular, `-d` now means `--debug`. The `--dump` option has been renamed to `--dump-parse-tree` (#3191).
|
||||
- The display of bindings in the Web-based configuration has been greatly improved (#3325), as has the rendering of prompts (#2924).
|
||||
- fish should no longer hang using 100% CPU in the C locale (#3214).
|
||||
- A bug in FreeBSD 11 & 12, Dragonfly BSD & illumos prevented fish from working correctly on these platforms under UTF-8 locales; fish now avoids the buggy behaviour (#3050).
|
||||
- Prompts which show git repository information (via `__fish_git_prompt`) are faster in large repositories (#3294) and slow filesystems (#3083).
|
||||
- fish 2.3.0 reintroduced a problem where the greeting was printed even when using `read`; this has been corrected again (#3261).
|
||||
- Vi mode changes the cursor depending on the current mode (#3215).
|
||||
- Command lines with escaped space characters at the end tab-complete correctly (#2447).
|
||||
- Added completions for:
|
||||
- `arcanist` (#3256)
|
||||
- `connmanctl` (#3419)
|
||||
- `figlet` (#3378)
|
||||
- `mdbook` (#3378)
|
||||
- `ninja` (#3415)
|
||||
- `p4`, the Perforce client (#3314)
|
||||
- `pygmentize` (#3378)
|
||||
- `ranger` (#3378)
|
||||
- Improved completions for `aura` (#3297), `abbr` (#3267), `brew` (#3309), `chown` (#3380, #3383),`cygport` (#3392), `git` (#3274, #3226, #3225, #3094, #3087, #3035, #3021, #2982, #3230), `kill` & `pkill` (#3200), `screen` (#3271), `wget` (#3470), and `xz` (#3378).
|
||||
- Distributors, packagers and developers will notice that the build process produces more succinct output by default; use `make V=1` to get verbose output (#3248).
|
||||
- Improved compatibility with minor platforms including musl (#2988), Cygwin (#2993), Android (#3441, #3442), Haiku (#3322) and Solaris .
|
||||
|
||||
---
|
||||
|
||||
# fish 2.3.1 (released July 3, 2016)
|
||||
|
||||
This is a functionality and bugfix release. This release does not contain all the changes to fish since the last release, but fixes a number of issues directly affecting users at present and includes a small number of new features.
|
||||
|
||||
## Significant changes
|
||||
- A new `fish_key_reader` binary for decoding interactive keypresses (#2991).
|
||||
- `fish_mode_prompt` has been updated to reflect the changes in the way the Vi input mode is set up (#3067), making this more reliable.
|
||||
- `fish_config` can now properly be launched from the OS X app bundle (#3140).
|
||||
|
||||
## Notable fixes and improvements
|
||||
|
||||
- Extra lines were sometimes inserted into the output under Windows (Cygwin and Microsoft Windows Subsystem for Linux) due to TTY timestamps not being updated (#2859).
|
||||
- The `string` builtin's `match` mode now handles the combination of `-rnv` (match, invert and count) correctly (#3098).
|
||||
- Improvements to TTY special character handling (#3064), locale handling (#3124) and terminal environment variable handling (#3060).
|
||||
- Work towards handling the terminal modes for external commands launched from initialisation files (#2980).
|
||||
- Ease the upgrade path from fish 2.2.0 and before by warning users to restart fish if the `string` builtin is not available (#3057).
|
||||
- `type -a` now syntax-colorizes function source output.
|
||||
- Added completions for `alsamixer`, `godoc`, `gofmt`, `goimports`, `gorename`, `lscpu`, `mkdir`, `modinfo`, `netctl-auto`, `poweroff`, `termite`, `udisksctl` and `xz` (#3123).
|
||||
- Improved completions for `apt` (#3097), `aura` (#3102),`git` (#3114), `npm` (#3158), `string` and `suspend` (#3154).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.3.0 (released May 20, 2016)
|
||||
|
||||
There are no significant changes between 2.3.0 and 2.3b2.
|
||||
|
||||
## Other notable fixes and improvements
|
||||
|
||||
- `abbr` now allows non-letter keys (#2996).
|
||||
- Define a few extra colours on first start (#2987).
|
||||
- Multiple documentation updates.
|
||||
- Added completions for rmmod (#3007).
|
||||
- Improved completions for git (#2998).
|
||||
|
||||
## Known issues
|
||||
|
||||
- Interactive commands started from fish configuration files or from the `-c` option may, under certain circumstances, be started with incorrect terminal modes and fail to behave as expected. A fix is planned but requires further testing (#2619).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.3b2 (released May 5, 2016)
|
||||
|
||||
## Significant changes
|
||||
|
||||
- A new `fish_realpath` builtin and associated function to allow the use of `realpath` even on those platforms that don't ship an appropriate command (#2932).
|
||||
- Alt-# toggles the current command line between commented and uncommented states, making it easy to save a command in history without executing it.
|
||||
- The `fish_vi_mode` function is now deprecated in favour of `fish_vi_key_bindings`.
|
||||
|
||||
## Other notable fixes and improvements
|
||||
|
||||
- Fix the build on Cygwin (#2952) and RedHat Enterprise Linux/CentOS 5 (#2955).
|
||||
- Avoid confusing the terminal line driver with non-printing characters in `fish_title` (#2453).
|
||||
- Improved completions for busctl, git (#2585, #2879, #2984), and netctl.
|
||||
|
||||
---
|
||||
|
||||
# fish 2.3b1 (released April 19, 2016)
|
||||
|
||||
## Significant Changes
|
||||
|
||||
- A new `string` builtin to handle... strings! This builtin will measure, split, search and replace text strings, including using regular expressions. It can also be used to turn lists into plain strings using `join`. `string` can be used in place of `sed`, `grep`, `tr`, `cut`, and `awk` in many situations. (#2296)
|
||||
- Allow using escape as the Meta modifier key, by waiting after seeing an escape character wait up to 300ms for an additional character. This is consistent with readline (e.g. bash) and can be configured via the `fish_escape_delay_ms variable`. This allows using escape as the Meta modifier. (#1356)
|
||||
- Add new directories for vendor functions and configuration snippets (#2500)
|
||||
- A new `fish_realpath` builtin and associated `realpath` function should allow scripts to resolve path names via `realpath` regardless of whether there is an external command of that name; albeit with some limitations. See the associated documentation.
|
||||
|
||||
## Backward-incompatible changes
|
||||
|
||||
- Unmatched globs will now cause an error, except when used with `for`, `set` or `count` (#2719)
|
||||
- `and` and `or` will now bind to the closest `if` or `while`, allowing compound conditions without `begin` and `end` (#1428)
|
||||
- `set -ql` now searches up to function scope for variables (#2502)
|
||||
- `status -f` will now behave the same when run as the main script or using `source` (#2643)
|
||||
- `source` no longer puts the file name in `$argv` if no arguments are given (#139)
|
||||
- History files are stored under the `XDG_DATA_HOME` hierarchy (by default, in `~/.local/share`), and existing history will be moved on first use (#744)
|
||||
|
||||
## Other notable fixes and improvements
|
||||
|
||||
- Fish no longer silences errors in config.fish (#2702)
|
||||
- Directory autosuggestions will now descend as far as possible if there is only one child directory (#2531)
|
||||
- Add support for bright colors (#1464)
|
||||
- Allow Ctrl-J (\cj) to be bound separately from Ctrl-M (\cm) (#217)
|
||||
- psub now has a "-s"/"–suffix" option to name the temporary file with that suffix
|
||||
- Enable 24-bit colors on select terminals (#2495)
|
||||
- Support for SVN status in the prompt (#2582)
|
||||
- Mercurial and SVN support have been added to the Classic + Git (now Classic + VCS) prompt (via the new \__fish_vcs_prompt function) (#2592)
|
||||
- export now handles variables with a "=" in the value (#2403)
|
||||
- New completions for:
|
||||
- alsactl
|
||||
- Archlinux's asp, makepkg
|
||||
- Atom's apm (#2390)
|
||||
- entr - the "Event Notify Test Runner" (#2265)
|
||||
- Fedora's dnf (#2638)
|
||||
- OSX diskutil (#2738)
|
||||
- pkgng (#2395)
|
||||
- pulseaudio's pacmd and pactl
|
||||
- rust's rustc and cargo (#2409)
|
||||
- sysctl (#2214)
|
||||
- systemd's machinectl (#2158), busctl (#2144), systemd-nspawn, systemd-analyze, localectl, timedatectl
|
||||
- and more
|
||||
- Fish no longer has a function called sgrep, freeing it for user customization (#2245)
|
||||
- A rewrite of the completions for cd, fixing a few bugs (#2299, #2300, #562)
|
||||
- Linux VTs now run in a simplified mode to avoid issues (#2311)
|
||||
- The vi-bindings now inherit from the emacs bindings
|
||||
- Fish will also execute `fish_user_key_bindings` when in vi-mode
|
||||
- `funced` will now also check $VISUAL (#2268)
|
||||
- A new `suspend` function (#2269)
|
||||
- Subcommand completion now works better with split /usr (#2141)
|
||||
- The command-not-found-handler can now be overridden by defining a function called `__fish_command_not_found_handler` in config.fish (#2332)
|
||||
- A few fixes to the Sorin theme
|
||||
- PWD shortening in the prompt can now be configured via the `fish_prompt_pwd_dir_length` variable, set to the length per path component (#2473)
|
||||
- fish no longer requires `/etc/fish/config.fish` to correctly start, and now ships a skeleton file that only contains some documentation (#2799)
|
||||
|
||||
---
|
||||
|
||||
# fish 2.2.0 (released July 12, 2015)
|
||||
|
||||
### Significant changes ###
|
||||
|
||||
* Abbreviations: the new `abbr` command allows for interactively-expanded abbreviations, allowing quick access to frequently-used commands (#731).
|
||||
* Vi mode: run `fish_vi_mode` to switch fish into the key bindings and prompt familiar to users of the Vi editor (#65).
|
||||
* New inline and interactive pager, which will be familiar to users of zsh (#291).
|
||||
* Underlying architectural changes: the `fishd` universal variable server has been removed as it was a source of many bugs and security problems. Notably, old fish sessions will not be able to communicate universal variable changes with new fish sessions. For best results, restart all running instances of `fish`.
|
||||
* The web-based configuration tool has been redesigned, featuring a prompt theme chooser and other improvements.
|
||||
* New German, Brazilian Portuguese, and Chinese translations.
|
||||
|
||||
### Backward-incompatible changes ###
|
||||
|
||||
These are kept to a minimum, but either change undocumented features or are too hard to use in their existing forms. These changes may break existing scripts.
|
||||
|
||||
* `commandline` no longer interprets functions "in reverse", instead behaving as expected (#1567).
|
||||
* The previously-undocumented `CMD_DURATION` variable is now set for all commands and contains the execution time of the last command in milliseconds (#1585). It is no longer exported to other commands (#1896).
|
||||
* `if` / `else` conditional statements now return values consistent with the Single Unix Specification, like other shells (#1443).
|
||||
* A new "top-level" local scope has been added, allowing local variables declared on the commandline to be visible to subsequent commands. (#1908)
|
||||
|
||||
### Other notable fixes and improvements ###
|
||||
|
||||
* New documentation design (#1662), which requires a Doxygen version 1.8.7 or newer to build.
|
||||
* Fish now defines a default directory for other packages to provide completions. By default this is `/usr/share/fish/vendor-completions.d`; on systems with `pkgconfig` installed this path is discoverable with `pkg-config --variable completionsdir fish`.
|
||||
* A new parser removes many bugs; all existing syntax should keep working.
|
||||
* New `fish_preexec` and `fish_postexec` events are fired before and after job execution respectively (#1549).
|
||||
* Unmatched wildcards no longer prevent a job from running. Wildcards used interactively will still print an error, but the job will proceed and the wildcard will expand to zero arguments (#1482).
|
||||
* The `.` command is deprecated and the `source` command is preferred (#310).
|
||||
* `bind` supports "bind modes", which allows bindings to be set for a particular named mode, to support the implementation of Vi mode.
|
||||
* A new `export` alias, which behaves like other shells (#1833).
|
||||
* `command` has a new `--search` option to print the name of the disk file that would be executed, like other shells' `command -v` (#1540).
|
||||
* `commandline` has a new `--paging-mode` option to support the new pager.
|
||||
* `complete` has a new `--wraps` option, which allows a command to (recursively) inherit the completions of a wrapped command (#393), and `complete -e` now correctly erases completions (#380).
|
||||
* Completions are now generated from manual pages by default on the first run of fish (#997).
|
||||
* `fish_indent` can now produce colorized (`--ansi`) and HTML (`--html`) output (#1827).
|
||||
* `functions --erase` now prevents autoloaded functions from being reloaded in the current session.
|
||||
* `history` has a new `--merge` option, to incorporate history from other sessions into the current session (#825).
|
||||
* `jobs` returns 1 if there are no active jobs (#1484).
|
||||
* `read` has several new options:
|
||||
* `--array` to break input into an array (#1540)
|
||||
* `--null` to break lines on NUL characters rather than newlines (#1694)
|
||||
* `--nchars` to read a specific number of characters (#1616)
|
||||
* `--right-prompt` to display a right-hand-side prompt during interactive read (#1698).
|
||||
* `type` has a new `-q` option to suppress output (#1540 and, like other shells, `type -a` now prints all matches for a command (#261).
|
||||
* Pressing F1 now shows the manual page for the current command (#1063).
|
||||
* `fish_title` functions have access to the arguments of the currently running argument as `$argv[1]` (#1542).
|
||||
* The OS command-not-found handler is used on Arch Linux (#1925), nixOS (#1852), openSUSE and Fedora (#1280).
|
||||
* `Alt`+`.` searches backwards in the token history, mapping to the same behavior as inserting the last argument of the previous command, like other shells (#89).
|
||||
* The `SHLVL` environment variable is incremented correctly (#1634 & #1693).
|
||||
* Added completions for `adb` (#1165 & #1211), `apt` (#2018), `aura` (#1292), `composer` (#1607), `cygport` (#1841), `dropbox` (#1533), `elixir` (#1167), `fossil`, `heroku` (#1790), `iex` (#1167), `kitchen` (#2000), `nix` (#1167), `node`/`npm` (#1566), `opam` (#1615), `setfacl` (#1752), `tmuxinator` (#1863), and `yast2` (#1739).
|
||||
* Improved completions for `brew` (#1090 & #1810), `bundler` (#1779), `cd` (#1135), `emerge` (#1840),`git` (#1680, #1834 & #1951), `man` (#960), `modprobe` (#1124), `pacman` (#1292), `rpm` (#1236), `rsync` (#1872), `scp` (#1145), `ssh` (#1234), `sshfs` (#1268), `systemctl` (#1462, #1950 & #1972), `tmux` (#1853), `vagrant` (#1748), `yum` (#1269), and `zypper` (#1787).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.1.2 (released Feb 24, 2015)
|
||||
|
||||
fish 2.1.2 contains a workaround for a filesystem bug in Mac OS X Yosemite. #1859
|
||||
|
||||
Specifically, after installing fish 2.1.1 and then rebooting, "Verify Disk" in Disk Utility will report "Invalid number of hard links." We don't have any reports of data loss or other adverse consequences. fish 2.1.2 avoids triggering the bug, but does not repair an already affected filesystem. To repair the filesystem, you can boot into Recovery Mode and use Repair Disk from Disk Utility. Linux and versions of OS X prior to Yosemite are believed to be unaffected.
|
||||
|
||||
There are no other changes in this release.
|
||||
|
||||
---
|
||||
|
||||
# fish 2.1.1 (released September 26, 2014)
|
||||
|
||||
__Important:__ if you are upgrading, stop all running instances of `fishd` as soon as possible after installing this release; it will be restarted automatically. On most systems, there will be no further action required. Note that some environments (where `XDG_RUNTIME_DIR` is set), such as Fedora 20, will require a restart of all running fish processes before universal variables work as intended.
|
||||
|
||||
Distributors are highly encouraged to call `killall fishd`, `pkill fishd` or similar in installation scripts, or to warn their users to do so.
|
||||
|
||||
### Security fixes
|
||||
* The fish_config web interface now uses an authentication token to protect requests and only responds to requests from the local machine with this token, preventing a remote code execution attack. (closing CVE-2014-2914). #1438
|
||||
* `psub` and `funced` are no longer vulnerable to attacks which allow local privilege escalation and data tampering (closing CVE-2014-2906 and CVE-2014-3856). #1437
|
||||
* `fishd` uses a secure path for its socket, preventing a local privilege escalation attack (closing CVE-2014-2905). #1436
|
||||
* `__fish_print_packages` is no longer vulnerable to attacks which would allow local privilege escalation and data tampering (closing CVE-2014-3219). #1440
|
||||
|
||||
### Other fixes
|
||||
* `fishd` now ignores SIGPIPE, fixing crashes using tools like GNU Parallel and which occurred more often as a result of the other `fishd` changes. #1084 & #1690
|
||||
|
||||
---
|
||||
|
||||
# fish 2.1.0
|
||||
|
||||
Significant Changes
|
||||
-------------------
|
||||
|
||||
* **Tab completions will fuzzy-match files.** #568
|
||||
|
||||
When tab-completing a file, fish will first attempt prefix matches (`foo` matches `foobar`), then substring matches (`ooba` matches `foobar`), and lastly subsequence matches (`fbr` matches `foobar`). For example, in a directory with files foo1.txt, foo2.txt, foo3.txt…, you can type only the numeric part and hit tab to fill in the rest.
|
||||
|
||||
This feature is implemented for files and executables. It is not yet implemented for options (like `--foobar`), and not yet implemented across path components (like `/u/l/b` to match `/usr/local/bin`).
|
||||
|
||||
* **Redirections now work better across pipelines.** #110, #877
|
||||
|
||||
In particular, you can pipe stderr and stdout together, for example, with `cmd ^&1 | tee log.txt`, or the more familiar `cmd 2>&1 | tee log.txt`.
|
||||
|
||||
* **A single `%` now expands to the last job backgrounded.** #1008
|
||||
|
||||
Previously, a single `%` would pid-expand to either all backgrounded jobs, or all jobs owned by your user. Now it expands to the last job backgrounded. If no job is in the background, it will fail to expand. In particular, `fg %` can be used to put the most recent background job in the foreground.
|
||||
|
||||
Other Notable Fixes
|
||||
-------------------
|
||||
|
||||
* alt-U and alt+C now uppercase and capitalize words, respectively. #995
|
||||
|
||||
* VTE based terminals should now know the working directory. #906
|
||||
|
||||
* The autotools build now works on Mavericks. #968
|
||||
|
||||
* The end-of-line binding (ctrl+E) now accepts autosuggestions. #932
|
||||
|
||||
* Directories in `/etc/paths` (used on OS X) are now prepended instead of appended, similar to other shells. #927
|
||||
|
||||
* Option-right-arrow (used for partial autosuggestion completion) now works on iTerm2. #920
|
||||
|
||||
* Tab completions now work properly within nested subcommands. #913
|
||||
|
||||
* `printf` supports \e, the escape character. #910
|
||||
|
||||
* `fish_config history` no longer shows duplicate items. #900
|
||||
|
||||
* `$fish_user_paths` is now prepended to $PATH instead of appended. #888
|
||||
|
||||
* Jobs complete when all processes complete. #876
|
||||
|
||||
|
||||
For example, in previous versions of fish, `sleep 10 | echo Done` returns control immediately, because echo does not read from stdin. Now it does not complete until sleep exits (presumably after 10 seconds).
|
||||
|
||||
* Better error reporting for square brackets. #875
|
||||
|
||||
* fish no longer tries to add `/bin` to `$PATH` unless PATH is totally empty. #852
|
||||
|
||||
* History token substitution (alt-up) now works correctly inside subshells. #833
|
||||
|
||||
* Flow control is now disabled, freeing up ctrl-S and ctrl-Q for other uses. #814
|
||||
|
||||
* sh-style variable setting like `foo=bar` now produces better error messages. #809
|
||||
|
||||
* Commands with wildcards no longer produce autosuggestions. #785
|
||||
|
||||
* funced no longer freaks out when supplied with no arguments. #780
|
||||
|
||||
* fish.app now works correctly in a directory containing spaces. #774
|
||||
|
||||
* Tab completion cycling no longer occasionally fails to repaint. #765
|
||||
|
||||
* Comments now work in eval'd strings. #684
|
||||
|
||||
* History search (up-arrow) now shows the item matching the autosuggestion, if that autosuggestion was truncated. #650
|
||||
|
||||
* Ctrl-T now transposes characters, as in other shells. #128
|
||||
|
||||
---
|
||||
|
||||
# fish 2.0.0
|
||||
|
||||
Significant Changes
|
||||
-------------------
|
||||
|
||||
* **Command substitutions now modify `$status` #547.**
|
||||
Previously the exit status of command substitutions (like `(pwd)`) was ignored; however now it modifies $status. Furthermore, the `set` command now only sets $status on failure; it is untouched on success. This allows for the following pattern:
|
||||
|
||||
```sh
|
||||
if set python_path (which python)
|
||||
...
|
||||
end
|
||||
```
|
||||
Because set does not modify $status on success, the if branch effectively tests whether `which` succeeded, and if so, whether the `set` also succeeded.
|
||||
* **Improvements to $PATH handling.**
|
||||
* There is a new variable, `$fish_user_paths`, which can be set universally, and whose contents are appended to $PATH #527
|
||||
* /etc/paths and /etc/paths.d are now respected on OS X
|
||||
* fish no longer modifies $PATH to find its own binaries
|
||||
* **Long lines no longer use ellipsis for line breaks**, and copy and paste
|
||||
should no longer include a newline even if the line was broken #300
|
||||
* **New syntax for index ranges** (sometimes known as "slices") #212
|
||||
* **fish now supports an `else if` statement** #134
|
||||
* **Process and pid completion now works on OS X** #129
|
||||
* **fish is now relocatable**, and no longer depends on compiled-in paths #125
|
||||
* **fish now supports a right prompt (RPROMPT)** through the fish_right_prompt function #80
|
||||
* **fish now uses posix_spawn instead of fork when possible**, which is much faster on BSD and OS X #11
|
||||
|
||||
Other Notable Fixes
|
||||
-------------------
|
||||
|
||||
* Updated VCS completions (darcs, cvs, svn, etc.)
|
||||
* Avoid calling getcwd on the main thread, as it can hang #696
|
||||
* Control-D (forward delete) no longer stops at a period #667
|
||||
* Completions for many new commands
|
||||
* fish now respects rxvt's unique keybindings #657
|
||||
* xsel is no longer built as part of fish. It will still be invoked if installed separately #633
|
||||
* __fish_filter_mime no longer spews #628
|
||||
* The --no-execute option to fish no longer falls over when reaching the end of a block #624
|
||||
* fish_config knows how to find fish even if it's not in the $PATH #621
|
||||
* A leading space now prevents writing to history, as is done in bash and zsh #615
|
||||
* Hitting enter after a backslash only goes to a new line if it is followed by whitespace or the end of the line #613
|
||||
* printf is now a builtin #611
|
||||
* Event handlers should no longer fire if signals are blocked #608
|
||||
* set_color is now a builtin #578
|
||||
* man page completions are now located in a new generated_completions directory, instead of your completions directory #576
|
||||
* tab now clears autosuggestions #561
|
||||
* tab completion from within a pair of quotes now attempts to "appropriate" the closing quote #552
|
||||
* $EDITOR can now be a list: for example, `set EDITOR gvim -f`) #541
|
||||
* `case` bodies are now indented #530
|
||||
* The profile switch `-p` no longer crashes #517
|
||||
* You can now control-C out of `read` #516
|
||||
* `umask` is now functional on OS X #515
|
||||
* Avoid calling getpwnam on the main thread, as it can hang #512
|
||||
* Alt-F or Alt-right-arrow (Option-F or option-right-arrow) now accepts one word of an autosuggestion #435
|
||||
* Setting fish as your login shell no longer kills OpenSUSE #367
|
||||
* Backslashes now join lines, instead of creating multiple commands #347
|
||||
* echo now implements the -e flag to interpret escapes #337
|
||||
* When the last token in the user's input contains capital letters, use its case in preference to that of the autosuggestion #335
|
||||
* Descriptions now have their own muted color #279
|
||||
* Wildcards beginning with a . (for example, `ls .*`) no longer match . and .. #270
|
||||
* Recursive wildcards now handle symlink loops #268
|
||||
* You can now delete history items from the fish_config web interface #250
|
||||
* The OS X build now weak links `wcsdup` and `wcscasecmp` #240
|
||||
* fish now saves and restores the process group, which prevents certain processes from being erroneously reported as stopped #197
|
||||
* funced now takes an editor option #187
|
||||
* Alternating row colors are available in fish pager through `fish_pager_color_secondary` #186
|
||||
* Universal variable values are now stored based on your MAC address, not your hostname #183
|
||||
* The caret ^ now only does a stderr redirection if it is the first character of a token, making git users happy #168
|
||||
* Autosuggestions will no longer cause line wrapping #167
|
||||
* Better handling of Unicode combining characters #155
|
||||
* fish SIGHUPs processes more often #138
|
||||
* fish no longer causes `sudo` to ask for a password every time
|
||||
* fish behaves better under Midnight Commander #121
|
||||
* `set -e` no longer crashes #100
|
||||
* fish now will automatically import history from bash, if there is no fish history #66
|
||||
* Backslashed-newlines inside quoted strings now behave more intuitively #52
|
||||
* Tab titles should be shown correctly in iTerm2 #47
|
||||
* scp remote path completion now sometimes works #42
|
||||
* The `read` builtin no longer shows autosuggestions #29
|
||||
* Custom key bindings can now be set via the `fish_user_key_bindings` function #21
|
||||
* All Python scripts now run correctly under both Python 2 and Python 3 #14
|
||||
* The "accept autosuggestion" key can now be configured #19
|
||||
* Autosuggestions will no longer suggest invalid commands #6
|
||||
|
||||
---
|
||||
|
||||
# fishfish Beta r2
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
* **Implicit cd** is back, for paths that start with one or two dots, a slash, or a tilde.
|
||||
* **Overrides of default functions should be fixed.** The "internalized scripts" feature is disabled for now.
|
||||
* **Disabled delayed suspend.** This is a strange job-control feature of BSD systems, including OS X. Disabling it frees up Control Y for other purposes; in particular, for yank, which now works on OS X.
|
||||
* **fish_indent is fixed.** In particular, the `funced` and `funcsave` functions work again.
|
||||
* A SIGTERM now ends the whole execution stack again (resolving #13).
|
||||
* Bumped the __fish_config_interactive version number so the default fish_color_autosuggestion kicks in.
|
||||
* fish_config better handles combined term256 and classic colors like "555 yellow".
|
||||
|
||||
New Features
|
||||
------------
|
||||
|
||||
* **A history builtin**, and associated interactive function that enables deleting history items. Example usage:
|
||||
* Print all history items beginning with echo: `history --prefix echo`
|
||||
* Print all history items containing foo: `history --contains foo`
|
||||
* Interactively delete some items containing foo: `history --delete --contains foo`
|
||||
|
||||
Credit to @siteshwar for implementation. Thanks @siteshwar!
|
||||
|
||||
---
|
||||
|
||||
# fishfish Beta r1
|
||||
|
||||
## Scripting
|
||||
* No changes! All existing fish scripts, config files, completions, etc. from trunk should continue to work.
|
||||
|
||||
## New Features
|
||||
* **Autosuggestions**. Think URL fields in browsers. When you type a command, fish will suggest the rest of the command after the cursor, in a muted gray when possible. You can accept the suggestion with the right arrow key or Ctrl-F. Suggestions come from command history, completions, and some custom code for cd; there's a lot of potential for improvement here. The suggestions are computed on a background pthread, so they never slow down your typing. The autosuggestion feature is incredible. I miss it dearly every time I use anything else.
|
||||
|
||||
* **term256 support** where available, specifically modern xterms and OS X Lion. You can specify colors the old way ('set_color cyan') or by specifying RGB hex values ('set_color FF3333'); fish will pick the closest supported color. Some xterms do not advertise term256 support either in the $TERM or terminfo max_colors field, but nevertheless support it. For that reason, fish will default into using it on any xterm (but it can be disabled with an environment variable).
|
||||
|
||||
* **Web-based configuration** page. There is a new function 'fish_config'. This spins up a simple Python web server and opens a browser window to it. From this web page, you can set your shell colors and view your functions, variables, and history; all changes apply immediately to all running shells. Eventually all configuration ought to be supported via this mechanism (but in addition to, not instead of, command line mechanisms).
|
||||
|
||||
* **Man page completions**. There is a new function 'fish_update_completions'. This function reads all the man1 files from your manpath, removes the roff formatting, parses them to find the commands and options, and outputs fish completions into ~/.config/fish/completions. It won't overwrite existing completion files (except ones that it generated itself).
|
||||
|
||||
## Programmatic Changes
|
||||
* fish is now entirely in C++. I have no particular love for C++, but it provides a ready memory-model to replace halloc. We've made an effort to keep it to a sane and portable subset (no C++11, no boost, no going crazy with templates or smart pointers), but we do use the STL and a little tr1.
|
||||
* halloc is entirely gone, replaced by normal C++ ownership semantics. If you don't know what halloc is, well, now you have two reasons to be happy.
|
||||
* All the crufty C data structures are entirely gone. array_list_t, priority_queue_t, hash_table_t, string_buffer_t have been removed and replaced by STL equivalents like std::vector, std::map, and std::wstring. A lot of the string handling now uses std::wstring instead of wchar_t *
|
||||
* fish now spawns pthreads for tasks like syntax highlighting that require blocking I/O.
|
||||
* History has been completely rewritten. History files now use an extensible YAML-style syntax. History "merging" (multiple shells writing to the same history file) now works better. There is now a maximum history length of about 250k items (256 * 1024).
|
||||
* The parser has been "instanced," so you can now create more than one.
|
||||
* Total #LoC has shrunk slightly even with the new features.
|
||||
|
||||
## Performance
|
||||
* fish now runs syntax highlighting in a background thread, so typing commands is always responsive even on slow filesystems.
|
||||
* echo, test, and pwd are now builtins, which eliminates many forks.
|
||||
* The files in share/functions and share/completions now get 'internalized' into C strings that get compiled in with fish. This substantially reduces the number of files touched at startup. A consequence is that you cannot change these functions without recompiling, but often other functions depend on these "standard" functions, so changing them is perhaps not a good idea anyways.
|
||||
|
||||
Here are some system call counts for launching and then exiting fish with the default configuration, on OS X. The first column is fish trunk, the next column is with our changes, and the last column is bash for comparison. This data was collected via dtrace.
|
||||
|
||||
<table>
|
||||
<tr> <th> <th> before <th> after <th> bash
|
||||
<tr> <th> open <td> 9 <td> 4 <td> 5
|
||||
<tr> <th> fork <td> 28 <td> 14 <td> 0
|
||||
<tr> <th> stat <td> 131 <td> 85 <td> 11
|
||||
<tr> <th> lstat <td> 670 <td> 0 <td> 0
|
||||
<tr> <th> read <td> 332 <td> 80 <td> 4
|
||||
<tr> <th> write <td> 172 <td> 149 <td> 0
|
||||
</table>
|
||||
|
||||
The large number of forks relative to bash are due to fish's insanely expensive default prompt, which is unchanged in my version. If we switch to a prompt comparable to bash's (lame) default, the forks drop to 16 with trunk, 4 after our changes.
|
||||
|
||||
The large reduction in lstat() numbers is due to fish no longer needing to call ttyname() on OS X.
|
||||
|
||||
We've got some work to do to be as lean as bash, but we're on the right track.
|
||||
4403
CHANGELOG.rst
4403
CHANGELOG.rst
File diff suppressed because it is too large
Load Diff
211
CMakeLists.txt
211
CMakeLists.txt
@@ -1,92 +1,163 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
IF(POLICY CMP0066)
|
||||
CMAKE_POLICY(SET CMP0066 OLD)
|
||||
ENDIF()
|
||||
IF(POLICY CMP0067)
|
||||
CMAKE_POLICY(SET CMP0067 OLD)
|
||||
ENDIF()
|
||||
|
||||
PROJECT(fish)
|
||||
|
||||
# We are C++11.
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||
SET(DEFAULT_BUILD_TYPE "RelWithDebInfo")
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
MESSAGE(STATUS "Setting build type to default '${DEFAULT_BUILD_TYPE}'")
|
||||
SET(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}")
|
||||
ENDIF()
|
||||
|
||||
# Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support.
|
||||
# Rationale in https://github.com/ninja-build/ninja/issues/814
|
||||
if (CMAKE_GENERATOR STREQUAL "Ninja" AND
|
||||
((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)))
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
|
||||
endif()
|
||||
|
||||
# Disable exception handling.
|
||||
ADD_COMPILE_OPTIONS(-fno-exceptions)
|
||||
|
||||
# Hide the CMake Rules directories in Xcode projects.
|
||||
SOURCE_GROUP("CMake Rules" REGULAR_EXPRESSION "^$")
|
||||
|
||||
# Put source and header files at top level under targets.
|
||||
SOURCE_GROUP("Source Files" REGULAR_EXPRESSION "^$")
|
||||
SOURCE_GROUP("Header Files" REGULAR_EXPRESSION "^$")
|
||||
SOURCE_GROUP("Builtins" REGULAR_EXPRESSION "builtin_.*")
|
||||
|
||||
# Support folders.
|
||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
project(fish LANGUAGES C)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
IF(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
SET(FISH_IN_TREE_BUILD TRUE)
|
||||
ELSE()
|
||||
SET(FISH_IN_TREE_BUILD FALSE)
|
||||
ENDIF()
|
||||
|
||||
set(DEFAULT_BUILD_TYPE "RelWithDebInfo")
|
||||
# All objects that the system needs to build fish, except fish.cpp
|
||||
SET(FISH_SRCS
|
||||
src/autoload.cpp src/builtin.cpp src/builtin_bg.cpp src/builtin_bind.cpp
|
||||
src/builtin_block.cpp src/builtin_builtin.cpp src/builtin_cd.cpp
|
||||
src/builtin_command.cpp src/builtin_commandline.cpp
|
||||
src/builtin_complete.cpp src/builtin_contains.cpp src/builtin_disown.cpp
|
||||
src/builtin_echo.cpp src/builtin_emit.cpp src/builtin_exit.cpp
|
||||
src/builtin_fg.cpp src/builtin_function.cpp src/builtin_functions.cpp
|
||||
src/builtin_argparse.cpp src/builtin_history.cpp src/builtin_jobs.cpp
|
||||
src/builtin_math.cpp src/builtin_printf.cpp src/builtin_pwd.cpp
|
||||
src/builtin_random.cpp src/builtin_read.cpp src/builtin_realpath.cpp
|
||||
src/builtin_return.cpp src/builtin_set.cpp src/builtin_set_color.cpp
|
||||
src/builtin_source.cpp src/builtin_status.cpp src/builtin_string.cpp
|
||||
src/builtin_test.cpp src/builtin_ulimit.cpp src/builtin_wait.cpp
|
||||
src/color.cpp src/common.cpp src/complete.cpp src/env.cpp
|
||||
src/env_universal_common.cpp src/event.cpp src/exec.cpp src/expand.cpp
|
||||
src/fallback.cpp src/fish_version.cpp src/function.cpp src/highlight.cpp
|
||||
src/history.cpp src/input.cpp src/input_common.cpp src/intern.cpp src/io.cpp
|
||||
src/iothread.cpp src/kill.cpp src/output.cpp src/pager.cpp
|
||||
src/parse_execution.cpp src/parse_productions.cpp src/parse_tree.cpp
|
||||
src/parse_util.cpp src/parser.cpp src/parser_keywords.cpp src/path.cpp
|
||||
src/postfork.cpp src/proc.cpp src/reader.cpp src/sanity.cpp src/screen.cpp
|
||||
src/signal.cpp src/tinyexpr.c src/tnode.cpp src/tokenizer.cpp src/utf8.cpp src/util.cpp
|
||||
src/wcstringutil.cpp src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp
|
||||
src/future_feature_flags.cpp
|
||||
)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to default '${DEFAULT_BUILD_TYPE}'")
|
||||
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}")
|
||||
endif()
|
||||
# Header files are just globbed.
|
||||
FILE(GLOB FISH_HEADERS src/*.h)
|
||||
|
||||
# Set up config.h
|
||||
INCLUDE(cmake/ConfigureChecks.cmake)
|
||||
INCLUDE(cmake/gettext.cmake)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config_cmake.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Set up standard directories.
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(cmake/gettext.cmake)
|
||||
|
||||
# Set up PCRE2
|
||||
# This sets an environment variable that needs to be available before the Rust stanzas
|
||||
include(cmake/PCRE2.cmake)
|
||||
|
||||
include(cmake/Rust.cmake)
|
||||
|
||||
# Work around issue where archive-built libs go in the wrong place.
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
INCLUDE(GNUInstallDirs)
|
||||
ADD_DEFINITIONS(-D_UNICODE=1
|
||||
-DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
-DPREFIX=L"${CMAKE_INSTALL_PREFIX}"
|
||||
-DDATADIR=L"${CMAKE_INSTALL_FULL_DATADIR}"
|
||||
-DSYSCONFDIR=L"${CMAKE_INSTALL_FULL_SYSCONFDIR}"
|
||||
-DBINDIR=L"${CMAKE_INSTALL_FULL_BINDIR}"
|
||||
-DDOCDIR=L"${CMAKE_INSTALL_FULL_DOCDIR}")
|
||||
|
||||
# Set up the machinery around FISH-BUILD-VERSION-FILE
|
||||
# This defines the FBVF variable.
|
||||
include(Version)
|
||||
INCLUDE(Version)
|
||||
|
||||
# Let fish pick up when we're running out of the build directory without installing
|
||||
get_filename_component(REAL_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH)
|
||||
get_filename_component(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH)
|
||||
add_definitions(-DCMAKE_BINARY_DIR="${REAL_CMAKE_BINARY_DIR}")
|
||||
add_definitions(-DCMAKE_SOURCE_DIR="${REAL_CMAKE_SOURCE_DIR}")
|
||||
ADD_DEFINITIONS(-DCMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}")
|
||||
ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}")
|
||||
|
||||
set(build_types Release RelWithDebInfo Debug "")
|
||||
if(NOT "${CMAKE_BUILD_TYPE}" IN_LIST build_types)
|
||||
message(WARNING "Unsupported build type ${CMAKE_BUILD_TYPE}. If this doesn't build, try one of Release, RelWithDebInfo or Debug")
|
||||
endif()
|
||||
# Teach fish_version.o to rebuild when FBVF changes.
|
||||
# The standard C++ include detection machinery misses this.
|
||||
SET_SOURCE_FILES_PROPERTIES(src/fish_version.cpp
|
||||
PROPERTIES OBJECT_DEPENDS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FBVF})
|
||||
|
||||
# Define a function to build and link dependencies.
|
||||
function(CREATE_TARGET target)
|
||||
add_custom_target(
|
||||
${target} ALL
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E
|
||||
env ${VARS_FOR_CARGO}
|
||||
${Rust_CARGO}
|
||||
build --bin ${target}
|
||||
$<$<CONFIG:Release>:--release>
|
||||
$<$<CONFIG:RelWithDebInfo>:--profile=release-with-debug>
|
||||
--target ${Rust_CARGO_TARGET}
|
||||
--no-default-features
|
||||
${CARGO_FLAGS}
|
||||
${FEATURES_ARG}
|
||||
&&
|
||||
"${CMAKE_COMMAND}" -E
|
||||
copy "${rust_target_dir}/${rust_profile}/${target}" "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
USES_TERMINAL
|
||||
)
|
||||
endfunction(CREATE_TARGET)
|
||||
OPTION(INTERNAL_WCWIDTH "use fallback wcwidth" ON)
|
||||
IF(INTERNAL_WCWIDTH)
|
||||
add_definitions(-DHAVE_BROKEN_WCWIDTH=1)
|
||||
ELSE()
|
||||
add_definitions(-DHAVE_BROKEN_WCWIDTH=0)
|
||||
ENDIF()
|
||||
|
||||
# Define fish.
|
||||
create_target(fish)
|
||||
|
||||
# Define fish_indent.
|
||||
create_target(fish_indent)
|
||||
|
||||
# Define fish_key_reader.
|
||||
create_target(fish_key_reader)
|
||||
# Set up PCRE2
|
||||
INCLUDE(cmake/PCRE2.cmake)
|
||||
|
||||
# Set up the docs.
|
||||
include(cmake/Docs.cmake)
|
||||
INCLUDE(cmake/Docs.cmake)
|
||||
|
||||
# Define a function to link dependencies.
|
||||
FUNCTION(FISH_LINK_DEPS target)
|
||||
TARGET_LINK_LIBRARIES(${target} fishlib)
|
||||
ENDFUNCTION(FISH_LINK_DEPS)
|
||||
|
||||
# Define libfish.a.
|
||||
ADD_LIBRARY(fishlib STATIC ${FISH_SRCS})
|
||||
TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS})
|
||||
TARGET_LINK_LIBRARIES(fishlib
|
||||
${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS}
|
||||
${PCRE2_LIB} ${Intl_LIBRARIES})
|
||||
|
||||
# Define fish.
|
||||
ADD_EXECUTABLE(fish src/fish.cpp)
|
||||
FISH_LINK_DEPS(fish)
|
||||
|
||||
# Define fish_indent.
|
||||
ADD_EXECUTABLE(fish_indent
|
||||
src/fish_indent.cpp src/print_help.cpp)
|
||||
FISH_LINK_DEPS(fish_indent)
|
||||
|
||||
# Define fish_key_reader.
|
||||
ADD_EXECUTABLE(fish_key_reader
|
||||
src/fish_key_reader.cpp src/print_help.cpp)
|
||||
FISH_LINK_DEPS(fish_key_reader)
|
||||
|
||||
# Set up tests.
|
||||
include(cmake/Tests.cmake)
|
||||
|
||||
# Benchmarking support.
|
||||
include(cmake/Benchmark.cmake)
|
||||
INCLUDE(cmake/Tests.cmake)
|
||||
|
||||
# Set up install.
|
||||
include(cmake/Install.cmake)
|
||||
INCLUDE(cmake/Install.cmake)
|
||||
|
||||
# Mac app.
|
||||
include(cmake/MacApp.cmake)
|
||||
|
||||
include(FeatureSummary)
|
||||
feature_summary(WHAT ALL)
|
||||
INCLUDE(FeatureSummary)
|
||||
FEATURE_SUMMARY(WHAT ALL)
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
308
CONTRIBUTING.md
Normal file
308
CONTRIBUTING.md
Normal file
@@ -0,0 +1,308 @@
|
||||
# Guidelines For Developers
|
||||
|
||||
This document provides guidelines for making changes to the fish-shell project. This includes rules for how to format the code, naming conventions, et cetera. Generally known as the style of the code. It also includes recommended best practices such as creating a Travis CI account so you can verify that your changes pass all the tests before making a pull request.
|
||||
|
||||
See the bottom of this document for help on installing the linting and style reformatting tools discussed in the following sections.
|
||||
|
||||
Fish source should limit the C++ features it uses to those available in C++11. It should not use exceptions.
|
||||
|
||||
Before introducing a new dependency, please make it optional with graceful failure if possible. Add
|
||||
any new dependencies to the README.md under the *Running* and/or *Building* sections.
|
||||
|
||||
## Versioning
|
||||
|
||||
The fish version is constructed by the *build_tools/git_version_gen.sh* script. For developers the version is the branch name plus the output of `git describe --always --dirty`. Normally the main part of the version will be the closest annotated tag. Which itself is usually the most recent release number (e.g., `2.6.0`).
|
||||
|
||||
## Include What You Use
|
||||
|
||||
You should not depend on symbols being visible to a `*.cpp` module from `#include` statements inside another header file. In other words if your module does `#include "common.h"` and that header does `#include "signal.h"` your module should not assume the sub-include is present. It should instead directly `#include "signal.h"` if it needs any symbol from that header. That makes the actual dependencies much clearer. It also makes it easy to modify the headers included by a specific header file without having to worry that will break any module (or header) that includes a particular header.
|
||||
|
||||
To help enforce this rule the `make lint` (and `make lint-all`) command will run the [include-what-you-use](https://include-what-you-use.org/) tool. You can find the IWYU project on [github](https://github.com/include-what-you-use/include-what-you-use).
|
||||
|
||||
To install the tool on OS X you'll need to add a [formula](https://github.com/jasonmp85/homebrew-iwyu) then install it:
|
||||
|
||||
```
|
||||
brew tap jasonmp85/iwyu
|
||||
brew install iwyu
|
||||
```
|
||||
|
||||
On Ubuntu you can install it via `apt-get`:
|
||||
|
||||
```
|
||||
sudo apt-get install iwyu
|
||||
```
|
||||
|
||||
## Lint Free Code
|
||||
|
||||
Automated analysis tools like cppcheck and oclint can point out potential bugs or code that is extremely hard to understand. They also help ensure the code has a consistent style and that it avoids patterns that tend to confuse people.
|
||||
|
||||
Ultimately we want lint free code. However, at the moment a lot of cleanup is required to reach that goal. For now simply try to avoid introducing new lint.
|
||||
|
||||
To make linting the code easy there are two make targets: `lint` and `lint-all`. The latter does exactly what the name implies. The former will lint any modified but not committed `*.cpp` files. If there is no uncommitted work it will lint the files in the most recent commit.
|
||||
|
||||
Fish has custom cppcheck rules in the file `.cppcheck.rule`. These help catch mistakes such as using `wcwidth()` rather than `fish_wcwidth()`. Please add a new rule if you find similar mistakes being made.
|
||||
|
||||
Fish also depends on `diff` and `expect` for its tests.
|
||||
|
||||
### Dealing With Lint Warnings
|
||||
|
||||
You are strongly encouraged to address a lint warning by refactoring the code, changing variable names, or whatever action is implied by the warning.
|
||||
|
||||
### Suppressing Lint Warnings
|
||||
|
||||
Once in a while the lint tools emit a false positive warning. For example, cppcheck might suggest a memory leak is present when that is not the case. To suppress that cppcheck warning you should insert a line like the following immediately prior to the line cppcheck warned about:
|
||||
|
||||
```
|
||||
// cppcheck-suppress memleak // addr not really leaked
|
||||
```
|
||||
|
||||
The explanatory portion of the suppression comment is optional. For other types of warnings replace "memleak" with the value inside the parenthesis (e.g., "nullPointerRedundantCheck") from a warning like the following:
|
||||
|
||||
```
|
||||
[src/complete.cpp:1727]: warning (nullPointerRedundantCheck): Either the condition 'cmd_node' is redundant or there is possible null pointer dereference: cmd_node.
|
||||
```
|
||||
|
||||
Suppressing oclint warnings is more complicated to describe so I'll refer you to the [OCLint HowTo](http://docs.oclint.org/en/latest/howto/suppress.html#annotations) on the topic.
|
||||
|
||||
## Ensuring Your Changes Conform to the Style Guides
|
||||
|
||||
The following sections discuss the specific rules for the style that should be used when writing fish code. To ensure your changes conform to the style rules you simply need to run
|
||||
|
||||
```
|
||||
make style
|
||||
```
|
||||
|
||||
before committing your change. That will run `git-clang-format` to rewrite only the lines you're modifying.
|
||||
|
||||
If you've already committed your changes that's okay since it will then check the files in the most recent commit. This can be useful after you've merged another person's change and want to check that it's style is acceptable. However, in that case it will run `clang-format` to ensure the entire file, not just the lines modified by the commit, conform to the style.
|
||||
|
||||
If you want to check the style of the entire code base run
|
||||
|
||||
```
|
||||
make style-all
|
||||
```
|
||||
|
||||
That command will refuse to restyle any files if you have uncommitted changes.
|
||||
|
||||
### Configuring Your Editor for Fish C++ Code
|
||||
|
||||
#### ViM
|
||||
|
||||
As of ViM 7.4 it does not recognize triple-slash comments as used by Doxygen and the OS X Xcode IDE to flag comments that explain the following C symbol. This means the `gq` key binding to reformat such comments doesn't behave as expected. You can fix that by adding the following to your vimrc:
|
||||
|
||||
```
|
||||
autocmd Filetype c,cpp setlocal comments^=:///
|
||||
```
|
||||
|
||||
If you use ViM I recommend the [vim-clang-format plugin](https://github.com/rhysd/vim-clang-format) by [@rhysd](https://github.com/rhysd).
|
||||
|
||||
You can also get ViM to provide reasonably correct behavior by installing
|
||||
|
||||
http://www.vim.org/scripts/script.php?script_id=2636
|
||||
|
||||
#### Emacs
|
||||
|
||||
If you use Emacs: TBD
|
||||
|
||||
### Configuring Your Editor for Fish Scripts
|
||||
|
||||
If you use ViM: Install [vim-fish](https://github.com/dag/vim-fish), make sure you have syntax and filetype functionality in `~/.vimrc`:
|
||||
|
||||
```
|
||||
syntax enable
|
||||
filetype plugin indent on
|
||||
```
|
||||
|
||||
Then turn on some options for nicer display of fish scripts in `~/.vim/ftplugin/fish.vim`:
|
||||
|
||||
```
|
||||
" Set up :make to use fish for syntax checking.
|
||||
compiler fish
|
||||
|
||||
" Set this to have long lines wrap inside comments.
|
||||
setlocal textwidth=79
|
||||
|
||||
" Enable folding of block structures in fish.
|
||||
setlocal foldmethod=expr
|
||||
```
|
||||
|
||||
If you use Emacs: Install [fish-mode](https://github.com/wwwjfy/emacs-fish) (also available in melpa and melpa-stable) and `(setq-default indent-tabs-mode nil)` for it (via a hook or in `use-package`s ":init" block). It can also be made to run fish_indent via e.g.
|
||||
|
||||
```elisp
|
||||
(add-hook 'fish-mode-hook (lambda ()
|
||||
(add-hook 'before-save-hook 'fish_indent-before-save)))
|
||||
```
|
||||
|
||||
### Suppressing Reformatting of C++ Code
|
||||
|
||||
If you have a good reason for doing so you can tell `clang-format` to not reformat a block of code by enclosing it in comments like this:
|
||||
|
||||
```
|
||||
// clang-format off
|
||||
code to ignore
|
||||
// clang-format on
|
||||
```
|
||||
|
||||
However, as I write this there are no places in the code where we use this and I can't think of any legitimate reasons for exempting blocks of code from clang-format.
|
||||
|
||||
## Fish Script Style Guide
|
||||
|
||||
1. All fish scripts, such as those in the *share/functions* and *tests* directories, should be formatted using the `fish_indent` command.
|
||||
|
||||
1. Function names should be in all lowercase with words separated by underscores. Private functions should begin with an underscore. The first word should be `fish` if the function is unique to fish.
|
||||
|
||||
1. The first word of global variable names should generally be `fish` for public vars or `_fish` for private vars to minimize the possibility of name clashes with user defined vars.
|
||||
|
||||
## C++ Style Guide
|
||||
|
||||
1. The [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) forms the basis of the fish C++ style guide. There are two major deviations for the fish project. First, a four, rather than two, space indent. Second, line lengths up to 100, rather than 80, characters.
|
||||
|
||||
1. The `clang-format` command is authoritative with respect to indentation, whitespace around operators, etc.
|
||||
|
||||
1. All names in code should be `small_snake_case`. No Hungarian notation is used. The names for classes and structs should be followed by `_t`.
|
||||
|
||||
1. Always attach braces to the surrounding context.
|
||||
|
||||
1. Indent with spaces, not tabs and use four spaces per indent.
|
||||
|
||||
1. Comments should always use the C++ style; i.e., each line of the comment should begin with a `//` and should be limited to 100 characters. Comments that do not begin a line should be separated from the previous text by two spaces.
|
||||
|
||||
1. Comments that document the purpose of a function or class should begin with three slashes, `///`, so that OS X Xcode (and possibly other IDEs) will extract the comment and show it in the "Quick Help" window when the cursor is on the symbol.
|
||||
|
||||
## Testing
|
||||
|
||||
The source code for fish includes a large collection of tests. If you are making any changes to fish, running these tests is mandatory to make sure the behaviour remains consistent and regressions are not introduced. Even if you don't run the tests on your machine, they will still be run via the [Travis CI](https://travis-ci.org/fish-shell/fish-shell) service.
|
||||
|
||||
You are strongly encouraged to add tests when changing the functionality of fish, especially if you are fixing a bug to help ensure there are no regressions in the future (i.e., we don't reintroduce the bug).
|
||||
|
||||
### Local testing
|
||||
|
||||
The tests can be run on your local computer on all operating systems.
|
||||
|
||||
Running the tests is only supported from the autotools build and not xcodebuild. On OS X, you will need to install autoconf — we suggest using [Homebrew](https://brew.sh/) to install these tools.
|
||||
|
||||
```
|
||||
autoconf
|
||||
./configure
|
||||
make test # or "gmake test" on BSD
|
||||
```
|
||||
|
||||
### Travis CI Build and Test
|
||||
|
||||
The Travis Continuous Integration services can be used to test your changes using multiple configurations. This is the same service that the fish-shell project uses to ensure new changes haven't broken anything. Thus it is a really good idea that you leverage Travis CI before making a pull request to avoid potential embarrassment at breaking the build.
|
||||
|
||||
You will need to [fork the fish-shell repository on GitHub](https://help.github.com/articles/fork-a-repo/), then setup Travis to test your changes before making a pull request.
|
||||
|
||||
1. [Sign in to Travis CI](https://travis-ci.org/auth) with your GitHub account, accepting the GitHub access permissions confirmation.
|
||||
1. Once you're signed in and your repositories are synchronized, go to your [profile page](https://travis-ci.org/profile) and enable the fish-shell repository.
|
||||
1. Push your changes to GitHub.
|
||||
|
||||
You'll receive an email when the tests are complete telling you whether or not any tests failed.
|
||||
|
||||
You'll find the configuration used to control Travis in the `.travis.yml` file.
|
||||
|
||||
### Git hooks
|
||||
|
||||
Since developers sometimes forget to run the tests, it can be helpful to use git hooks (see githooks(5)) to automate it.
|
||||
|
||||
One possibility is a pre-push hook script like this one:
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
#### A pre-push hook for the fish-shell project
|
||||
# This will run the tests when a push to master is detected, and will stop that if the tests fail
|
||||
# Save this as .git/hooks/pre-push and make it executable
|
||||
|
||||
protected_branch='master'
|
||||
|
||||
# Git gives us lines like "refs/heads/frombranch SOMESHA1 refs/heads/tobranch SOMESHA1"
|
||||
# We're only interested in the branches
|
||||
while read from _ to _; do
|
||||
if [ "x$to" = "xrefs/heads/$protected_branch" ]; then
|
||||
isprotected=1
|
||||
fi
|
||||
done
|
||||
if [ "x$isprotected" = x1 ]; then
|
||||
echo "Running tests before push to master"
|
||||
make test
|
||||
RESULT=$?
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
echo "Tests failed for a push to master, we can't let you do that" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
```
|
||||
|
||||
This will check if the push is to the master branch and, if it is, only allow the push if running `make test` succeeds. In some circumstances it may be advisable to circumvent this check with `git push --no-verify`, but usually that isn't necessary.
|
||||
|
||||
To install the hook, place the code in a new file `.git/hooks/pre-push` and make it executable.
|
||||
|
||||
### Coverity Scan
|
||||
|
||||
We use Coverity's static analysis tool which offers free access to open source projects. While access to the tool itself is restricted, fish-shell organization members should know that they can login [here](https://scan.coverity.com/projects/fish-shell-fish-shell?tab=overview) with their GitHub account. Currently, tests are triggered upon merging the `master` branch into `coverity_scan_master`. Even if you are not a fish developer, you can keep an eye on our statistics there.
|
||||
|
||||
## Installing the Required Tools
|
||||
|
||||
### Installing the Linting Tools
|
||||
|
||||
To install the lint checkers on Mac OS X using Homebrew:
|
||||
|
||||
```
|
||||
brew tap oclint/formulae
|
||||
brew install oclint
|
||||
brew install cppcheck
|
||||
```
|
||||
|
||||
To install the lint checkers on Debian-based Linux distributions:
|
||||
|
||||
```
|
||||
sudo apt-get install clang
|
||||
sudo apt-get install oclint
|
||||
sudo apt-get install cppcheck
|
||||
```
|
||||
|
||||
### Installing the Reformatting Tools
|
||||
|
||||
Mac OS X:
|
||||
|
||||
```
|
||||
brew install clang-format
|
||||
```
|
||||
|
||||
Debian-based:
|
||||
|
||||
```
|
||||
apt-cache search clang-format
|
||||
```
|
||||
|
||||
Above will list all the versions available. Pick the newest one available (3.9 for Ubuntu 16.10 as I write this) and install it:
|
||||
|
||||
```
|
||||
sudo apt-get install clang-format-3.9
|
||||
sudo ln -s /usr/bin/clang-format-3.9 /usr/bin/clang-format
|
||||
```
|
||||
|
||||
## Message Translations
|
||||
|
||||
Fish uses the GNU gettext library to translate messages from English to other languages. To create or update a translation run `make po/[LANGUAGE CODE].po` where `LANGUAGE CODE` is the two letter ISO 639-1 language code of the language you are translating to (e.g. `de` for German). Make sure that you have the `xgettext`, `msgfmt` and `msgmerge` commands installed in order to do this.
|
||||
|
||||
All messages in fish script must be enclosed in single or double quote characters. They must also be translated via a subcommand. This means that the following are **not** valid:
|
||||
|
||||
```
|
||||
echo (_ hello)
|
||||
_ "goodbye"
|
||||
```
|
||||
|
||||
Above should be written like this instead:
|
||||
|
||||
```
|
||||
echo (_ "hello")
|
||||
echo (_ "goodbye")
|
||||
```
|
||||
|
||||
Note that you can use either single or double quotes to enclose the message to be translated. You can also optionally include spaces after the opening parentheses and once again before the closing parentheses.
|
||||
|
||||
Be cautious about blindly updating an existing translation file. Trivial changes to an existing message (e.g., changing the punctuation) will cause existing translations to be removed, since the tools do literal string matching. Therefore, in general, you need to carefully review any recommended deletions.
|
||||
|
||||
Read the [translations wiki](https://github.com/fish-shell/fish-shell/wiki/Translations) for more information.
|
||||
377
CONTRIBUTING.rst
377
CONTRIBUTING.rst
@@ -1,377 +0,0 @@
|
||||
####################
|
||||
Contributing To Fish
|
||||
####################
|
||||
|
||||
This document tells you how you can contribute to fish.
|
||||
|
||||
Fish is free and open source software, distributed under the terms of the GPLv2.
|
||||
|
||||
Contributions are welcome, and there are many ways to contribute!
|
||||
|
||||
Whether you want to change some of the core Rust source, enhance or add a completion script or function,
|
||||
improve the documentation or translate something, this document will tell you how.
|
||||
|
||||
Getting Set Up
|
||||
==============
|
||||
|
||||
Fish is developed on Github, at https://github.com/fish-shell/fish-shell.
|
||||
|
||||
First, you'll need an account there, and you'll need a git clone of fish.
|
||||
Fork it on Github and then run::
|
||||
|
||||
git clone https://github.com/<USERNAME>/fish-shell.git
|
||||
|
||||
This will create a copy of the fish repository in the directory fish-shell in your current working directory.
|
||||
|
||||
Also, for most changes you want to run the tests and so you'd get a setup to compile fish.
|
||||
For that, you'll require:
|
||||
|
||||
- Rust - when in doubt, try rustup
|
||||
- CMake
|
||||
- PCRE2 (headers and libraries) - optional, this will be downloaded if missing
|
||||
- gettext (headers and libraries) - optional, for translation support
|
||||
- Sphinx - optional, to build the documentation
|
||||
|
||||
Of course not everything is required always - if you just want to contribute something to the documentation you'll just need Sphinx,
|
||||
and if the change is very simple and obvious you can just send it in. Use your judgement!
|
||||
|
||||
Once you have your changes, open a pull request on https://github.com/fish-shell/fish-shell/pulls.
|
||||
|
||||
Guidelines
|
||||
==========
|
||||
|
||||
In short:
|
||||
|
||||
- Be conservative in what you need (keep to the agreed minimum supported Rust version, limit new dependencies)
|
||||
- Use automated tools to help you (including ``make fish_run_tests`` and ``build_tools/style.fish``)
|
||||
|
||||
Contributing completions
|
||||
========================
|
||||
|
||||
Completion scripts are the most common contribution to fish, and they are very welcome.
|
||||
|
||||
In general, we'll take all well-written completion scripts for a command that is publicly available.
|
||||
This means no private tools or personal scripts, and we do reserve the right to reject for other reasons.
|
||||
|
||||
Before you try to contribute them to fish, consider if the authors of the tool you are completing want to maintain the script instead.
|
||||
Often that makes more sense, specifically because they can add new options to the script immediately once they add them,
|
||||
and don't have to maintain one completion script for multiple versions. If the authors no longer wish to maintain the script,
|
||||
they can of course always contact the fish maintainers to hand it over, preferably by opening a PR.
|
||||
This isn't a requirement - if the authors don't want to maintain it, or you simply don't want to contact them,
|
||||
you can contribute your script to fish.
|
||||
|
||||
Completion scripts should
|
||||
|
||||
1. Use as few dependencies as possible - try to use fish's builtins like ``string`` instead of ``grep`` and ``awk``,
|
||||
use ``python`` to read json instead of ``jq`` (because it's already a soft dependency for fish's tools)
|
||||
2. If it uses a common unix tool, use posix-compatible invocations - ideally it would work on GNU/Linux, macOS, the BSDs and other systems
|
||||
3. Option and argument descriptions should be kept short.
|
||||
The shorter the description, the more likely it is that fish can use more columns.
|
||||
4. Function names should start with ``__fish``, and functions should be kept in the completion file unless they're used elsewhere.
|
||||
5. Run ``fish_indent`` on your script.
|
||||
6. Try not to use minor convenience features right after they are available in fish - we do try to keep completion scripts backportable.
|
||||
If something has a real impact on the correctness or performance, feel free to use it,
|
||||
but if it is just a shortcut, please leave it.
|
||||
|
||||
Put your completion script into share/completions/name-of-command.fish. If you have multiple commands, you need multiple files.
|
||||
|
||||
If you want to add tests, you probably want to add a littlecheck test. See below for details.
|
||||
|
||||
Contributing documentation
|
||||
==========================
|
||||
|
||||
The documentation is stored in ``doc_src/``, and written in ReStructured Text and built with Sphinx.
|
||||
|
||||
To build it locally, run from the main fish-shell directory::
|
||||
|
||||
sphinx-build -j 8 -b html -n doc_src/ /tmp/fish-doc/
|
||||
|
||||
which will build the docs as html in /tmp/fish-doc. You can open it in a browser and see that it looks okay.
|
||||
|
||||
The builtins and various functions shipped with fish are documented in doc_src/cmds/.
|
||||
|
||||
Code Style
|
||||
==========
|
||||
|
||||
To ensure your changes conform to the style rules run
|
||||
|
||||
::
|
||||
|
||||
build_tools/style.fish
|
||||
|
||||
before committing your change. That will run our autoformatters:
|
||||
|
||||
- ``rustfmt`` for Rust
|
||||
- ``fish_indent`` (shipped with fish) for fish script
|
||||
- ``black`` for python
|
||||
|
||||
If you’ve already committed your changes that’s okay since it will then
|
||||
check the files in the most recent commit. This can be useful after
|
||||
you’ve merged another person’s change and want to check that it’s style
|
||||
is acceptable. However, in that case it will run ``clang-format`` to
|
||||
ensure the entire file, not just the lines modified by the commit,
|
||||
conform to the style.
|
||||
|
||||
If you want to check the style of the entire code base run
|
||||
|
||||
::
|
||||
|
||||
build_tools/style.fish --all
|
||||
|
||||
That command will refuse to restyle any files if you have uncommitted
|
||||
changes.
|
||||
|
||||
Fish Script Style Guide
|
||||
-----------------------
|
||||
|
||||
1. All fish scripts, such as those in the *share/functions* and *tests*
|
||||
directories, should be formatted using the ``fish_indent`` command.
|
||||
|
||||
2. Function names should be in all lowercase with words separated by
|
||||
underscores. Private functions should begin with an underscore. The
|
||||
first word should be ``fish`` if the function is unique to fish.
|
||||
|
||||
3. The first word of global variable names should generally be ``fish``
|
||||
for public vars or ``_fish`` for private vars to minimize the
|
||||
possibility of name clashes with user defined vars.
|
||||
|
||||
Configuring Your Editor for Fish Scripts
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you use Vim: Install `vim-fish <https://github.com/dag/vim-fish>`__,
|
||||
make sure you have syntax and filetype functionality in ``~/.vimrc``:
|
||||
|
||||
::
|
||||
|
||||
syntax enable
|
||||
filetype plugin indent on
|
||||
|
||||
Then turn on some options for nicer display of fish scripts in
|
||||
``~/.vim/ftplugin/fish.vim``:
|
||||
|
||||
::
|
||||
|
||||
" Set up :make to use fish for syntax checking.
|
||||
compiler fish
|
||||
|
||||
" Set this to have long lines wrap inside comments.
|
||||
setlocal textwidth=79
|
||||
|
||||
" Enable folding of block structures in fish.
|
||||
setlocal foldmethod=expr
|
||||
|
||||
If you use Emacs: Install
|
||||
`fish-mode <https://github.com/wwwjfy/emacs-fish>`__ (also available in
|
||||
melpa and melpa-stable) and ``(setq-default indent-tabs-mode nil)`` for
|
||||
it (via a hook or in ``use-package``\ s “:init” block). It can also be
|
||||
made to run fish_indent via e.g.
|
||||
|
||||
.. code:: elisp
|
||||
|
||||
(add-hook 'fish-mode-hook (lambda ()
|
||||
(add-hook 'before-save-hook 'fish_indent-before-save)))
|
||||
|
||||
Rust Style Guide
|
||||
----------------
|
||||
|
||||
Use ``cargo fmt`` and ``cargo clippy``. Clippy warnings can be turned off if there's a good reason to.
|
||||
|
||||
Testing
|
||||
=======
|
||||
|
||||
The source code for fish includes a large collection of tests. If you
|
||||
are making any changes to fish, running these tests is a good way to make
|
||||
sure the behaviour remains consistent and regressions are not
|
||||
introduced. Even if you don’t run the tests on your machine, they will
|
||||
still be run via Github Actions.
|
||||
|
||||
You are strongly encouraged to add tests when changing the functionality
|
||||
of fish, especially if you are fixing a bug to help ensure there are no
|
||||
regressions in the future (i.e., we don’t reintroduce the bug).
|
||||
|
||||
The tests can be found in three places:
|
||||
|
||||
- src/tests for unit tests.
|
||||
- tests/checks for script tests, run by `littlecheck <https://github.com/ridiculousfish/littlecheck>`__
|
||||
- tests/pexpects for interactive tests using `pexpect <https://pexpect.readthedocs.io/en/stable/>`__
|
||||
|
||||
When in doubt, the bulk of the tests should be added as a littlecheck test in tests/checks, as they are the easiest to modify and run, and much faster and more dependable than pexpect tests. The syntax is fairly self-explanatory. It's a fish script with the expected output in ``# CHECK:`` or ``# CHECKERR:`` (for stderr) comments.
|
||||
If your littlecheck test has a specific dependency, use ``# REQUIRE: ...`` with a posix sh script.
|
||||
|
||||
The pexpects are written in python and can simulate input and output to/from a terminal, so they are needed for anything that needs actual interactivity. The runner is in tests/pexpect_helper.py, in case you need to modify something there.
|
||||
|
||||
These tests can be run via the tests/test_driver.py python script, which will set up the environment.
|
||||
It sets up a temporary $HOME and also uses it as the current directory, so you do not need to create a temporary directory in them.
|
||||
|
||||
If you need a command to do something weird to test something, maybe add it to the ``fish_test_helper`` binary (in tests/fish_test_helper.c), or see if it can already do it.
|
||||
|
||||
Local testing
|
||||
-------------
|
||||
|
||||
The tests can be run on your local computer on all operating systems.
|
||||
|
||||
::
|
||||
|
||||
cmake path/to/fish-shell
|
||||
make fish_run_tests
|
||||
|
||||
Or you can run them on a fish, without involving cmake::
|
||||
|
||||
cargo build
|
||||
cargo test # for the unit tests
|
||||
tests/test_driver.py --cachedir=/tmp target/debug # for the script and interactive tests
|
||||
|
||||
Here, the first argument to test_driver.py refers to a directory with ``fish``, ``fish_indent`` and ``fish_key_reader`` in it.
|
||||
In this example we're in the root of the git repo and have run ``cargo build`` without ``--release``, so it's a debug build.
|
||||
The ``--cachedir /tmp`` argument means it will keep the fish_test_helper binary in /tmp instead of recompiling it for every test.
|
||||
This saves some time, but isn't strictly necessary.
|
||||
|
||||
Git hooks
|
||||
---------
|
||||
|
||||
Since developers sometimes forget to run the tests, it can be helpful to
|
||||
use git hooks (see githooks(5)) to automate it.
|
||||
|
||||
One possibility is a pre-push hook script like this one:
|
||||
|
||||
.. code:: sh
|
||||
|
||||
#!/bin/sh
|
||||
#### A pre-push hook for the fish-shell project
|
||||
# This will run the tests when a push to master is detected, and will stop that if the tests fail
|
||||
# Save this as .git/hooks/pre-push and make it executable
|
||||
|
||||
protected_branch='master'
|
||||
|
||||
# Git gives us lines like "refs/heads/frombranch SOMESHA1 refs/heads/tobranch SOMESHA1"
|
||||
# We're only interested in the branches
|
||||
while read from _ to _; do
|
||||
if [ "x$to" = "xrefs/heads/$protected_branch" ]; then
|
||||
isprotected=1
|
||||
fi
|
||||
done
|
||||
if [ "x$isprotected" = x1 ]; then
|
||||
echo "Running tests before push to master"
|
||||
make fish_run_tests
|
||||
RESULT=$?
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
echo "Tests failed for a push to master, we can't let you do that" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
||||
This will check if the push is to the master branch and, if it is, only
|
||||
allow the push if running ``make fish_run_tests`` succeeds. In some circumstances
|
||||
it may be advisable to circumvent this check with
|
||||
``git push --no-verify``, but usually that isn’t necessary.
|
||||
|
||||
To install the hook, place the code in a new file
|
||||
``.git/hooks/pre-push`` and make it executable.
|
||||
|
||||
Coverity Scan
|
||||
-------------
|
||||
|
||||
We use Coverity’s static analysis tool which offers free access to open
|
||||
source projects. While access to the tool itself is restricted,
|
||||
fish-shell organization members should know that they can login
|
||||
`here <https://scan.coverity.com/projects/fish-shell-fish-shell?tab=overview>`__
|
||||
with their GitHub account. Currently, tests are triggered upon merging
|
||||
the ``master`` branch into ``coverity_scan_master``. Even if you are not
|
||||
a fish developer, you can keep an eye on our statistics there.
|
||||
|
||||
Contributing Translations
|
||||
=========================
|
||||
|
||||
Fish uses the GNU gettext library to translate messages from English to
|
||||
other languages.
|
||||
|
||||
Creating and updating translations requires the Gettext tools, including
|
||||
``xgettext``, ``msgfmt`` and ``msgmerge``. Translation sources are
|
||||
stored in the ``po`` directory, named ``LANG.po``, where ``LANG`` is the
|
||||
two letter ISO 639-1 language code of the target language (eg ``de`` for
|
||||
German).
|
||||
|
||||
To create a new translation:
|
||||
|
||||
* generate a ``messages.pot`` file by running ``build_tools/fish_xgettext.fish`` from
|
||||
the source tree
|
||||
* copy ``messages.pot`` to ``po/LANG.po``
|
||||
|
||||
To update a translation:
|
||||
|
||||
* generate a ``messages.pot`` file by running
|
||||
``build_tools/fish_xgettext.fish`` from the source tree
|
||||
|
||||
* update the existing translation by running
|
||||
``msgmerge --update --no-fuzzy-matching po/LANG.po messages.pot``
|
||||
|
||||
The ``--no-fuzzy-matching`` is important as we have had terrible experiences with gettext's "fuzzy" translations in the past.
|
||||
|
||||
Many tools are available for editing translation files, including
|
||||
command-line and graphical user interface programs. For simple use, you can just use your text editor.
|
||||
|
||||
Open up the po file, for example ``po/sv.po``, and you'll see something like::
|
||||
|
||||
msgid "%ls: No suitable job\n"
|
||||
msgstr ""
|
||||
|
||||
The ``msgid`` here is the "name" of the string to translate, typically the english string to translate. The second line (``msgstr``) is where your translation goes.
|
||||
|
||||
For example::
|
||||
|
||||
msgid "%ls: No suitable job\n"
|
||||
msgstr "%ls: Inget passande jobb\n"
|
||||
|
||||
Any ``%s`` / ``%ls`` or ``%d`` are placeholders that fish will use for formatting at runtime. It is important that they match - the translated string should have the same placeholders in the same order.
|
||||
|
||||
Also any escaped characters, like that ``\n`` newline at the end, should be kept so the translation has the same behavior.
|
||||
|
||||
Our tests run ``msgfmt --check-format /path/to/file``, so they would catch mismatched placeholders - otherwise fish would crash at runtime when the string is about to be used.
|
||||
|
||||
Be cautious about blindly updating an existing translation file. Trivial
|
||||
changes to an existing message (eg changing the punctuation) will cause
|
||||
existing translations to be removed, since the tools do literal string
|
||||
matching. Therefore, in general, you need to carefully review any
|
||||
recommended deletions.
|
||||
|
||||
Setting Code Up For Translations
|
||||
--------------------------------
|
||||
|
||||
All non-debug messages output for user consumption should be marked for
|
||||
translation. In Rust, this requires the use of the ``wgettext!`` or ``wgettext_fmt!``
|
||||
macros:
|
||||
|
||||
::
|
||||
|
||||
streams.out.append(wgettext_fmt!("%ls: There are no jobs\n", argv[0]));
|
||||
|
||||
All messages in fish script must be enclosed in single or double quote
|
||||
characters for our message extraction script to find them.
|
||||
They must also be translated via a command substitution. This means
|
||||
that the following are **not** valid:
|
||||
|
||||
::
|
||||
|
||||
echo (_ hello)
|
||||
_ "goodbye"
|
||||
|
||||
Above should be written like this instead:
|
||||
|
||||
::
|
||||
|
||||
echo (_ "hello")
|
||||
echo (_ "goodbye")
|
||||
|
||||
You can use either single or double quotes to enclose the
|
||||
message to be translated. You can also optionally include spaces after
|
||||
the opening parentheses or before the closing parentheses.
|
||||
|
||||
Versioning
|
||||
==========
|
||||
|
||||
The fish version is constructed by the *build_tools/git_version_gen.sh*
|
||||
script. For developers the version is the branch name plus the output of
|
||||
``git describe --always --dirty``. Normally the main part of the version
|
||||
will be the closest annotated tag. Which itself is usually the most
|
||||
recent release number (e.g., ``2.6.0``).
|
||||
7
COPYING
7
COPYING
@@ -1,7 +1,6 @@
|
||||
Fish is a smart and user-friendly command line shell.
|
||||
|
||||
Copyright (C) 2005-2009 Axel Liljencrantz
|
||||
Copyright (C) 2009- fish-shell contributors
|
||||
|
||||
fish is free software.
|
||||
|
||||
@@ -9,10 +8,10 @@ Most of fish is licensed under the GNU General Public License version 2, and
|
||||
you can redistribute it and/or modify it under the terms of the GNU GPL as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
fish also includes software licensed under the Python Software Foundation License version 2, the MIT
|
||||
license, and the GNU Library General Public License version 2.
|
||||
fish also includes software licensed under the GNU Lesser General Public
|
||||
License version 2, the OpenBSD license, the ISC license, and the NetBSD license.
|
||||
|
||||
Full licensing information is contained in doc_src/license.rst.
|
||||
Full licensing information is contained in doc_src/license.hdr.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
|
||||
666
Cargo.lock
generated
666
Cargo.lock
generated
@@ -1,666 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "allocator-api2"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"libc",
|
||||
"shlex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "cfg_aliases"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"block-buffer",
|
||||
"crypto-common",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "equivalent"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fish"
|
||||
version = "4.1.0-alpha0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
"errno",
|
||||
"fish-printf",
|
||||
"libc",
|
||||
"lru",
|
||||
"nix",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
"pcre2",
|
||||
"portable-atomic",
|
||||
"rand",
|
||||
"rsconf",
|
||||
"rust-embed",
|
||||
"serial_test",
|
||||
"terminfo",
|
||||
"unix_path",
|
||||
"widestring",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fish-printf"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"widestring",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||
|
||||
[[package]]
|
||||
name = "foldhash"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f"
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.15.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||
dependencies = [
|
||||
"allocator-api2",
|
||||
"equivalent",
|
||||
"foldhash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
version = "0.1.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.169"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
|
||||
[[package]]
|
||||
name = "lru"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465"
|
||||
dependencies = [
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "minimal-lexical"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.29.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
"cfg_aliases",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.20.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.9.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pcre2"
|
||||
version = "0.2.9"
|
||||
source = "git+https://github.com/fish-shell/rust-pcre2?tag=0.2.9-utf32#85b7afba1a9d9bd445779800e5bcafeb732e4421"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"pcre2-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pcre2-sys"
|
||||
version = "0.2.9"
|
||||
source = "git+https://github.com/fish-shell/rust-pcre2?tag=0.2.9-utf32#85b7afba1a9d9bd445779800e5bcafeb732e4421"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
|
||||
dependencies = [
|
||||
"phf_shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_codegen"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
|
||||
dependencies = [
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
|
||||
dependencies = [
|
||||
"phf_shared",
|
||||
"rand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
|
||||
dependencies = [
|
||||
"siphasher",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
|
||||
|
||||
[[package]]
|
||||
name = "portable-atomic"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
dependencies = [
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.5.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rsconf"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd2af859f1af0401e7fc7577739c87b0d239d8a5da400d717183bca92336bcdc"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust-embed"
|
||||
version = "8.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa66af4a4fdd5e7ebc276f115e895611a34739a9c1c01028383d612d550953c0"
|
||||
dependencies = [
|
||||
"rust-embed-impl",
|
||||
"rust-embed-utils",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust-embed-impl"
|
||||
version = "8.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6125dbc8867951125eec87294137f4e9c2c96566e61bf72c45095a7c77761478"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rust-embed-utils",
|
||||
"syn",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust-embed-utils"
|
||||
version = "8.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e5347777e9aacb56039b0e1f28785929a8a3b709e87482e7442c72e7c12529d"
|
||||
dependencies = [
|
||||
"sha2",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scc"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28e1c91382686d21b5ac7959341fcb9780fa7c03773646995a87c950fa7be640"
|
||||
dependencies = [
|
||||
"sdd",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "sdd"
|
||||
version = "3.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "478f121bb72bbf63c52c93011ea1791dca40140dfe13f8336c4c5ac952c33aa9"
|
||||
|
||||
[[package]]
|
||||
name = "serial_test"
|
||||
version = "3.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"scc",
|
||||
"serial_test_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serial_test_derive"
|
||||
version = "3.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.95"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "terminfo"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662"
|
||||
dependencies = [
|
||||
"fnv",
|
||||
"nom",
|
||||
"phf",
|
||||
"phf_codegen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
||||
|
||||
[[package]]
|
||||
name = "unix_path"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af8e291873ae77c4c8d9c9b34d0bee68a35b048fb39c263a5155e0e353783eaf"
|
||||
dependencies = [
|
||||
"unix_str",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unix_str"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2ace0b4755d0a2959962769239d56267f8a024fef2d9b32666b3dcd0946b0906"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
|
||||
dependencies = [
|
||||
"same-file",
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "widestring"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-util"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.59.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
||||
dependencies = [
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
115
Cargo.toml
115
Cargo.toml
@@ -1,115 +0,0 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["printf"]
|
||||
|
||||
[workspace.package]
|
||||
# To build revisions that use Corrosion (those before 2024-01), use CMake 3.19, Rustc 1.78 and Rustup 1.27.
|
||||
rust-version = "1.70"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
overflow-checks = true
|
||||
lto = true
|
||||
|
||||
[profile.release-with-debug]
|
||||
inherits = "release"
|
||||
debug = true
|
||||
|
||||
[package]
|
||||
name = "fish"
|
||||
version = "4.1.0-alpha0"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
default-run = "fish"
|
||||
# see doc_src/license.rst for details
|
||||
# don't forget to update COPYING and debian/copyright too
|
||||
license = "GPL-2.0-only AND LGPL-2.0-or-later AND MIT AND PSF-2.0"
|
||||
repository = "https://github.com/fish-shell/fish-shell"
|
||||
homepage = "https://fishshell.com"
|
||||
readme = "README.rst"
|
||||
|
||||
[dependencies]
|
||||
pcre2 = { git = "https://github.com/fish-shell/rust-pcre2", tag = "0.2.9-utf32", default-features = false, features = [
|
||||
"utf32",
|
||||
] }
|
||||
|
||||
bitflags = "2.5.0"
|
||||
errno = "0.3.0"
|
||||
libc = "0.2"
|
||||
# lru pulls in hashbrown by default, which uses a faster (though less DoS resistant) hashing algo.
|
||||
# disabling default features uses the stdlib instead, but it doubles the time to rewrite the history
|
||||
# files as of 22 April 2024.
|
||||
lru = "0.13.0"
|
||||
nix = { version = "0.29.0", default-features = false, features = [
|
||||
"event",
|
||||
"inotify",
|
||||
"resource",
|
||||
"fs",
|
||||
] }
|
||||
num-traits = "0.2.19"
|
||||
once_cell = "1.19.0"
|
||||
fish-printf = { path = "./printf", features = ["widestring"] }
|
||||
|
||||
# Don't use the "getrandom" feature as it requires "getentropy" which was not
|
||||
# available on macOS < 10.12. We can enable "getrandom" when we raise the
|
||||
# minimum supported version to 10.12.
|
||||
rand = { version = "0.8.5", default-features = false, features = ["small_rng"] }
|
||||
widestring = "1.2.0"
|
||||
# We need 0.9.0 specifically for some crash fixes.
|
||||
terminfo = "0.9.0"
|
||||
rust-embed = { version = "8.2.0", optional = true }
|
||||
|
||||
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
|
||||
portable-atomic = { version = "1", default-features = false, features = [
|
||||
"fallback",
|
||||
] }
|
||||
|
||||
[dev-dependencies]
|
||||
serial_test = { version = "3", default-features = false }
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.0.94"
|
||||
rsconf = "0.2.2"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
unix_path = "1.0.1"
|
||||
|
||||
[lib]
|
||||
crate-type = ["rlib"]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "fish"
|
||||
path = "src/bin/fish.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "fish_indent"
|
||||
path = "src/bin/fish_indent.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "fish_key_reader"
|
||||
path = "src/bin/fish_key_reader.rs"
|
||||
|
||||
[features]
|
||||
default = ["embed-data"]
|
||||
benchmark = []
|
||||
embed-data = ["dep:rust-embed"]
|
||||
|
||||
# The following features are auto-detected by the build-script and should not be enabled manually.
|
||||
asan = []
|
||||
tsan = []
|
||||
|
||||
[lints]
|
||||
rust.non_camel_case_types = "allow"
|
||||
rust.non_upper_case_globals = "allow"
|
||||
rust.unknown_lints = "allow"
|
||||
rust.unstable_name_collisions = "allow"
|
||||
clippy.manual_range_contains = "allow"
|
||||
clippy.needless_return = "allow"
|
||||
clippy.needless_lifetimes = "allow"
|
||||
|
||||
# We do not want to use the e?print(ln)?! macros.
|
||||
# These lints flag their use.
|
||||
# In the future, they might change to flag other methods of printing.
|
||||
clippy.print_stdout = "deny"
|
||||
clippy.print_stderr = "deny"
|
||||
@@ -2,8 +2,7 @@ FROM centos:latest
|
||||
|
||||
# Build dependency
|
||||
RUN yum update -y &&\
|
||||
yum install -y epel-release &&\
|
||||
yum install -y clang cmake3 gcc-c++ make &&\
|
||||
yum install -y autoconf automake bc clang gcc-c++ make ncurses-devel &&\
|
||||
yum clean all
|
||||
|
||||
# Test dependency
|
||||
@@ -13,6 +12,8 @@ ADD . /src
|
||||
WORKDIR /src
|
||||
|
||||
# Build fish
|
||||
RUN cmake3 . &&\
|
||||
RUN autoreconf &&\
|
||||
./configure &&\
|
||||
make &&\
|
||||
make install
|
||||
|
||||
|
||||
2357
Doxyfile.help
Normal file
2357
Doxyfile.help
Normal file
File diff suppressed because it is too large
Load Diff
2357
Doxyfile.user
Normal file
2357
Doxyfile.user
Normal file
File diff suppressed because it is too large
Load Diff
76
GNUmakefile
76
GNUmakefile
@@ -1,76 +0,0 @@
|
||||
# This is a very basic `make` wrapper around the CMake build toolchain.
|
||||
#
|
||||
# Supported arguments:
|
||||
# PREFIX: sets the installation prefix
|
||||
# GENERATOR: explicitly specifies the CMake generator to use
|
||||
|
||||
CMAKE ?= cmake
|
||||
|
||||
GENERATOR ?= $(shell (which ninja > /dev/null 2> /dev/null && echo Ninja) || \
|
||||
echo 'Unix Makefiles')
|
||||
prefix ?= /usr/local
|
||||
PREFIX ?= $(prefix)
|
||||
|
||||
ifeq ($(GENERATOR), Ninja)
|
||||
BUILDFILE = build.ninja
|
||||
else
|
||||
BUILDFILE = Makefile
|
||||
endif
|
||||
|
||||
|
||||
# If CMake has generated an in-tree Makefile, use that instead (issue #6264)
|
||||
MAKE_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
ifeq ($(shell test -f $(MAKE_DIR)/Makefile && echo 1), 1)
|
||||
|
||||
all:
|
||||
@+$(MAKE) -f $(MAKE_DIR)/Makefile $(MAKECMDGOALS) --no-print-directory
|
||||
%:
|
||||
@+$(MAKE) -f $(MAKE_DIR)/Makefile $(MAKECMDGOALS) --no-print-directory
|
||||
|
||||
else
|
||||
|
||||
all: .begin build/fish
|
||||
|
||||
.PHONY: .begin
|
||||
.begin:
|
||||
@which $(CMAKE) > /dev/null 2> /dev/null || \
|
||||
(echo 'Please install CMake and then re-run the `make` command!' 1>&2 && false)
|
||||
|
||||
.PHONY: build/fish
|
||||
build/fish: build/$(BUILDFILE)
|
||||
$(CMAKE) --build build
|
||||
|
||||
# Use build as an order-only dependency. This prevents the target from always being outdated
|
||||
# after a make run, and more importantly, doesn't clobber manually specified CMake options.
|
||||
build/$(BUILDFILE): | build
|
||||
cd build; $(CMAKE) .. -G "$(GENERATOR)" \
|
||||
-DCMAKE_INSTALL_PREFIX="$(PREFIX)" -DCMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
|
||||
build:
|
||||
mkdir -p build
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
.PHONY: test
|
||||
test: build/fish
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: fish_run_tests
|
||||
fish_run_tests: build/fish
|
||||
$(CMAKE) --build build --target fish_run_tests
|
||||
|
||||
.PHONY: install
|
||||
install: build/fish
|
||||
$(CMAKE) --build build --target install
|
||||
|
||||
.PHONY: run
|
||||
run: build/fish
|
||||
./build/fish || true
|
||||
|
||||
.PHONY: exec
|
||||
exec: build/fish
|
||||
exec ./build/fish
|
||||
|
||||
endif # CMake in-tree build check
|
||||
1223
Makefile.in
Normal file
1223
Makefile.in
Normal file
File diff suppressed because it is too large
Load Diff
164
README.md
Normal file
164
README.md
Normal file
@@ -0,0 +1,164 @@
|
||||
[fish](https://fishshell.com/) - the friendly interactive shell [](https://travis-ci.org/fish-shell/fish-shell)
|
||||
================================================
|
||||
|
||||
fish is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family.
|
||||
fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions
|
||||
that just work, with no configuration required.
|
||||
|
||||
For more on fish's design philosophy, see the [design document](https://fishshell.com/docs/current/design.html).
|
||||
|
||||
## Quick Start
|
||||
|
||||
fish generally works like other shells, like bash or zsh. A few important differences can be found at <https://fishshell.com/docs/current/tutorial.html> by searching for the magic phrase "unlike other shells".
|
||||
|
||||
Detailed user documentation is available by running `help` within fish, and also at <https://fishshell.com/docs/current/index.html>
|
||||
|
||||
You can quickly play with fish right in your browser by clicking the button below:
|
||||
|
||||
[](https://rootnroll.com/d/fish-shell/)
|
||||
|
||||
## Getting fish
|
||||
|
||||
### macOS
|
||||
|
||||
fish can be installed:
|
||||
|
||||
* using [Homebrew](http://brew.sh/): `brew install fish`
|
||||
* using [MacPorts](https://www.macports.org/): `sudo port install fish`
|
||||
* using the [installer from fishshell.com](https://fishshell.com/)
|
||||
* as a [standalone app from fishshell.com](https://fishshell.com/)
|
||||
|
||||
### Packages for Linux
|
||||
|
||||
Packages for Debian, Fedora, openSUSE, and Red Hat Enterprise Linux/CentOS are available from the
|
||||
[openSUSE Build
|
||||
Service](https://software.opensuse.org/download.html?project=shells%3Afish%3Arelease%3A2&package=fish).
|
||||
|
||||
Packages for Ubuntu are available from the [fish
|
||||
PPA](https://launchpad.net/~fish-shell/+archive/ubuntu/release-2), and can be installed using the
|
||||
following commands:
|
||||
|
||||
```
|
||||
sudo apt-add-repository ppa:fish-shell/release-2
|
||||
sudo apt-get update
|
||||
sudo apt-get install fish
|
||||
```
|
||||
|
||||
Instructions for other distributions may be found at [fishshell.com](https://fishshell.com).
|
||||
|
||||
### Windows
|
||||
|
||||
- On Windows 10, fish can be installed under the WSL Windows Subsystem for Linux with `sudo apt install fish` or from source with the instructions below.
|
||||
- Fish can also be installed on all versions of Windows using [Cygwin](https://cygwin.com/) (from the **Shells** category).
|
||||
|
||||
### Building from source
|
||||
|
||||
If packages are not available for your platform, GPG-signed tarballs are available from
|
||||
[fishshell.com](https://fishshell.com/) and [fish-shell on
|
||||
GitHub](https://github.com/fish-shell/fish-shell/releases). See the *Building* section for instructions.
|
||||
|
||||
## Running fish
|
||||
|
||||
Once installed, run `fish` from your current shell to try fish out!
|
||||
|
||||
### Dependencies
|
||||
|
||||
Running fish requires:
|
||||
|
||||
* curses or ncurses (preinstalled on most \*nix systems)
|
||||
* some common \*nix system utilities (currently `mktemp` and `seq`), in addition to the basic POSIX utilities
|
||||
* gettext (library and `gettext` command), if compiled with translation support
|
||||
|
||||
The following optional features also have specific requirements:
|
||||
|
||||
* builtin commands that have the `--help` option or print usage messages require `nroff` and `ul`
|
||||
* automated completion generation from manual pages requires Python (2.7+ or 3.3+) and possibly the
|
||||
`backports.lzma` module for Python 2.7
|
||||
* the `fish_config` web configuration tool requires Python (2.7+ or 3.3 +) and a web browser
|
||||
* system clipboard integration (with the default Ctrl-V and Ctrl-X bindings) require either the
|
||||
`xsel` or `pbcopy`/`pbpaste` utilities
|
||||
* full completions for `yarn` and `bower` require the `jq` utility
|
||||
* full completions for `yarn` and `npm` require the `all-the-package-names` NPM module
|
||||
|
||||
### Switching to fish
|
||||
|
||||
If you wish to use fish as your default shell, use the following command:
|
||||
|
||||
chsh -s /usr/local/bin/fish
|
||||
|
||||
`chsh` will prompt you for your password and change your default shell. (Substitute `/usr/local/bin/fish` with whatever path fish was installed to, if it differs.)
|
||||
|
||||
Use the following command if fish isn't already added to `/etc/shells` to permit fish to be your login shell:
|
||||
|
||||
echo /usr/local/bin/fish | sudo tee -a /etc/shells
|
||||
|
||||
To switch your default shell back, you can run `chsh -s /bin/bash` (substituting `/bin/bash` with `/bin/tcsh` or `/bin/zsh` as appropriate).
|
||||
|
||||
## Building
|
||||
|
||||
### Dependencies
|
||||
|
||||
Compiling fish requires:
|
||||
|
||||
* a C++11 compiler (g++ 4.8 or later, or clang 3.3 or later)
|
||||
* any of CMake, GNU Make, or (on macOS only) Xcode
|
||||
* a curses implementation such as ncurses (headers and libraries)
|
||||
* PCRE2 (headers and libraries) - a copy is included with fish
|
||||
* gettext (headers and libraries) - optional, for translation support
|
||||
|
||||
Additionally, if compiling fish with GNU Make from git (that is, not from an officially released tarball), `autoconf` 2.60+ and `automake` 1.13+ are required. Doxygen (1.8.7 or later) is also optionally required to build the documentation from a cloned git repository.
|
||||
|
||||
### Building from source (all platforms)
|
||||
|
||||
#### Using CMake (preferred)
|
||||
|
||||
```bash
|
||||
mkdir build; cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
#### Using autotools
|
||||
|
||||
```bash
|
||||
autoreconf --no-recursive #if building from Git
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
### Building from source (macOS only)
|
||||
|
||||
* Build the `base` target in Xcode
|
||||
* Run the fish executable, for example, in `DerivedData/fish/Build/Products/Debug/base/bin/fish`
|
||||
|
||||
To build and install fish with Xcode on macOS, execute the following in a terminal:
|
||||
|
||||
```bash
|
||||
xcodebuild install
|
||||
sudo ditto /tmp/fish.dst /
|
||||
sudo make install-doc
|
||||
```
|
||||
|
||||
### Help, it didn't build!
|
||||
|
||||
If fish reports that it could not find curses, try installing a curses development package and build again.
|
||||
|
||||
On Debian or Ubuntu you want:
|
||||
|
||||
sudo apt-get install build-essential ncurses-dev libncurses5-dev gettext autoconf
|
||||
|
||||
On RedHat, CentOS, or Amazon EC2:
|
||||
|
||||
sudo yum install ncurses-devel
|
||||
|
||||
## Contributing Changes to the Code
|
||||
|
||||
See the [Guide for Developers](CONTRIBUTING.md).
|
||||
|
||||
## Contact Us
|
||||
|
||||
Questions, comments, rants and raves can be posted to the official fish mailing list at <https://lists.sourceforge.net/lists/listinfo/fish-users> or join us on our [gitter.im channel](https://gitter.im/fish-shell/fish-shell) or IRC channel [#fish at irc.oftc.net](https://webchat.oftc.net/?channels=fish). Or use the [fish tag on Stackoverflow](https://stackoverflow.com/questions/tagged/fish) for questions related to fish script and the [fish tag on Superuser](https://superuser.com/questions/tagged/fish) for all other questions (e.g., customizing colors, changing key bindings).
|
||||
|
||||
Found a bug? Have an awesome idea? Please [open an issue](https://github.com/fish-shell/fish-shell/issues/new).
|
||||
216
README.rst
216
README.rst
@@ -1,216 +0,0 @@
|
||||
.. |Cirrus CI| image:: https://api.cirrus-ci.com/github/fish-shell/fish-shell.svg?branch=master
|
||||
:target: https://cirrus-ci.com/github/fish-shell/fish-shell
|
||||
:alt: Cirrus CI Build Status
|
||||
|
||||
`fish <https://fishshell.com/>`__ - the friendly interactive shell |Build Status| |Cirrus CI|
|
||||
=============================================================================================
|
||||
|
||||
fish is a smart and user-friendly command line shell for macOS, Linux,
|
||||
and the rest of the family. fish includes features like syntax
|
||||
highlighting, autosuggest-as-you-type, and fancy tab completions that
|
||||
just work, with no configuration required.
|
||||
|
||||
For downloads, screenshots and more, go to https://fishshell.com/.
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
fish generally works like other shells, like bash or zsh. A few
|
||||
important differences can be found at
|
||||
https://fishshell.com/docs/current/tutorial.html by searching for the
|
||||
magic phrase “unlike other shells”.
|
||||
|
||||
Detailed user documentation is available by running ``help`` within
|
||||
fish, and also at https://fishshell.com/docs/current/index.html
|
||||
|
||||
Getting fish
|
||||
------------
|
||||
|
||||
macOS
|
||||
~~~~~
|
||||
|
||||
fish can be installed:
|
||||
|
||||
- using `Homebrew <http://brew.sh/>`__: ``brew install fish``
|
||||
- using `MacPorts <https://www.macports.org/>`__:
|
||||
``sudo port install fish``
|
||||
- using the `installer from fishshell.com <https://fishshell.com/>`__
|
||||
- as a `standalone app from fishshell.com <https://fishshell.com/>`__
|
||||
|
||||
Note: The minimum supported macOS version is 10.10 "Yosemite".
|
||||
|
||||
Packages for Linux
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Packages for Debian, Fedora, openSUSE, and Red Hat Enterprise
|
||||
Linux/CentOS are available from the `openSUSE Build
|
||||
Service <https://software.opensuse.org/download.html?project=shells%3Afish&package=fish>`__.
|
||||
|
||||
Packages for Ubuntu are available from the `fish
|
||||
PPA <https://launchpad.net/~fish-shell/+archive/ubuntu/release-4>`__,
|
||||
and can be installed using the following commands:
|
||||
|
||||
::
|
||||
|
||||
sudo apt-add-repository ppa:fish-shell/release-4
|
||||
sudo apt update
|
||||
sudo apt install fish
|
||||
|
||||
Instructions for other distributions may be found at
|
||||
`fishshell.com <https://fishshell.com>`__.
|
||||
|
||||
Windows
|
||||
~~~~~~~
|
||||
|
||||
- On Windows 10/11, fish can be installed under the WSL Windows Subsystem
|
||||
for Linux with the instructions for the appropriate distribution
|
||||
listed above under “Packages for Linux”, or from source with the
|
||||
instructions below.
|
||||
- fish (4.0 on and onwards) cannot be installed in Cygwin, due to a lack of Rust support.
|
||||
|
||||
Building from source
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If packages are not available for your platform, GPG-signed tarballs are
|
||||
available from `fishshell.com <https://fishshell.com/>`__ and
|
||||
`fish-shell on
|
||||
GitHub <https://github.com/fish-shell/fish-shell/releases>`__. See the
|
||||
`Building <#building>`_ section for instructions.
|
||||
|
||||
Running fish
|
||||
------------
|
||||
|
||||
Once installed, run ``fish`` from your current shell to try fish out!
|
||||
|
||||
Dependencies
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Running fish requires:
|
||||
|
||||
- some common \*nix system utilities (currently ``mktemp``), in
|
||||
addition to the basic POSIX utilities (``cat``, ``cut``, ``dirname``,
|
||||
``file``, ``ls``, ``mkdir``, ``mkfifo``, ``rm``, ``sort``, ``tee``, ``tr``,
|
||||
``uname`` and ``sed`` at least, but the full coreutils plus ``find`` and
|
||||
``awk`` is preferred)
|
||||
- The gettext library, if compiled with
|
||||
translation support
|
||||
|
||||
The following optional features also have specific requirements:
|
||||
|
||||
- builtin commands that have the ``--help`` option or print usage
|
||||
messages require ``nroff`` or ``mandoc`` for
|
||||
display
|
||||
- automated completion generation from manual pages requires Python 3.5+
|
||||
- the ``fish_config`` web configuration tool requires Python 3.5+ and a web browser
|
||||
- system clipboard integration (with the default Ctrl-V and Ctrl-X
|
||||
bindings) require either the ``xsel``, ``xclip``,
|
||||
``wl-copy``/``wl-paste`` or ``pbcopy``/``pbpaste`` utilities
|
||||
- full completions for ``yarn`` and ``npm`` require the
|
||||
``all-the-package-names`` NPM module
|
||||
- ``colorls`` is used, if installed, to add color when running ``ls`` on platforms
|
||||
that do not have color support (such as OpenBSD)
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
.. _dependencies-1:
|
||||
|
||||
Dependencies
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Compiling fish requires:
|
||||
|
||||
- Rust (version 1.70 or later)
|
||||
- CMake (version 3.15 or later)
|
||||
- a C compiler (for system feature detection and the test helper binary)
|
||||
- PCRE2 (headers and libraries) - optional, this will be downloaded if missing
|
||||
- gettext (headers and libraries) - optional, for translation support
|
||||
- an Internet connection, as other dependencies will be downloaded automatically
|
||||
|
||||
Sphinx is also optionally required to build the documentation from a
|
||||
cloned git repository.
|
||||
|
||||
Additionally, running the full test suite requires Python 3, tmux, and the pexpect package.
|
||||
|
||||
Building from source with CMake
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Rather than building from source, consider using a packaged build for your platform. Using the
|
||||
steps below makes fish difficult to uninstall or upgrade. Release packages are available from the
|
||||
links above, and up-to-date `development builds of fish are available for many platforms
|
||||
<https://github.com/fish-shell/fish-shell/wiki/Development-builds>`__
|
||||
|
||||
To install into ``/usr/local``, run:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
mkdir build; cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
|
||||
The install directory can be changed using the
|
||||
``-DCMAKE_INSTALL_PREFIX`` parameter for ``cmake``.
|
||||
|
||||
CMake Build options
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In addition to the normal CMake build options (like ``CMAKE_INSTALL_PREFIX``), fish's CMake build has some other options available to customize it.
|
||||
|
||||
- Rust_COMPILER=path - the path to rustc. If not set, cmake will check $PATH and ~/.cargo/bin
|
||||
- Rust_CARGO=path - the path to cargo. If not set, cmake will check $PATH and ~/.cargo/bin
|
||||
- Rust_CARGO_TARGET=target - the target to pass to cargo. Set this for cross-compilation.
|
||||
- BUILD_DOCS=ON|OFF - whether to build the documentation. This is automatically set to OFF when Sphinx isn't installed.
|
||||
- INSTALL_DOCS=ON|OFF - whether to install the docs. This is automatically set to on when BUILD_DOCS is or prebuilt documentation is available (like when building in-tree from a tarball).
|
||||
- FISH_USE_SYSTEM_PCRE2=ON|OFF - whether to use an installed pcre2. This is normally autodetected.
|
||||
- MAC_CODESIGN_ID=String|OFF - the codesign ID to use on Mac, or "OFF" to disable codesigning.
|
||||
- WITH_GETTEXT=ON|OFF - whether to build with gettext support for translations.
|
||||
- extra_functionsdir, extra_completionsdir and extra_confdir - to compile in an additional directory to be searched for functions, completions and configuration snippets
|
||||
|
||||
Building fish with embedded data (experimental)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can also build fish with the data files embedded.
|
||||
|
||||
This will include all the datafiles like the included functions or web configuration tool in the main ``fish`` binary.
|
||||
|
||||
Fish will then read these right from its own binary, and print them out when needed. Some files, like the webconfig tool and the manpage completion generator, will be extracted to a temporary directory on-demand. You can list the files with ``status list-files`` and print one with ``status get-file path/to/file`` (e.g. ``status get-file functions/fish_prompt.fish`` to get the default prompt).
|
||||
|
||||
To install fish with embedded files, just use ``cargo``, like::
|
||||
|
||||
cargo install --path /path/to/fish # if you have a git clone
|
||||
cargo install --git https://github.com/fish-shell/fish-shell --tag 4.0.0 # to build from git with a specific version
|
||||
cargo install --git https://github.com/fish-shell/fish-shell # to build the current development snapshot without cloning
|
||||
|
||||
This will place the binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
|
||||
|
||||
This build won't have the HTML docs (``help`` will open the online version) or translations.
|
||||
|
||||
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=1 cargo install --path .
|
||||
|
||||
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
|
||||
--------------------------------
|
||||
|
||||
See the `Guide for Developers <CONTRIBUTING.rst>`__.
|
||||
|
||||
Contact Us
|
||||
----------
|
||||
|
||||
Questions, comments, rants and raves can be posted to the official fish
|
||||
mailing list at https://lists.sourceforge.net/lists/listinfo/fish-users
|
||||
or join us on our `matrix
|
||||
channel <https://matrix.to/#/#fish-shell:matrix.org>`__. Or use the `fish tag
|
||||
on Unix & Linux Stackexchange <https://unix.stackexchange.com/questions/tagged/fish>`__.
|
||||
There is also a fish tag on Stackoverflow, but it is typically a poor fit.
|
||||
|
||||
Found a bug? Have an awesome idea? Please `open an
|
||||
issue <https://github.com/fish-shell/fish-shell/issues/new>`__.
|
||||
|
||||
.. |Build Status| image:: https://github.com/fish-shell/fish-shell/workflows/make%20test/badge.svg
|
||||
:target: https://github.com/fish-shell/fish-shell/actions
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
for i in (seq 1000)
|
||||
command true
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
# Glob fish's source directory.
|
||||
# This timing is bound to change if the repo does,
|
||||
# so it's best to build two fishes, check out one version of the repo,
|
||||
# and then run this script with both.
|
||||
set -l dir (dirname (status current-filename))
|
||||
# No repetitions, this is plenty slow enough.
|
||||
echo $dir/../../**
|
||||
@@ -1,11 +0,0 @@
|
||||
set -l compdir (status dirname)/../../share/completions
|
||||
cd $compdir
|
||||
for file in *.fish
|
||||
set -l bname (string replace -r '.fish$' '' -- $file)
|
||||
if type -q $bname
|
||||
source $file >/dev/null
|
||||
if test $status -gt 0
|
||||
echo FAILING FILE $file
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
for i in (seq 100000)
|
||||
math $i + $i
|
||||
end
|
||||
@@ -1,6 +0,0 @@
|
||||
set -l path (status dirname)
|
||||
set -l fish (status fish-path)
|
||||
for f in (seq 100)
|
||||
echo $fish -n $path/aliases.fish
|
||||
$fish -n $path/aliases.fish
|
||||
end
|
||||
@@ -1 +0,0 @@
|
||||
printf (string repeat -n 200 \\x7f)%s\n (string repeat -n 2000 aaa\n)
|
||||
@@ -1,5 +0,0 @@
|
||||
for i in (seq 100000)
|
||||
printf '%f\n' $i.$i
|
||||
end
|
||||
|
||||
exit 0
|
||||
@@ -1,7 +0,0 @@
|
||||
set -l tmp (mktemp)
|
||||
string repeat -n 2000 >$tmp
|
||||
for i in (seq 1000)
|
||||
cat $tmp | read -l foo
|
||||
end
|
||||
|
||||
true
|
||||
@@ -1,3 +0,0 @@
|
||||
for i in (seq 10000)
|
||||
echo $i
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
for abc in (seq 100000)
|
||||
set -l def
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
for i in (string repeat -n 100 \n)
|
||||
string repeat -n 50000 a\n
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
for i in (seq 100000)
|
||||
string match '*o' fooooooo
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
for i in (seq 100000)
|
||||
string match -r '^.*$' fooooooo
|
||||
end | string match -re o
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$#" -gt 2 ] || [ "$#" -eq 0 ]; then
|
||||
echo "Usage: driver.sh /path/to/fish [/path/to/other/fish]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FISH_PATH=$1
|
||||
FISH2_PATH=$2
|
||||
BENCHMARKS_DIR=$(dirname "$0")/benchmarks
|
||||
|
||||
quote() {
|
||||
# Single-quote the given string for a POSIX shell, except in common cases that don't need it.
|
||||
printf %s "$1" |
|
||||
sed "/[^[:alnum:]\/.-]/ {
|
||||
s/'/'\\\''/g
|
||||
s/^/'/
|
||||
s/\$/'/
|
||||
}"
|
||||
}
|
||||
|
||||
for benchmark in "$BENCHMARKS_DIR"/*; do
|
||||
basename "$benchmark"
|
||||
# If we have hyperfine, use it first to warm up the cache
|
||||
if command -v hyperfine >/dev/null 2>&1; then
|
||||
cmd1="$(quote "${FISH_PATH}") --no-config $(quote "$benchmark")"
|
||||
if [ -n "$FISH2_PATH" ]; then
|
||||
cmd2="$(quote "${FISH2_PATH}") --no-config $(quote "$benchmark")"
|
||||
hyperfine --warmup 3 "$cmd1" "$cmd2"
|
||||
else
|
||||
hyperfine --warmup 3 "$cmd1"
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "$FISH2_PATH" ] && echo "$FISH_PATH"
|
||||
"${FISH_PATH}" --print-rusage-self "$benchmark" > /dev/null
|
||||
if [ -n "$FISH2_PATH" ]; then
|
||||
echo "$FISH2_PATH"
|
||||
"${FISH2_PATH}" --print-rusage-self "$benchmark" > /dev/null
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
462
build.rs
462
build.rs
@@ -1,462 +0,0 @@
|
||||
#![allow(clippy::uninlined_format_args)]
|
||||
|
||||
use rsconf::{LinkType, Target};
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
setup_paths();
|
||||
|
||||
// Add our default to enable tools that don't go through CMake, like "cargo test" and the
|
||||
// language server.
|
||||
|
||||
// FISH_BUILD_DIR is set by CMake, if we are using it.
|
||||
// OUT_DIR is set by Cargo when the build script is running (not compiling)
|
||||
let default_build_dir = env::var("OUT_DIR").unwrap();
|
||||
let build_dir = option_env!("FISH_BUILD_DIR").unwrap_or(&default_build_dir);
|
||||
let build_dir = std::fs::canonicalize(build_dir).unwrap();
|
||||
let build_dir = build_dir.to_str().unwrap();
|
||||
rsconf::set_env_value("FISH_BUILD_DIR", build_dir);
|
||||
// We need to canonicalize (i.e. realpath) the manifest dir because we want to be able to
|
||||
// compare it directly as a string at runtime.
|
||||
rsconf::set_env_value(
|
||||
"CARGO_MANIFEST_DIR",
|
||||
std::fs::canonicalize(env!("CARGO_MANIFEST_DIR"))
|
||||
.unwrap()
|
||||
.as_path()
|
||||
.to_str()
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
// Some build info
|
||||
rsconf::set_env_value("BUILD_TARGET_TRIPLE", &env::var("TARGET").unwrap());
|
||||
rsconf::set_env_value("BUILD_HOST_TRIPLE", &env::var("HOST").unwrap());
|
||||
rsconf::set_env_value("BUILD_PROFILE", &env::var("PROFILE").unwrap());
|
||||
|
||||
let version = &get_version(&env::current_dir().unwrap());
|
||||
// Per https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script,
|
||||
// the source directory is the current working directory of the build script
|
||||
rsconf::set_env_value("FISH_BUILD_VERSION", version);
|
||||
|
||||
std::env::set_var("FISH_BUILD_VERSION", version);
|
||||
|
||||
let cman = std::fs::canonicalize(env!("CARGO_MANIFEST_DIR")).unwrap();
|
||||
let targetman = cman.as_path().join("target").join("man");
|
||||
|
||||
#[cfg(feature = "embed-data")]
|
||||
#[cfg(not(clippy))]
|
||||
{
|
||||
build_man(&targetman);
|
||||
}
|
||||
#[cfg(any(not(feature = "embed-data"), clippy))]
|
||||
{
|
||||
let sec1dir = targetman.join("man1");
|
||||
let _ = std::fs::create_dir_all(sec1dir.to_str().unwrap());
|
||||
}
|
||||
|
||||
rsconf::rebuild_if_paths_changed(&["src", "printf", "Cargo.toml", "Cargo.lock", "build.rs"]);
|
||||
|
||||
// These are necessary if built with embedded functions,
|
||||
// but only in release builds (because rust-embed in debug builds reads from the filesystem).
|
||||
#[cfg(feature = "embed-data")]
|
||||
#[cfg(not(debug_assertions))]
|
||||
rsconf::rebuild_if_paths_changed(&["doc_src", "share"]);
|
||||
|
||||
cc::Build::new()
|
||||
.file("src/libc.c")
|
||||
.include(build_dir)
|
||||
.compile("flibc.a");
|
||||
|
||||
let mut build = cc::Build::new();
|
||||
// Add to the default library search path
|
||||
build.flag_if_supported("-L/usr/local/lib/");
|
||||
rsconf::add_library_search_path("/usr/local/lib");
|
||||
let mut target = Target::new_from(build).unwrap();
|
||||
// Keep verbose mode on until we've ironed out rust build script stuff
|
||||
target.set_verbose(true);
|
||||
detect_cfgs(&mut target);
|
||||
|
||||
#[cfg(all(target_env = "gnu", target_feature = "crt-static"))]
|
||||
compile_error!("Statically linking against glibc has unavoidable crashes and is unsupported. Use dynamic linking or link statically against musl.");
|
||||
}
|
||||
|
||||
/// Check target system support for certain functionality dynamically when the build is invoked,
|
||||
/// without their having to be explicitly enabled in the `cargo build --features xxx` invocation.
|
||||
///
|
||||
/// We are using [`rsconf::enable_cfg()`] instead of [`rsconf::enable_feature()`] as rust features
|
||||
/// should be used for things that a user can/would reasonably enable or disable to tweak or coerce
|
||||
/// behavior, but here we are testing for whether or not things are supported altogether.
|
||||
///
|
||||
/// This can be used to enable features that we check for and conditionally compile according to in
|
||||
/// our own codebase, but [can't be used to pull in dependencies](0) even if they're gated (in
|
||||
/// `Cargo.toml`) behind a feature we just enabled.
|
||||
///
|
||||
/// [0]: https://github.com/rust-lang/cargo/issues/5499
|
||||
#[rustfmt::skip]
|
||||
fn detect_cfgs(target: &mut Target) {
|
||||
for (name, handler) in [
|
||||
// Ignore the first entry, it just sets up the type inference. Model new entries after the
|
||||
// second line.
|
||||
(
|
||||
"",
|
||||
&(|_: &Target| Ok(false)) as &dyn Fn(&Target) -> Result<bool, Box<dyn Error>>,
|
||||
),
|
||||
("apple", &detect_apple),
|
||||
("bsd", &detect_bsd),
|
||||
("cygwin", &detect_cygwin),
|
||||
("gettext", &have_gettext),
|
||||
("small_main_stack", &has_small_stack),
|
||||
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
|
||||
("localeconv_l", &|target| {
|
||||
Ok(target.has_symbol("localeconv_l"))
|
||||
}),
|
||||
("FISH_USE_POSIX_SPAWN", &|target| {
|
||||
Ok(target.has_header("spawn.h"))
|
||||
}),
|
||||
("HAVE_PIPE2", &|target| {
|
||||
Ok(target.has_symbol("pipe2"))
|
||||
}),
|
||||
("HAVE_EVENTFD", &|target| {
|
||||
// FIXME: NetBSD 10 has eventfd, but the libc crate does not expose it.
|
||||
if cfg!(target_os = "netbsd") {
|
||||
Ok(false)
|
||||
} else {
|
||||
Ok(target.has_header("sys/eventfd.h"))
|
||||
}
|
||||
}),
|
||||
("HAVE_WAITSTATUS_SIGNAL_RET", &|target| {
|
||||
Ok(target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"]))
|
||||
}),
|
||||
] {
|
||||
match handler(target) {
|
||||
Err(e) => {
|
||||
rsconf::warn!("{}: {}", name, e);
|
||||
rsconf::declare_cfg(name, false);
|
||||
},
|
||||
Ok(enabled) => rsconf::declare_cfg(name, enabled),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn detect_apple(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(any(target_os = "ios", target_os = "macos")))
|
||||
}
|
||||
|
||||
#[allow(unexpected_cfgs)]
|
||||
fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(target_os = "cygwin"))
|
||||
}
|
||||
|
||||
/// Detect if we're being compiled for a BSD-derived OS, allowing targeting code conditionally with
|
||||
/// `#[cfg(bsd)]`.
|
||||
///
|
||||
/// Rust offers fine-grained conditional compilation per-os for the popular operating systems, but
|
||||
/// doesn't necessarily include less-popular forks nor does it group them into families more
|
||||
/// specific than "windows" vs "unix" so we can conditionally compile code for BSD systems.
|
||||
fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
// Instead of using `uname`, we can inspect the TARGET env variable set by Cargo. This lets us
|
||||
// support cross-compilation scenarios.
|
||||
let mut target = std::env::var("TARGET").unwrap();
|
||||
if !target.chars().all(|c| c.is_ascii_lowercase()) {
|
||||
target = target.to_ascii_lowercase();
|
||||
}
|
||||
let is_bsd = target.ends_with("bsd") || target.ends_with("dragonfly");
|
||||
#[cfg(any(
|
||||
target_os = "dragonfly",
|
||||
target_os = "freebsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
))]
|
||||
assert!(is_bsd, "Target incorrectly detected as not BSD!");
|
||||
Ok(is_bsd)
|
||||
}
|
||||
|
||||
/// Detect libintl/gettext and its needed symbols to enable internationalization/localization
|
||||
/// support.
|
||||
fn have_gettext(target: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
// The following script correctly detects and links against gettext, but so long as we are using
|
||||
// C++ and generate a static library linked into the C++ binary via CMake, we need to account
|
||||
// for the CMake option WITH_GETTEXT being explicitly disabled.
|
||||
rsconf::rebuild_if_env_changed("CMAKE_WITH_GETTEXT");
|
||||
if let Some(with_gettext) = std::env::var_os("CMAKE_WITH_GETTEXT") {
|
||||
if with_gettext.eq_ignore_ascii_case("0") {
|
||||
return Ok(false);
|
||||
}
|
||||
}
|
||||
|
||||
// In order for fish to correctly operate, we need some way of notifying libintl to invalidate
|
||||
// its localizations when the locale environment variables are modified. Without the libintl
|
||||
// symbol _nl_msg_cat_cntr, we cannot use gettext even if we find it.
|
||||
let mut libraries = Vec::new();
|
||||
let mut found = 0;
|
||||
let symbols = ["gettext", "_nl_msg_cat_cntr"];
|
||||
for symbol in &symbols {
|
||||
// Historically, libintl was required in order to use gettext() and co, but that
|
||||
// functionality was subsumed by some versions of libc.
|
||||
if target.has_symbol(symbol) {
|
||||
// No need to link anything special for this symbol
|
||||
found += 1;
|
||||
continue;
|
||||
}
|
||||
for library in ["intl", "gettextlib"] {
|
||||
if target.has_symbol_in(symbol, &[library]) {
|
||||
libraries.push(library);
|
||||
found += 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
match found {
|
||||
0 => Ok(false),
|
||||
1 => Err(format!("gettext found but cannot be used without {}", symbols[1]).into()),
|
||||
_ => {
|
||||
rsconf::link_libraries(&libraries, LinkType::Default);
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Rust sets the stack size of newly created threads to a sane value, but is at at the mercy of the
|
||||
/// OS when it comes to the size of the main stack. Some platforms we support default to a tiny
|
||||
/// 0.5 MiB main stack, which is insufficient for fish's MAX_EVAL_DEPTH/MAX_STACK_DEPTH values.
|
||||
///
|
||||
/// 0.5 MiB is small enough that we'd have to drastically reduce MAX_STACK_DEPTH to less than 10, so
|
||||
/// we instead use a workaround to increase the main thread size.
|
||||
fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "netbsd")))]
|
||||
return Ok(false);
|
||||
|
||||
// NetBSD 10 also needs this but can't find pthread_get_stacksize_np.
|
||||
#[cfg(target_os = "netbsd")]
|
||||
return Ok(true);
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "macos"))]
|
||||
{
|
||||
use core::ffi;
|
||||
|
||||
extern "C" {
|
||||
fn pthread_get_stacksize_np(thread: *const ffi::c_void) -> usize;
|
||||
fn pthread_self() -> *const ffi::c_void;
|
||||
}
|
||||
|
||||
// build.rs is executed on the main thread, so we are getting the main thread's stack size.
|
||||
// Modern macOS versions default to an 8 MiB main stack but legacy OS X have a 0.5 MiB one.
|
||||
let stack_size = unsafe { pthread_get_stacksize_np(pthread_self()) };
|
||||
const TWO_MIB: usize = 2 * 1024 * 1024 - 1;
|
||||
match stack_size {
|
||||
0..=TWO_MIB => Ok(true),
|
||||
_ => Ok(false),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn setup_paths() {
|
||||
#[cfg(unix)]
|
||||
use std::path::PathBuf;
|
||||
#[cfg(windows)]
|
||||
use unix_path::{Path, PathBuf};
|
||||
|
||||
fn get_path(name: &str, default: &str, onvar: &Path) -> PathBuf {
|
||||
let mut var = PathBuf::from(env::var(name).unwrap_or(default.to_string()));
|
||||
if var.is_relative() {
|
||||
var = onvar.join(var);
|
||||
}
|
||||
var
|
||||
}
|
||||
|
||||
let (prefix_from_home, prefix) = if let Ok(pre) = env::var("PREFIX") {
|
||||
(false, PathBuf::from(pre))
|
||||
} else {
|
||||
(true, PathBuf::from(".local/"))
|
||||
};
|
||||
|
||||
// If someone gives us a $PREFIX, we need it to be absolute.
|
||||
// Otherwise we would try to get it from $HOME and that won't really work.
|
||||
if !prefix_from_home && prefix.is_relative() {
|
||||
panic!("Can't have relative prefix");
|
||||
}
|
||||
|
||||
rsconf::rebuild_if_env_changed("PREFIX");
|
||||
rsconf::set_env_value("PREFIX", prefix.to_str().unwrap());
|
||||
|
||||
let datadir = get_path("DATADIR", "share/", &prefix);
|
||||
rsconf::set_env_value("DATADIR", datadir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("DATADIR");
|
||||
|
||||
let datadir_subdir = if prefix_from_home {
|
||||
"fish/install"
|
||||
} else {
|
||||
"fish"
|
||||
};
|
||||
rsconf::set_env_value("DATADIR_SUBDIR", datadir_subdir);
|
||||
|
||||
let bindir = get_path("BINDIR", "bin/", &prefix);
|
||||
rsconf::set_env_value("BINDIR", bindir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("BINDIR");
|
||||
|
||||
let sysconfdir = get_path(
|
||||
"SYSCONFDIR",
|
||||
// If we get our prefix from $HOME, we should use the system's /etc/
|
||||
// ~/.local/share/etc/ makes no sense
|
||||
if prefix_from_home { "/etc/" } else { "etc/" },
|
||||
&datadir,
|
||||
);
|
||||
rsconf::set_env_value("SYSCONFDIR", sysconfdir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("SYSCONFDIR");
|
||||
|
||||
let localedir = get_path("LOCALEDIR", "locale/", &datadir);
|
||||
rsconf::set_env_value("LOCALEDIR", localedir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("LOCALEDIR");
|
||||
|
||||
let docdir = get_path("DOCDIR", "doc/fish", &datadir);
|
||||
rsconf::set_env_value("DOCDIR", docdir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("DOCDIR");
|
||||
}
|
||||
|
||||
fn get_version(src_dir: &Path) -> String {
|
||||
use std::fs::read_to_string;
|
||||
use std::process::Command;
|
||||
|
||||
if let Ok(var) = std::env::var("FISH_BUILD_VERSION") {
|
||||
return var;
|
||||
}
|
||||
|
||||
let path = src_dir.join("version");
|
||||
if let Ok(strver) = read_to_string(path) {
|
||||
return strver.to_string();
|
||||
}
|
||||
|
||||
let args = &["describe", "--always", "--dirty=-dirty"];
|
||||
if let Ok(output) = Command::new("git").args(args).output() {
|
||||
let rev = String::from_utf8_lossy(&output.stdout).trim().to_string();
|
||||
if !rev.is_empty() {
|
||||
// If it contains a ".", we have a proper version like "3.7",
|
||||
// or "23.2.1-1234-gfab1234"
|
||||
if rev.contains('.') {
|
||||
return rev;
|
||||
}
|
||||
// If it doesn't, we probably got *just* the commit SHA,
|
||||
// like "f1242abcdef".
|
||||
// So we prepend the crate version so it at least looks like
|
||||
// "3.8-gf1242abcdef"
|
||||
// This lacks the commit *distance*, but that can't be helped without
|
||||
// tags.
|
||||
let version = env!("CARGO_PKG_VERSION").to_owned();
|
||||
return version + "-g" + &rev;
|
||||
}
|
||||
}
|
||||
|
||||
// git did not tell us a SHA either because it isn't installed,
|
||||
// or because it refused (safe.directory applies to `git describe`!)
|
||||
// So we read the SHA ourselves.
|
||||
fn get_git_hash() -> Result<String, Box<dyn std::error::Error>> {
|
||||
let gitdir = Path::new(env!("CARGO_MANIFEST_DIR")).join(".git");
|
||||
let jjdir = Path::new(env!("CARGO_MANIFEST_DIR")).join(".jj");
|
||||
let commit_id = if gitdir.exists() {
|
||||
// .git/HEAD contains ref: refs/heads/branch
|
||||
let headpath = gitdir.join("HEAD");
|
||||
let headstr = read_to_string(headpath)?;
|
||||
let headref = headstr.split(' ').nth(1).unwrap().trim();
|
||||
|
||||
// .git/refs/heads/branch contains the SHA
|
||||
let refpath = gitdir.join(headref);
|
||||
// Shorten to 9 characters (what git describe does currently)
|
||||
read_to_string(refpath)?
|
||||
} else if jjdir.exists() {
|
||||
let output = Command::new("jj")
|
||||
.args([
|
||||
"log",
|
||||
"--revisions",
|
||||
"@",
|
||||
"--no-graph",
|
||||
"--ignore-working-copy",
|
||||
"--template",
|
||||
"commit_id",
|
||||
])
|
||||
.output()
|
||||
.unwrap();
|
||||
String::from_utf8_lossy(&output.stdout).to_string()
|
||||
} else {
|
||||
return Err("did not find either of .git or .jj".into());
|
||||
};
|
||||
let refstr = &commit_id[0..9];
|
||||
let refstr = refstr.trim();
|
||||
|
||||
let version = env!("CARGO_PKG_VERSION").to_owned();
|
||||
Ok(version + "-g" + refstr)
|
||||
}
|
||||
|
||||
get_git_hash().expect("Could not get a version. Either set $FISH_BUILD_VERSION or install git.")
|
||||
}
|
||||
|
||||
#[cfg(feature = "embed-data")]
|
||||
// disable clippy because otherwise it would panic without sphinx
|
||||
#[cfg(not(clippy))]
|
||||
fn build_man(build_dir: &Path) {
|
||||
use std::process::Command;
|
||||
let mandir = build_dir;
|
||||
let sec1dir = mandir.join("man1");
|
||||
let docsrc_path = std::fs::canonicalize(env!("CARGO_MANIFEST_DIR"))
|
||||
.unwrap()
|
||||
.as_path()
|
||||
.join("doc_src");
|
||||
let docsrc = docsrc_path.to_str().unwrap();
|
||||
let args = &[
|
||||
"-j",
|
||||
"auto",
|
||||
"-q",
|
||||
"-b",
|
||||
"man",
|
||||
"-c",
|
||||
docsrc,
|
||||
// doctree path - put this *above* the man1 dir to exclude it.
|
||||
// this is ~6M
|
||||
"-d",
|
||||
mandir.to_str().unwrap(),
|
||||
docsrc,
|
||||
sec1dir.to_str().unwrap(),
|
||||
];
|
||||
let _ = std::fs::create_dir_all(sec1dir.to_str().unwrap());
|
||||
|
||||
rsconf::rebuild_if_env_changed("FISH_BUILD_DOCS");
|
||||
if env::var("FISH_BUILD_DOCS") == Ok("0".to_string()) {
|
||||
println!("cargo:warning=Skipping man pages because $FISH_BUILD_DOCS is set to 0");
|
||||
return;
|
||||
}
|
||||
|
||||
// We run sphinx to build the man pages.
|
||||
// Every error here is fatal so cargo doesn't cache the result
|
||||
// - if we skipped the docs with sphinx not installed, installing it would not then build the docs.
|
||||
// That means you need to explicitly set $FISH_BUILD_DOCS=0 (`FISH_BUILD_DOCS=0 cargo install --path .`),
|
||||
// which is unfortunate - but the docs are pretty important because they're also used for --help.
|
||||
match Command::new("sphinx-build").args(args).spawn() {
|
||||
Err(x) if x.kind() == std::io::ErrorKind::NotFound => {
|
||||
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) => {
|
||||
// Another error - permissions wrong etc
|
||||
panic!("Error starting sphinx-build to build man pages: {:?}", x);
|
||||
}
|
||||
Ok(mut x) => match x.wait() {
|
||||
Err(err) => {
|
||||
panic!(
|
||||
"Error waiting for sphinx-build to build man pages: {:?}",
|
||||
err
|
||||
);
|
||||
}
|
||||
Ok(out) => {
|
||||
if out.success() {
|
||||
// Success!
|
||||
return;
|
||||
} else {
|
||||
panic!("sphinx-build failed to build the man pages.");
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
20
build_tools/build_commands_hdr.sh
Executable file
20
build_tools/build_commands_hdr.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Builds the commands.hdr file.
|
||||
# Usage: build_commands_hdr.sh ${HELP_SRC} < commands_hdr.in > commands.hdr
|
||||
|
||||
rm -f command_list.tmp command_list_toc.tmp
|
||||
for i in `printf "%s\n" $@ | LC_ALL=C.UTF-8 sort`; do
|
||||
echo "<hr>" >>command_list.tmp;
|
||||
cat $i >>command_list.tmp;
|
||||
echo >>command_list.tmp;
|
||||
echo >>command_list.tmp;
|
||||
NAME=`basename $i .txt`;
|
||||
echo '- <a href="#'$NAME'">'$NAME'</a>' >> command_list_toc.tmp;
|
||||
echo "Back to <a href='index.html#toc-commands'>command index</a>". >>command_list.tmp;
|
||||
done
|
||||
mv command_list.tmp command_list.txt
|
||||
mv command_list_toc.tmp command_list_toc.txt
|
||||
/usr/bin/env awk '{if ($0 ~ /@command_list_toc@/) { system("cat command_list_toc.txt"); }
|
||||
else if ($0 ~ /@command_list@/){ system("cat command_list.txt");}
|
||||
else{ print $0;}}'
|
||||
163
build_tools/build_documentation.sh
Executable file
163
build_tools/build_documentation.sh
Executable file
@@ -0,0 +1,163 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is run as part of the build process
|
||||
|
||||
if test $# -eq 0
|
||||
then
|
||||
# Use fish's defaults
|
||||
DOXYFILE=Doxyfile.help
|
||||
INPUTDIR=doc_src
|
||||
OUTPUTDIR=share
|
||||
echo "Using defaults: $0 ${DOXYFILE} ${INPUTDIR} ${OUTPUTDIR}"
|
||||
elif test $# -eq 3
|
||||
then
|
||||
DOXYFILE="$1"
|
||||
INPUTDIR="$2"
|
||||
OUTPUTDIR="$3"
|
||||
else
|
||||
echo "Usage: $0 doxygen_file input_directory output_directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine which man pages we don't want to generate.
|
||||
# on OS X, don't make a man page for open, since we defeat fish's open function on OS X.
|
||||
# This is also done in the Makefile, but the Xcode build doesn't use that
|
||||
CONDEMNED_PAGES=
|
||||
if test `uname` = 'Darwin'; then
|
||||
CONDEMNED_PAGES="$CONDEMNED_PAGES open.1"
|
||||
fi
|
||||
|
||||
# Helper function to turn a relative path into an absolute path
|
||||
resolve_path()
|
||||
{
|
||||
D=`command dirname "$1"`
|
||||
B=`command basename "$1"`
|
||||
echo "`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
|
||||
}
|
||||
|
||||
# Expand relative paths
|
||||
DOXYFILE=`resolve_path "$DOXYFILE"`
|
||||
INPUTDIR=`resolve_path "$INPUTDIR"`
|
||||
INPUTFILTER=`resolve_path "$INPUT_FILTER"`
|
||||
OUTPUTDIR=`resolve_path "$OUTPUTDIR"`
|
||||
|
||||
echo " doxygen file: $DOXYFILE"
|
||||
echo " input directory: $INPUTDIR"
|
||||
echo " input filter: $INPUTFILTER"
|
||||
echo " output directory: $OUTPUTDIR"
|
||||
echo " skipping: $CONDEMNED_PAGES"
|
||||
|
||||
#Until now the makefile likely has been affecting our output, reset for upcoming warnings
|
||||
tput sgr0
|
||||
|
||||
# Make sure INPUTDIR is found
|
||||
if test ! -d "$INPUTDIR"; then
|
||||
echo >&2 "Could not find input directory '${INPUTDIR}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure doxygen is found
|
||||
DOXYGENPATH=`command -v doxygen`
|
||||
if test -z "$DOXYGENPATH" ; then
|
||||
for i in /usr/local/bin/doxygen /opt/bin/doxygen /Applications/Doxygen.app/Contents/Resources/doxygen ~/Applications/Doxygen.app/Contents/Resources/doxygen ; do
|
||||
if test -f "$i"; then
|
||||
DOXYGENPATH="$i"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$DOXYGENPATH"; then
|
||||
echo >&2 "doxygen is not installed, so documentation will not be built."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check we have the lexicon filter
|
||||
if test -z "$INPUT_FILTER"; then
|
||||
echo >&2 "Lexicon filter is not available. Continuing without."
|
||||
INPUTFILTER=''
|
||||
fi
|
||||
|
||||
# Determine where our output should go
|
||||
if ! mkdir -p "${OUTPUTDIR}" ; then
|
||||
echo "Could not create output directory '${OUTPUTDIR}'"
|
||||
fi
|
||||
|
||||
# Make a temporary directory
|
||||
TMPLOC=`mktemp -d -t fish_doc_build_XXXXXX` || { echo >&2 "Could not build documentation because mktemp failed"; exit 1; }
|
||||
|
||||
# Copy stuff to the temp directory
|
||||
for i in "$INPUTDIR"/*.txt; do
|
||||
BASENAME=`basename $i .txt`
|
||||
INPUTFILE=$TMPLOC/$BASENAME.doxygen
|
||||
echo "/** \\page" $BASENAME > $INPUTFILE
|
||||
cat $i | sed "s/\\\section $BASENAME $BASENAME/\\\section $BASENAME-man $BASENAME/" >> $INPUTFILE
|
||||
echo "*/" >> $INPUTFILE
|
||||
done
|
||||
|
||||
# Make some extra stuff to pass to doxygen
|
||||
# Input is kept as . because we cd to the input directory beforehand
|
||||
# This prevents doxygen from generating "documentation" for intermediate directories
|
||||
PROJECT_NUMBER=$(echo "$FISH_BUILD_VERSION" | env sed "s/-[a-z0-9-]*//")
|
||||
echo "PROJECT_NUMBER: $FISH_BUILD_VERSION"
|
||||
DOXYPARAMS=$(cat <<EOF
|
||||
PROJECT_NUMBER=${PROJECT_NUMBER}
|
||||
INPUT_FILTER=$INPUTFILTER
|
||||
INPUT=.
|
||||
OUTPUT_DIRECTORY=$OUTPUTDIR
|
||||
QUIET=YES
|
||||
EOF
|
||||
);
|
||||
|
||||
# echo "$DOXYPARAMS"
|
||||
|
||||
# Clear out the output directory first
|
||||
find "${OUTPUTDIR}" -name "*.1" -delete
|
||||
|
||||
# Run doxygen
|
||||
cd "$TMPLOC"
|
||||
(cat "${DOXYFILE}" ; echo "$DOXYPARAMS";) | "$DOXYGENPATH" -
|
||||
|
||||
# Remember errors
|
||||
RESULT=$?
|
||||
|
||||
cd "${OUTPUTDIR}/man/man1/"
|
||||
if test "$RESULT" = 0 ; then
|
||||
|
||||
# Postprocess the files
|
||||
for i in "$INPUTDIR"/*.txt; do
|
||||
# This command turns the following weirdness from Doxygen:
|
||||
# abbr \-
|
||||
# .SH "abbr - manage fish abbreviations"
|
||||
# into
|
||||
# \fBabbr\fP - manage fish abbreviations
|
||||
# It would be nice to use -i here for edit in place, but that is not portable
|
||||
CMD_NAME=`basename "$i" .txt`;
|
||||
sed -E < ${CMD_NAME}.1 > ${CMD_NAME}.1.tmp \
|
||||
-e "/^.SH NAME/{
|
||||
N; N
|
||||
s/${CMD_NAME} \\\\- \n.SH \"${CMD_NAME} (- .*)\"/\\\fB${CMD_NAME}\\\fP \1/g
|
||||
}"
|
||||
mv "${CMD_NAME}.1.tmp" "${CMD_NAME}.1"
|
||||
done
|
||||
|
||||
# Erase condemned pages
|
||||
rm -f $CONDEMNED_PAGES
|
||||
fi
|
||||
|
||||
# Destroy TMPLOC
|
||||
if test "$RESULT" -ne 0; then
|
||||
echo "Cleaning up '$TMPLOC'"
|
||||
fi
|
||||
rm -Rf "$TMPLOC"
|
||||
|
||||
if test "$RESULT" -ne 0; then
|
||||
tput smso 2> /dev/null || true
|
||||
echo "Doxygen failed creating manpages. See the output log for details."
|
||||
tput sgr0 2> /dev/null || true
|
||||
else
|
||||
tput bold 2> /dev/null || true
|
||||
echo Built manpages
|
||||
tput sgr0 2> /dev/null || true
|
||||
fi
|
||||
exit $RESULT
|
||||
5
build_tools/build_index_hdr.sh
Executable file
5
build_tools/build_index_hdr.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
TOC_TXT=$1
|
||||
env awk "{if (\$0 ~ /@toc@/){ system(\"cat ${TOC_TXT}\");} else{ print \$0;}}"
|
||||
|
||||
51
build_tools/build_lexicon_filter.sh
Executable file
51
build_tools/build_lexicon_filter.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Builds the lexicon filter
|
||||
# Usage: build_lexicon_filter.sh FUNCTIONS_DIR COMPLETIONS_DIR lexicon_filter.in [SED_BINARY] > lexicon_filter
|
||||
|
||||
set -e
|
||||
|
||||
# To enable the lexicon filter, we first need to be aware of what fish
|
||||
# considers to be a command, function, or external binary. We use
|
||||
# command_list_toc.txt for the base commands. Scan the share/functions
|
||||
# directory for other functions, some of which are mentioned in the docs, and
|
||||
# use /share/completions to find a good selection of binaries. Additionally,
|
||||
# colour defaults from __fish_config_interactive to set the docs colours when
|
||||
# used in a 'cli' style context.
|
||||
rm -f lexicon.tmp lexicon_catalog.tmp lexicon_catalog.txt lexicon.txt
|
||||
|
||||
FUNCTIONS_DIR=${1}
|
||||
FUNCTIONS_DIR_FILES=${1}/*.fish
|
||||
COMPLETIONS_DIR_FILES=${2}/*.fish
|
||||
LEXICON_FILTER_IN=${3}
|
||||
|
||||
SED=${4:-$(command -v sed)}
|
||||
|
||||
# Scan sources for commands/functions/binaries/colours. If GNU sed was portable, this could be much smarter.
|
||||
$SED <command_list_toc.txt >>lexicon.tmp -n \
|
||||
-e "s|^.*>\([a-z][a-z_]*\)</a>|'\1'|w lexicon_catalog.tmp" \
|
||||
-e "s|'\(.*\)'|bltn \1|p"; mv lexicon_catalog.tmp lexicon_catalog.txt
|
||||
printf "%s\n" ${COMPLETIONS_DIR_FILES} | $SED -n \
|
||||
-e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | grep -F -vx -f lexicon_catalog.txt | $SED >>lexicon.tmp -n \
|
||||
-e 'w lexicon_catalog.tmp' \
|
||||
-e "s|'\(.*\)'|cmnd \1|p"; cat lexicon_catalog.tmp >> lexicon_catalog.txt;
|
||||
printf "%s\n" ${FUNCTIONS_DIR_FILES} | $SED -n \
|
||||
-e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | grep -F -vx -f lexicon_catalog.txt | $SED >>lexicon.tmp -n \
|
||||
-e 'w lexicon_catalog.tmp' \
|
||||
-e "s|'\(.*\)'|func \1|p";
|
||||
$SED < ${FUNCTIONS_DIR}/__fish_config_interactive.fish >>lexicon.tmp -n \
|
||||
-e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p'; \
|
||||
$SED < ${LEXICON_FILTER_IN} >>lexicon.tmp -n \
|
||||
-e '/^#.!#/s/^#.!# \(.... [a-z][a-z_]*\)/\1/p';
|
||||
mv lexicon.tmp lexicon.txt; rm -f lexicon_catalog.tmp lexicon_catalog.txt;
|
||||
|
||||
# Copy the filter to stdout. We're going to append sed commands to it after.
|
||||
$SED -e 's|@sed@|'$SED'|' < ${LEXICON_FILTER_IN}
|
||||
|
||||
# Scan through the lexicon, transforming each line to something useful to Doxygen.
|
||||
if echo x | $SED "/[[:<:]]x/d" 2>/dev/null; then
|
||||
WORDBL='[[:<:]]'; WORDBR='[[:>:]]';
|
||||
else
|
||||
WORDBL='\\<'; WORDBR='\\>';
|
||||
fi;
|
||||
$SED < lexicon.txt -n -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$|s,$WORDBL\2$WORDBR,@\1{\2},g|p" -e '$G;s/.*\n/b tidy/p';
|
||||
17
build_tools/build_toc_txt.sh
Executable file
17
build_tools/build_toc_txt.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage: build_toc_txt.sh $(HDR_FILES:index.hdr=index.hdr.in) > toc.txt
|
||||
|
||||
# Ugly hack to set the toc initial title for the main page
|
||||
echo "- <a href=\"index.html\" id=\"toc-index\">fish shell documentation - ${FISH_BUILD_VERSION}</a>" > toc.txt
|
||||
# The first sed command captures the page name, followed by the description
|
||||
# The second sed command captures the command name \1 and the description \2, but only up to a dash
|
||||
# This is to reduce the size of the TOC in the command listing on the main page
|
||||
for i in $@; do
|
||||
NAME=`basename $i .hdr`
|
||||
NAME=`basename $NAME .hdr.in`
|
||||
env sed <$i >>toc.txt -n \
|
||||
-e 's,.*\\page *\([^ ]*\) *\(.*\)$,- <a href="'$NAME'.html" id="toc-'$NAME'">\2</a>,p' \
|
||||
-e 's,.*\\section *\([^ ]*\) *\(.*\) - .*$, - <a href="'$NAME'.html#\1">\2</a>,p' \
|
||||
-e 's,.*\\section *\([^ ]*\) *\(.*\)$, - <a href="'$NAME'.html#\1">\2</a>,p'
|
||||
done
|
||||
16
build_tools/build_user_doc.sh
Executable file
16
build_tools/build_user_doc.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage: Doxyfile.user lexicon_filter
|
||||
DOXYFILE=$1
|
||||
LEXICON_FILTER=$2
|
||||
|
||||
(cat "${DOXYFILE}" ;\
|
||||
echo INPUT_FILTER="${LEXICON_FILTER}"; \
|
||||
echo PROJECT_NUMBER=${FISH_BUILD_VERSION} \
|
||||
| /usr/bin/env sed "s/-[a-z0-9-]*//") \
|
||||
| doxygen - && touch user_doc
|
||||
|
||||
(cd ./user_doc/html/ && \
|
||||
rm -f bc_s.png bdwn.png closed.png doc.png folder*.png ftv2*.png \
|
||||
nav*.png open.png splitbar.png sync_*.png tab*.* doxygen.* \
|
||||
dynsections.js jquery.js pages.html)
|
||||
3
build_tools/cppcheck.sh
Executable file
3
build_tools/cppcheck.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/local/bin/fish
|
||||
|
||||
cppcheck --enable=all --std=posix --quiet ./src/
|
||||
@@ -5,42 +5,42 @@
|
||||
#
|
||||
# Usage: ./diff_profiles.fish profile1.log profile2.log > profile_diff.log
|
||||
|
||||
set -l profile1 (cat $argv[1])
|
||||
set -l profile2 (cat $argv[2])
|
||||
set profile1 (cat $argv[1])
|
||||
set profile2 (cat $argv[2])
|
||||
|
||||
set -l line_no 0
|
||||
while set -l next_line_no (math $line_no + 1) && set -q profile1[$next_line_no] && set -q profile2[$next_line_no]
|
||||
set line_no $next_line_no
|
||||
set line_no 0
|
||||
while set next_line_no (math $line_no + 1) && set -q profile1[$next_line_no] && set -q profile2[$next_line_no]
|
||||
set line_no $next_line_no
|
||||
|
||||
set -l line1 $profile1[$line_no]
|
||||
set -l line2 $profile2[$line_no]
|
||||
set line1 $profile1[$line_no]
|
||||
set line2 $profile2[$line_no]
|
||||
|
||||
if not string match -qr '^\d+\t\d+' $line1
|
||||
echo $line1
|
||||
continue
|
||||
end
|
||||
if not string match -qr '^\d+\t\d+' $line1
|
||||
echo $line1
|
||||
continue
|
||||
end
|
||||
|
||||
set -l results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
|
||||
set -l results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
|
||||
set results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
|
||||
set results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
|
||||
|
||||
# times from both files
|
||||
set -l time1 $results1[2..3]
|
||||
set -l time2 $results2[2..3]
|
||||
# times from both files
|
||||
set time1 $results1[2..3]
|
||||
set time2 $results2[2..3]
|
||||
|
||||
# leftover from both files
|
||||
set -l remainder1 $results1[4]
|
||||
set -l remainder2 $results2[4]
|
||||
# leftover from both files
|
||||
set remainder1 $results1[4]
|
||||
set remainder2 $results2[4]
|
||||
|
||||
if not string match -q -- $remainder1 $remainder2
|
||||
echo Mismatch on line $line_no:
|
||||
echo - $remainder1
|
||||
echo + $remainder2
|
||||
exit 1
|
||||
end
|
||||
if not string match -q -- $remainder1 $remainder2
|
||||
echo Mismatch on line $line_no:
|
||||
echo - $remainder1
|
||||
echo + $remainder2
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l diff
|
||||
set diff[1] (math $time1[1] - $time2[1])
|
||||
set diff[2] (math $time1[2] - $time2[2])
|
||||
set -l diff
|
||||
set diff[1] (math $time1[1] - $time2[1])
|
||||
set diff[2] (math $time1[2] - $time2[2])
|
||||
|
||||
echo $diff[1] $diff[2] $remainder1
|
||||
echo $diff[1] $diff[2] $remainder1
|
||||
end
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env fish
|
||||
# Build a list of all sections in the html sphinx docs, separately by page,
|
||||
# so it can be added to share/functions/help.fish
|
||||
# Use like
|
||||
# fish extract_help_sections.fish user_doc/html/{fish_for_bash_users.html,faq.html,interactive.html,language.html,tutorial.html}
|
||||
# TODO: Currently `help` uses variable names we can't generate, so it needs to be touched up manually.
|
||||
# Also this could easily be broken by changes in sphinx, ideally we'd have a way to let it print the section titles.
|
||||
#
|
||||
|
||||
for file in $argv
|
||||
set -l varname (string replace -r '.*/(.*).html' '$1' -- $file | string escape --style=var)pages
|
||||
# Technically we can use any id in the document as an anchor, but listing them all is probably too much.
|
||||
# Sphinx stores section titles (in a slug-ized form) in the id,
|
||||
# and stores explicit section links in a `span` tag like
|
||||
# `<span id="identifiers"></span>`
|
||||
# We extract both separately.
|
||||
set -l sections (string replace -rf '.*class="headerlink" href="#([^"]*)".*' '$1' <$file)
|
||||
# Sections titled "id5" and such are internal cruft and shouldn't be offered.
|
||||
set -a sections (string replace -rf '.*span id="([^"]*)".*' '$1' <$file | string match -rv 'id\d+')
|
||||
|
||||
set sections (printf '%s\n' $sections | sort -u)
|
||||
echo set -l $varname $sections
|
||||
end
|
||||
43
build_tools/find_globals.fish
Executable file
43
build_tools/find_globals.fish
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Finds global variables by parsing the output of 'nm'
|
||||
# for object files in this directory.
|
||||
# This was written for macOS nm.
|
||||
|
||||
set total_globals 0
|
||||
set boring_files \
|
||||
fish_key_reader.cpp.o \
|
||||
fish_tests.cpp.o \
|
||||
fish_indent.cpp.o \
|
||||
|
||||
|
||||
set whitelist \
|
||||
termsize_lock termsize \
|
||||
initial_pid initial_fg_process_group \
|
||||
_debug_level \
|
||||
sitm_esc ritm_esc dim_esc \
|
||||
iothread_init()::inited \
|
||||
s_result_queue s_main_thread_request_queue s_read_pipe s_write_pipe \
|
||||
s_main_thread_performer_lock s_main_thread_performer_cond s_main_thread_request_q_lock \
|
||||
locked_consumed_job_ids \
|
||||
env_initialized \
|
||||
|
||||
|
||||
for file in ./**.o
|
||||
set filename (basename $file)
|
||||
# Skip boring files.
|
||||
contains $filename $boring_files
|
||||
and continue
|
||||
for line in (nm -p -P -U $file)
|
||||
# Look in data (dD) and bss (bB) segments.
|
||||
set matches (string match --regex '^([^ ]+) ([dDbB])' -- $line)
|
||||
or continue
|
||||
set symname (echo $matches[2] | c++filt)
|
||||
contains $symname $whitelist
|
||||
and continue
|
||||
echo $filename $symname $matches[3]
|
||||
set total_globals (math $total_globals + 1)
|
||||
end
|
||||
end
|
||||
|
||||
echo "Total: $total_globals"
|
||||
@@ -1,68 +1,42 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# Tool to generate messages.pot
|
||||
|
||||
# Create temporary directory for these operations. OS X `mktemp` is somewhat restricted, so this block
|
||||
# works around that - based on share/functions/funced.fish.
|
||||
set -q TMPDIR
|
||||
or set -l TMPDIR /tmp
|
||||
set -l tmpdir (mktemp -d $TMPDIR/fish.XXXXXX)
|
||||
or exit 1
|
||||
|
||||
# This is a gigantic crime.
|
||||
# xgettext still does not support rust *at all*, so we use cargo-expand to get all our wgettext invocations.
|
||||
set -l expanded (cargo expand --lib; for f in fish{,_indent,_key_reader}; cargo expand --bin $f; end)
|
||||
|
||||
# Extract any gettext call
|
||||
set -l strs (printf '%s\n' $expanded | grep -A1 wgettext_static_str |
|
||||
grep 'widestring::internals::core::primitive::str =' |
|
||||
string match -rg '"(.*)"' | string match -rv '^%ls$|^$' |
|
||||
# escaping difference between gettext and cargo-expand: single-quotes
|
||||
string replace -a "\'" "'" | sort -u)
|
||||
|
||||
# Extract any constants
|
||||
set -a strs (string match -rv 'BUILD_VERSION:|PACKAGE_NAME' -- $expanded |
|
||||
string match -rg 'const [A-Z_]*: &str = "(.*)"' | string replace -a "\'" "'")
|
||||
|
||||
# We construct messages.pot ourselves instead of forcing this into msgmerge or whatever.
|
||||
# The escaping so far works out okay.
|
||||
for str in $strs
|
||||
# grep -P needed for string escape to be compatible (PCRE-style),
|
||||
# -H gives the filename, -n the line number.
|
||||
# If you want to run this on non-GNU grep: Don't.
|
||||
echo "#:" (grep -PHn -r -- (string escape --style=regex -- $str) src/ |
|
||||
head -n1 | string replace -r ':\s.*' '')
|
||||
echo "msgid \"$str\""
|
||||
echo 'msgstr ""'
|
||||
end >messages.pot
|
||||
# This script was originally motivated to work around a quirk (or bug depending on your viewpoint)
|
||||
# of the xgettext command. See https://lists.gnu.org/archive/html/bug-gettext/2014-11/msg00006.html.
|
||||
# However, it turns out that even if that quirk did not exist we would still need something like
|
||||
# this script to properly extract descriptions. That's because we need to normalize the strings to
|
||||
# a format that xgettext will handle correctly. Also, `xgettext -LShell` doesn't correctly extract
|
||||
# all the strings we want translated. So we extract and normalize all such strings into a format
|
||||
# that `xgettext` can handle.
|
||||
|
||||
# This regex handles descriptions for `complete` and `function` statements. These messages are not
|
||||
# particularly important to translate. Hence the "implicit" label.
|
||||
set -l implicit_regex '(?:^| +)(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
|
||||
set implicit_regex '(?:^| +)(?:complete|function) .*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
|
||||
|
||||
# This regex handles explicit requests to translate a message. These are more important to translate
|
||||
# than messages which should be implicitly translated.
|
||||
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
|
||||
set explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
|
||||
|
||||
mkdir -p $tmpdir/implicit/share/completions $tmpdir/implicit/share/functions
|
||||
mkdir -p $tmpdir/explicit/share/completions $tmpdir/explicit/share/functions
|
||||
mkdir -p /tmp/fish/implicit/share/completions /tmp/fish/implicit/share/functions
|
||||
mkdir -p /tmp/fish/explicit/share/completions /tmp/fish/explicit/share/functions
|
||||
|
||||
for f in share/config.fish share/completions/*.fish share/functions/*.fish
|
||||
# Extract explicit attempts to translate a message. That is, those that are of the form
|
||||
# `(_ "message")`.
|
||||
string replace --filter --regex $explicit_regex '$1' <$f | string unescape \
|
||||
| string replace --all '"' '\\"' | string replace -r '(.*)' 'N_ "$1"' >$tmpdir/explicit/$f
|
||||
string replace --filter --regex $explicit_regex 'echo $1' <$f | fish >/tmp/fish/explicit/$f.tmp ^/dev/null
|
||||
while read description
|
||||
echo 'N_ "'(string replace --all '"' '\\"' -- $description)'"'
|
||||
end </tmp/fish/explicit/$f.tmp >/tmp/fish/explicit/$f
|
||||
rm /tmp/fish/explicit/$f.tmp
|
||||
|
||||
# Handle `complete` / `function` description messages. The `| fish` is subtle. It basically
|
||||
# avoids the need to use `source` with a command substitution that could affect the current
|
||||
# avoids the need to use `source` with a command substituion that could affect the current
|
||||
# shell.
|
||||
string replace --filter --regex $implicit_regex '$1' <$f | string unescape \
|
||||
| string replace --all '"' '\\"' | string replace -r '(.*)' 'N_ "$1"' >$tmpdir/implicit/$f
|
||||
string replace --filter --regex $implicit_regex 'echo $1' <$f | fish >/tmp/fish/implicit/$f.tmp ^/dev/null
|
||||
while read description
|
||||
# We don't use `string escape` as shown in the next comment because it produces output that
|
||||
# is not parsed correctly by xgettext. Instead just escape double-quotes and quote the
|
||||
# resulting string.
|
||||
echo 'N_ "'(string replace --all '"' '\\"' -- $description)'"'
|
||||
end </tmp/fish/implicit/$f.tmp >/tmp/fish/implicit/$f
|
||||
rm /tmp/fish/implicit/$f.tmp
|
||||
end
|
||||
|
||||
xgettext -j -k -kN_ -LShell --from-code=UTF-8 -cDescription --no-wrap -o messages.pot $tmpdir/{ex,im}plicit/share/*/*.fish
|
||||
|
||||
# Remove the tmpdir from the location to avoid churn
|
||||
sed -i 's_^#: /.*/share/_#: share/_' messages.pot
|
||||
|
||||
rm -r $tmpdir
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
# Originally from the git sources (GIT-VERSION-GEN)
|
||||
# Presumably (C) Junio C Hamano <junkio@cox.net>
|
||||
# Reused under GPL v2.0
|
||||
@@ -6,65 +6,37 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Find the fish directory as two levels up from script directory.
|
||||
FISH_BASE_DIR="$( cd "$( dirname "$( dirname "$0" )" )" && pwd )"
|
||||
# Find the fish git directory as two levels up from script directory.
|
||||
GIT_DIR="$( cd "$( dirname $( dirname "$0" ) )" && pwd )"
|
||||
|
||||
# Set the output directory as either the first param or cwd.
|
||||
test -n "$1" && OUTPUT_DIR=$1/ || OUTPUT_DIR=
|
||||
FBVF=${OUTPUT_DIR}FISH-BUILD-VERSION-FILE
|
||||
DEF_VER=unknown
|
||||
git_permission_failed=0
|
||||
|
||||
# First see if there is a version file (included in release tarballs),
|
||||
# then try git-describe, then default.
|
||||
if test -f version
|
||||
then
|
||||
VN=$(cat version) || VN="$DEF_VER"
|
||||
elif ! VN=$(git -C "$GIT_DIR" describe --always --dirty 2>/dev/null); then
|
||||
VN="$DEF_VER"
|
||||
fi
|
||||
|
||||
if test -r $FBVF
|
||||
then
|
||||
VC=$(grep -v '^#' $FBVF | tr -d '"' | sed -e 's/^FISH_BUILD_VERSION=//')
|
||||
else
|
||||
if VN=$(git -C "$FISH_BASE_DIR" describe --always --dirty 2>/dev/null); then
|
||||
:
|
||||
else
|
||||
if test $? = 128; then
|
||||
# Current git versions return status 128
|
||||
# when run in a repo owned by another user.
|
||||
# Even for describe and everything.
|
||||
# This occurs for `sudo make install`.
|
||||
git_permission_failed=1
|
||||
fi
|
||||
VN="$DEF_VER"
|
||||
fi
|
||||
fi
|
||||
|
||||
# If the first param is --stdout, then output to stdout and exit.
|
||||
if test "$1" = '--stdout'
|
||||
then
|
||||
echo $VN
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set the output directory as either the first param or cwd.
|
||||
test -n "$1" && OUTPUT_DIR=$1/ || OUTPUT_DIR=
|
||||
FBVF="${OUTPUT_DIR}FISH-BUILD-VERSION-FILE"
|
||||
|
||||
if test "$VN" = unknown && test -r "$FBVF" && test "$git_permission_failed" = 1
|
||||
then
|
||||
# HACK: Git failed, so we keep the current version file.
|
||||
# This helps in case you built fish as a normal user
|
||||
# and then try to `sudo make install` it.
|
||||
date +%s > "${OUTPUT_DIR}"fish-build-version-witness.txt
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -r "$FBVF"
|
||||
then
|
||||
VC=$(cat "$FBVF")
|
||||
else
|
||||
VC="unset"
|
||||
VC=unset
|
||||
fi
|
||||
|
||||
# Maybe output the FBVF
|
||||
# It looks like "2.7.1-621-ga2f065e6"
|
||||
# It looks like FISH_BUILD_VERSION="2.7.1-621-ga2f065e6"
|
||||
test "$VN" = "$VC" || {
|
||||
echo >&2 "$VN"
|
||||
echo "$VN" >"$FBVF"
|
||||
echo >&2 "FISH_BUILD_VERSION=$VN"
|
||||
echo "FISH_BUILD_VERSION=\"$VN\"" >${FBVF}
|
||||
}
|
||||
|
||||
# Output the fish-build-version-witness.txt
|
||||
# See https://cmake.org/cmake/help/v3.4/policy/CMP0058.html
|
||||
date +%s > "${OUTPUT_DIR}"fish-build-version-witness.txt
|
||||
date +%s > ${OUTPUT_DIR}fish-build-version-witness.txt
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>platform-application</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.no-container</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.container-manager</key>
|
||||
<true/>
|
||||
<key>com.apple.private.skip-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.private.MobileContainerManager.allowed</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.adprivacyd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.amfid</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.AppBundles</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.AppDataContainers</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.automation-mode</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Biome</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Calendar</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CallHistory</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CarrierBundles</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.chronod</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CloudDocsDB</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CloudKit</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.containers</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CoreFollowUp</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CoreKnowledge</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Cryptex</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.demo_backup</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.DocumentRevisions</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.DumpPanic</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.ExposureNotification</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.FaceTime</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.familycircled</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.FindMy</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.fpsd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Health</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.HomeAI</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.HomeKit</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.iCloudDrive</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.idcredd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.IdentityServices</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.kbd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Keychains</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Lockdown</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Mail</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Messages</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MessagesMetaData</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MobileContainerManager</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MobileDocuments</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MobileIdentityService</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.mobilesync</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.multimodalsearchd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.NanoTimeKit.FaceSupport</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.News</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Notes</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Photos</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.PhotosLibraries</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.pipelined</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.preferences</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.PrivacyAccounting</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Safari</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SearchParty</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SecureElementService</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SensorKit</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SFAnalytics</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SiriInference</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SiriReferenceResolution</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SiriVocabulary</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SoC</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SpeechPersonalizedLM</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Spotlight</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.StatusKit</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Stocks</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Suggestions</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SymptomFramework</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.sysdagnose.ScreenshotServicesService</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.TCC</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.TimeMachine</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.triald</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.trustd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.trustd-private</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.universalaccess</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Voicemail</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Wireless</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.disk-device-access</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.ane_model_cache</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.apfs_boot_mount</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.clientScripter</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.mediaanalysisd</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.CarPlayAppBlacklist</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.DeviceCheck</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.DictionaryServices.dictionary2</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.DuetExpertCenterAsset</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.EmbeddedNL</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Font5</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Font6</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.HealthKt.FeatureAvailability</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.HomeKit</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.MacinTalkVoiceAssets</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.MailDynamicData</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.MXLongFormVideoApps</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.network.networknomicon</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.PKITrustSupplementals</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.SharingDeviceAssets</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.SiriShortcutsMobileAsset</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.TimeZoneUpdate</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.VoiceServices.CombinedVocalizerVoices</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.VoiceServices.CustomVoice</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.VoiceServices.GryphonVoice</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.VoiceServicesVocalizerVoice</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.VoiceServices.VoiceResources</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.VoiceTriggerAssets</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.CoreAnalytics</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.coreduet_knowledge_store</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.coreidvd</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.coreknowledge</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.CoreRoutine</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.CoreSpeech</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.dmd</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.dprivacyd_storage</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.ExtensibleSSO</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.facekit</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.fpsd</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.MobileStorageMounter</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.MusicApp</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.nsurlsessiond</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.pearl-field-diagnostics</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.proactivepredictions</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.QLThumbnailCache</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.remotemanagementd</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.RoleAccountStaging</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.sensorkit</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.shortcuts</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.siriremembers</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.timezone</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.triald</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.voiceshortcuts</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage-exempt.heritable</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.AppleMediaServices</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.ContactlessReader</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.CoreRoutine</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.DiagnosticReports</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.DiagnosticReports.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.DoNotDisturb</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Home</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.IntelligencePlatform</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Location</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.ManagedConfiguration</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MapsSync</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MobileBackup</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.MobileStorageMounter</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.PassKit</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SiriFeatureStore</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SiriSELF</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.SoundProfileAsset</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.TextUnderstanding</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.Weather</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.appleaccountd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.ciconia</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.clipserviced</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.coreduet_knowledge_store</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.driverkitd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.geoanalyticsd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.geod</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.launchd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.sessionkitd</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.sysdiagnose.ScreenshotServicesService</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.sysdiagnose.sysdiagnose</key>
|
||||
<true/>
|
||||
<key>com.apple.private.security.storage.tmp</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.critical</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.datavault.metadata</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.install</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.install.heritable</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.restricted-block-devices</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.MobileAssetDownload</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.amsengagementd</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.HealthKit.FeatureAvailability</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriDialogAssets</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriExperienceCam</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriFindMyConfigurationFiles</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriInferredHelpfulness</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriTextToSpeech</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingAsrAssistant</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingAsrHammer</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingAsrUaap</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingAttentionAssets</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingMorphun</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingNL</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.com.apple.MobileAsset.Trial.Siri.SiriUnderstandingNLOverrides</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.coreparsec_feedbacks</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.coreparsec_uploadables</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.early_boot_mount</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.storage.screentime</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.volume.ISCRecovery</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.volume.Preboot</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.volume.Recovery</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.volume.Update</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.volume.VM</key>
|
||||
<true/>
|
||||
<key>com.apple.rootless.volume.iSCPreboot</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
28
build_tools/iwyu.linux.imp
Normal file
28
build_tools/iwyu.linux.imp
Normal file
@@ -0,0 +1,28 @@
|
||||
# Map file for the include-what-you-use tool on Linux.
|
||||
[
|
||||
{ include: ["<bits/fcntl-linux.h>", "private", "<fcntl.h>", "public"] },
|
||||
{ include: ["<bits/mman-linux.h>", "private", "<sys/mman.h>", "public"] },
|
||||
{ include: ["<bits/socket-linux.h>", "private", "<sys/socket.h>", "public"] },
|
||||
{ include: ["<bits/socket_type.h>", "private", "<sys/socket.h>", "public"] },
|
||||
{ include: ["<bits/local_lim.h>", "private", "<limits.h>", "public"] },
|
||||
{ include: ["<tr1/memory>", "public", "<memory>", "public"] },
|
||||
{ include: ["<features.h>", "public", "<stdio.h>", "public"] },
|
||||
{ include: ["<features.h>", "public", "<stddef.h>", "public"] },
|
||||
{ include: ["<features.h>", "public", "<unistd.h>", "public"] },
|
||||
|
||||
{ symbol: ["size_t", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["size_t", "private", "<stddef.h>", "public"] },
|
||||
{ symbol: ["size_t", "private", "<stdlib.h>", "public"] },
|
||||
{ symbol: ["intmax_t", "private", "<sys/stdint.h>", "public"] },
|
||||
{ symbol: ["intmax_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["uint32_t", "private", "<sys/stdint.h>", "public"] },
|
||||
{ symbol: ["uint32_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["uint64_t", "private", "<sys/stdint.h>", "public"] },
|
||||
{ symbol: ["uint64_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["uintmax_t", "private", "<sys/stdint.h>", "public"] },
|
||||
{ symbol: ["uintmax_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["clock_gettime", "private", "<sys/time.h>", "public"] },
|
||||
{ symbol: ["timespec", "private", "<sys/time.h>", "public"] },
|
||||
{ symbol: ["memset", "private", "<string.h>", "public"] },
|
||||
{ symbol: ["strerror", "private", "<string.h>", "public"] },
|
||||
]
|
||||
109
build_tools/iwyu.osx.imp
Normal file
109
build_tools/iwyu.osx.imp
Normal file
@@ -0,0 +1,109 @@
|
||||
# Map file for the include-what-you-use tool on OS X. For some reason
|
||||
# the version installed by HomeBrew doesn't have useful mappings for the
|
||||
# system provided headers. This also has mappings for FreeBSD.
|
||||
[
|
||||
{ include: ["<sys/_pthread/_pthread_once_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthread/_pthread_mutex_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthread/_pthread_rwlock_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthread/_pthread_mutexattr_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthread/_pthread_cond_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthread/_pthread_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthread/_pthread_key_t.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_pthreadtypes.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_types/_posix_vdisable.h>", "private", "<pthread.h>", "public"] },
|
||||
{ include: ["<sys/_types/_time_t.h>", "private", "<time.h>", "public"] },
|
||||
{ include: ["<sys/_types/_suseconds_t.h>", "private", "<time.h>", "public"] },
|
||||
{ include: ["<sys/_types/_suseconds_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/errno.h>", "private", "<errno.h>", "public"] },
|
||||
{ include: ["<sys/unistd.h>", "private", "<unistd.h>", "public"] },
|
||||
{ include: ["<_wctype.h>", "private", "<wctype.h>", "public"] },
|
||||
{ include: ["<sys/fcntl.h>", "private", "<fcntl.h>", "public"] },
|
||||
{ include: ["<sys/_types/_seek_set.h>", "private", "<fcntl.h>", "public"] },
|
||||
{ include: ["<sys/_types/_mbstate_t.h>", "private", "<wchar.h>", "public"] },
|
||||
{ include: ["<iosfwd>", "private", "<string>", "public"] },
|
||||
{ include: ["<sys/_stdint.h>", "private", "<stdint.h>", "public"] },
|
||||
{ include: ["<sys/_types/_s_ifmt.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_size_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_size_t.h>", "private", "<stdlib.h>", "public"] },
|
||||
{ include: ["<sys/_types/_mode_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_pid_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_fd_def.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_fd_isset.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_fd_set.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_fd_zero.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_timeval.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_uid_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<_types/_intmax_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<_types/_uintmax_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<_types/_uint8_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_int32_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<_types/_uint64_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_uintptr_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_dev_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_ino_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_va_list.h>", "private", "<stdio.h>", "public"] },
|
||||
{ include: ["<__functional_base>", "private", "<memory>", "public"] },
|
||||
{ include: ["<__functional_base>", "private", "<vector>", "public"] },
|
||||
{ include: ["<__functional_base>", "private", "<string>", "public"] },
|
||||
{ include: ["<__tree>", "private", "<map>", "public"] },
|
||||
{ include: ["<__tree>", "private", "<set>", "public"] },
|
||||
{ include: ["<_types/_uint32_t.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_va_list.h>", "private", "<sys/types.h>", "public"] },
|
||||
{ include: ["<sys/_types/_sigset_t.h>", "private", "<signal.h>", "public"] },
|
||||
{ include: ["<sys/signal.h>", "private", "<signal.h>", "public"] },
|
||||
{ include: ["<strings.h>", "private", "<string.h>", "public"] },
|
||||
{ include: ["<sys/termios.h>", "private", "<termios.h>", "public"] },
|
||||
{ include: ["<sys/_termios.h>", "private", "<termios.h>", "public"] },
|
||||
{ include: ["<sys/ttycom.h>", "private", "<termios.h>", "public"] },
|
||||
{ include: ["<sys/syslimits.h>", "private", "<limits.h>", "public"] },
|
||||
{ include: ["<i386/limits.h>", "private", "<limits.h>", "public"] },
|
||||
{ include: ["<sys/limits.h>", "private", "<limits.h>", "public"] },
|
||||
{ include: ["<sys/_types/_wint_t.h>", "private", "<stddef.h>", "public"] },
|
||||
{ include: ["<sys/_select.h>", "private", "<select.h>", "public"] },
|
||||
{ include: ["<sys/cdefs.h>", "private", "<unistd.h>", "public"] },
|
||||
{ include: ["<istream>", "private", "<iostream>", "public"] },
|
||||
{ include: ["<sys/_endian.h>", "private", "<netinet/in.h>", "public"] },
|
||||
{ include: ["<sys/_types/_timespec.h>", "private", "<time.h>", "public"] },
|
||||
{ include: ["<sys/_timespec.h>", "private", "<time.h>", "public"] },
|
||||
{ include: ["<sys/spawn.h>", "private", "<spawn.h>", "public"] },
|
||||
{ include: ["<sys/dirent.h>", "private", "<dirent.h>", "public"] },
|
||||
{ include: ["<__mutex_base>", "private", "<mutex>", "public"] },
|
||||
{ include: ["<__hash_table>", "private", "<unordered_map>", "public"] },
|
||||
{ include: ["<__hash_table>", "private", "<unordered_set>", "public"] },
|
||||
# { include: ["<>", "private", "<>", "public"] },
|
||||
|
||||
{ symbol: ["size_t", "private", "<cstddef>", "public"] },
|
||||
{ symbol: ["mutex", "private", "<mutex>", "public"] },
|
||||
{ symbol: ["sig_atomic_t", "private", "<csignal>", "public"] },
|
||||
{ symbol: ["va_end", "private", "<stdarg.h>", "public"] },
|
||||
{ symbol: ["va_list", "private", "<stdarg.h>", "public"] },
|
||||
{ symbol: ["va_start", "private", "<stdarg.h>", "public"] },
|
||||
{ symbol: ["NULL", "private", "<stddef.h>", "public"] },
|
||||
{ symbol: ["NULL", "private", "<stdlib.h>", "public"] },
|
||||
{ symbol: ["NULL", "private", "<stdio.h>", "public"] },
|
||||
{ symbol: ["NULL", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["off_t", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["off_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["size_t", "private", "<stddef.h>", "public"] },
|
||||
{ symbol: ["ssize_t", "private", "<stddef.h>", "public"] },
|
||||
{ symbol: ["intptr_t", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["gid_t", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["uid_t", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["pid_t", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["pid_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["uid_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["gid_t", "private", "<sys/types.h>", "public"] },
|
||||
{ symbol: ["timeval", "private", "<sys/time.h>", "public"] },
|
||||
{ symbol: ["__uint32_t", "private", "<stdint.h>", "public"] },
|
||||
{ symbol: ["uint32_t", "private", "<stdint.h>", "public"] },
|
||||
{ symbol: ["intptr_t", "private", "<stdint.h>", "public"] },
|
||||
{ symbol: ["tparm", "private", "<ncurses.h>", "public"] },
|
||||
{ symbol: ["tigetflag", "private", "<ncurses.h>", "public"] },
|
||||
{ symbol: ["ERR", "private", "<ncurses.h>", "public"] },
|
||||
{ symbol: ["OK", "private", "<ncurses.h>", "public"] },
|
||||
{ symbol: ["select", "private", "<sys/select.h>", "public"] },
|
||||
{ symbol: ["_LIBCPP_VERSION", "private", "<stddef.h>", "public"] },
|
||||
{ symbol: ["_LIBCPP_VERSION", "private", "<unistd.h>", "public"] },
|
||||
{ symbol: ["MB_CUR_MAX", "private", "<xlocale.h>", "public"] },
|
||||
{ symbol: ["MB_CUR_MAX", "private", "<stdlib.h>", "public"] },
|
||||
]
|
||||
156
build_tools/lint.fish
Executable file
156
build_tools/lint.fish
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This is meant to be run by "make lint" or "make lint-all". It is not meant to
|
||||
# be run directly from a shell prompt.
|
||||
#
|
||||
set cppchecks warning,performance,portability,information,missingInclude
|
||||
set cppcheck_args
|
||||
set c_files
|
||||
set all no
|
||||
set kernel_name (uname -s)
|
||||
set machine_type (uname -m)
|
||||
|
||||
set -gx CXX $argv[1]
|
||||
set -e argv[1]
|
||||
|
||||
if test "$argv[1]" = "--all"
|
||||
set all yes
|
||||
set cppchecks "$cppchecks,unusedFunction"
|
||||
set -e argv[1]
|
||||
end
|
||||
|
||||
if test $kernel_name = Linux
|
||||
# This is an awful hack. However, the include-what-you-use program spews lots of errors like
|
||||
# /usr/include/unistd.h:226:10: fatal error: 'stddef.h' file not found
|
||||
# if we don't explicitly tell it where to find the system headers on Linux. See
|
||||
# http://stackoverflow.com/questions/19642590/libtooling-cant-find-stddef-h-nor-other-headers/
|
||||
set -l sys_includes (eval $CXX -v -c src/builtin.cpp 2>&1 | \
|
||||
sed -n -e '/^#include <...> search/,/^End of search list/s/^ *//p')[2..-2]
|
||||
set -x CPLUS_INCLUDE_PATH (string join ':' $sys_includes)
|
||||
end
|
||||
|
||||
# We only want -D and -I options to be passed thru to cppcheck.
|
||||
for arg in $argv
|
||||
if string match -q -- '-D*' $arg
|
||||
set cppcheck_args $cppcheck_args $arg
|
||||
else if string match -q -- '-I*' $arg
|
||||
set cppcheck_args $cppcheck_args $arg
|
||||
else if string match -q -- '-iquote*' $arg
|
||||
set cppcheck_args $cppcheck_args $arg
|
||||
end
|
||||
end
|
||||
|
||||
# Not sure when this became necessary but without these flags cppcheck no longer works on macOS.
|
||||
# It complains that "Cppcheck cannot find all the include files." Adding these include paths should
|
||||
# be harmless everywhere else.
|
||||
set cppcheck_args $cppcheck_args -I /usr/include -I .
|
||||
|
||||
if test "$machine_type" = "x86_64"
|
||||
set cppcheck_args -D__x86_64__ -D__LP64__ $cppcheck_args
|
||||
end
|
||||
|
||||
if test $all = yes
|
||||
set c_files src/*.cpp
|
||||
else
|
||||
# We haven't been asked to lint all the source. If there are uncommitted
|
||||
# changes lint those, else lint the files in the most recent commit.
|
||||
# Select (cached files) (modified but not cached, and untracked files)
|
||||
set files (git diff-index --cached HEAD --name-only)
|
||||
set files $files (git ls-files --exclude-standard --others --modified)
|
||||
if not set -q files[1]
|
||||
# No pending changes so lint the files in the most recent commit.
|
||||
set files (git diff-tree --no-commit-id --name-only -r HEAD)
|
||||
end
|
||||
|
||||
# Extract just the C/C++ files that exist.
|
||||
set c_files
|
||||
for file in (string match -r '.*\.c(?:pp)?$' -- $files)
|
||||
test -f $file; and set c_files $c_files $file
|
||||
end
|
||||
end
|
||||
|
||||
# We now have a list of files to check so run the linters.
|
||||
if set -q c_files[1]
|
||||
if type -q include-what-you-use
|
||||
echo
|
||||
echo ========================================
|
||||
echo Running IWYU
|
||||
echo ========================================
|
||||
for c_file in $c_files
|
||||
switch $kernel_name
|
||||
case Darwin FreeBSD
|
||||
include-what-you-use -Xiwyu --no_default_mappings -Xiwyu \
|
||||
--mapping_file=build_tools/iwyu.osx.imp --std=c++11 \
|
||||
$cppcheck_args $c_file 2>&1
|
||||
case Linux
|
||||
include-what-you-use -Xiwyu --mapping_file=build_tools/iwyu.linux.imp \
|
||||
$cppcheck_args $c_file 2>&1
|
||||
case '*' # hope for the best
|
||||
include-what-you-use --std=c++11 $cppcheck_args $c_file 2>&1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if type -q cppcheck
|
||||
echo
|
||||
echo ========================================
|
||||
echo Running cppcheck
|
||||
echo ========================================
|
||||
# The stderr to stdout redirection is because cppcheck, incorrectly IMHO, writes its
|
||||
# diagnostic messages to stderr. Anyone running this who wants to capture its output will
|
||||
# expect those messages to be written to stdout.
|
||||
set -l cn (set_color normal)
|
||||
set -l cb (set_color --bold)
|
||||
set -l cu (set_color --underline)
|
||||
set -l cm (set_color magenta)
|
||||
set -l cbrm (set_color brmagenta)
|
||||
set -l template "[$cb$cu{file}$cn$cb:{line}$cn] $cbrm{severity}$cm ({id}):$cn\n {message}"
|
||||
set cppcheck_args -q --verbose --std=c++11 --std=posix --language=c++ --template $template \
|
||||
--suppress=missingIncludeSystem --inline-suppr --enable=$cppchecks \
|
||||
--rule-file=.cppcheck.rules --suppressions-list=.cppcheck.suppressions $cppcheck_args
|
||||
|
||||
cppcheck $cppcheck_args $c_files 2>&1
|
||||
|
||||
echo
|
||||
echo ========================================
|
||||
echo 'Running `cppcheck --check-config` to identify missing includes and similar problems.'
|
||||
echo 'Ignore unmatchedSuppression warnings as they are probably false positives we'
|
||||
echo 'cannot suppress.'
|
||||
echo ========================================
|
||||
cppcheck $cppcheck_args --check-config $c_files 2>&1
|
||||
end
|
||||
|
||||
if type -q oclint
|
||||
echo
|
||||
echo ========================================
|
||||
echo Running oclint
|
||||
echo ========================================
|
||||
# The stderr to stdout redirection is because oclint, incorrectly writes its final summary
|
||||
# counts of the errors detected to stderr. Anyone running this who wants to capture its
|
||||
# output will expect those messages to be written to stdout.
|
||||
if test "$kernel_name" = "Darwin"
|
||||
if not test -f compile_commands.json
|
||||
xcodebuild -alltargets >xcodebuild.log
|
||||
oclint-xcodebuild xcodebuild.log >/dev/null
|
||||
end
|
||||
if test $all = yes
|
||||
oclint-json-compilation-database -e '/pcre2-10.22/' -- -enable-global-analysis 2>&1
|
||||
else
|
||||
set i_files
|
||||
for f in $c_files
|
||||
set i_files $i_files -i $f
|
||||
end
|
||||
echo oclint-json-compilation-database -e '/pcre2-10.22/' $i_files
|
||||
oclint-json-compilation-database -e '/pcre2-10.22/' $i_files 2>&1
|
||||
end
|
||||
else
|
||||
# Presumably we're on Linux or other platform not requiring special
|
||||
# handling for oclint to work.
|
||||
oclint $c_files -- $argv 2>&1
|
||||
end
|
||||
end
|
||||
else
|
||||
echo
|
||||
echo 'WARNING: No C/C++ files to check'
|
||||
echo
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /usr/bin/env fish
|
||||
|
||||
set -l TAG $argv[1]
|
||||
set TAG $argv[1]
|
||||
|
||||
if test -z "$TAG"
|
||||
echo "Tag name required."
|
||||
@@ -12,18 +12,16 @@ if not contains -- $TAG (git tag)
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l committers_to_tag (mktemp)
|
||||
or exit 1
|
||||
set -l committers_from_tag (mktemp)
|
||||
or exit 1
|
||||
set committers_to_tag (mktemp)
|
||||
set committers_from_tag (mktemp)
|
||||
|
||||
# You might think it would be better to case-insensitively sort/compare the names
|
||||
# to produce a more natural-looking list.
|
||||
# Unicode collation tables mean that this is fraught with danger; for example, the
|
||||
# "“" character will not case-fold in UTF-8 locales. sort suggests using the C locale!
|
||||
|
||||
git log "$TAG" --format="%aN" --reverse | sort -u >$committers_to_tag
|
||||
git log "$TAG".. --format="%aN" --reverse | sort -u >$committers_from_tag
|
||||
git log "$TAG" --format="%aN" --reverse | sort -u > $committers_to_tag
|
||||
git log "$TAG".. --format="%aN" --reverse | sort -u > $committers_from_tag
|
||||
|
||||
echo New committers:
|
||||
echo (comm -13 $committers_to_tag $committers_from_tag)','
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# LSAN can detect leaks tracing back to __asan::AsanThread::ThreadStart (probably caused by our
|
||||
# threads not exiting before their TLS dtors are called). Just ignore it.
|
||||
leak:AsanThread
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Helper to notarize an .app.zip or .pkg file.
|
||||
|
||||
set -e
|
||||
|
||||
die() { echo "$*" 1>&2 ; exit 1; }
|
||||
|
||||
|
||||
test "$#" -ge 1 || die "No paths specified."
|
||||
|
||||
for INPUT in "$@"; do
|
||||
echo "Processing $INPUT"
|
||||
test -f "$INPUT" || die "Not a file: $INPUT"
|
||||
ext="${INPUT##*.}"
|
||||
{ test "$ext" = "zip" || test "$ext" = "pkg"; } || die "Unrecognized extension: $ext"
|
||||
|
||||
xcrun notarytool submit "$INPUT" --keychain-profile AC_PASSWORD --wait
|
||||
|
||||
if test "$ext" = "zip"; then
|
||||
TMPDIR=$(mktemp -d)
|
||||
echo "Extracting to $TMPDIR"
|
||||
unzip -q "$INPUT" -d "$TMPDIR"
|
||||
STAPLE_TARGET=$(echo "$TMPDIR"/*)
|
||||
else
|
||||
STAPLE_TARGET="$INPUT"
|
||||
fi
|
||||
echo "Stapling $STAPLE_TARGET"
|
||||
xcrun stapler staple "$STAPLE_TARGET"
|
||||
|
||||
if test "$ext" = "zip"; then
|
||||
# Zip it back up.
|
||||
INPUT_FULL=$(realpath "$INPUT")
|
||||
rm -f "$INPUT"
|
||||
cd "$(dirname "$STAPLE_TARGET")"
|
||||
zip -r -q "$INPUT_FULL" "$(basename "$STAPLE_TARGET")"
|
||||
fi
|
||||
echo "Processed $INPUT"
|
||||
|
||||
if test "$ext" = "zip"; then
|
||||
spctl -a -v "$STAPLE_TARGET"
|
||||
fi
|
||||
done
|
||||
@@ -1,183 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
# Script to produce an OS X installer .pkg and .app(.zip)
|
||||
|
||||
usage() {
|
||||
echo "Build macOS packages, optionally signing and notarizing them."
|
||||
echo "Usage: $0 options"
|
||||
echo "Options:"
|
||||
echo " -s Enables code signing"
|
||||
echo " -f <APP_KEY.p12> Path to .p12 file for application signing"
|
||||
echo " -i <INSTALLER_KEY.p12> Path to .p12 file for installer signing"
|
||||
echo " -p <PASSWORD> Password for the .p12 files (necessary to access the certificates)"
|
||||
echo " -e <entitlements file> (Optional) Path to an entitlements XML file"
|
||||
echo " -n Enables notarization. This will fail if code signing is not also enabled."
|
||||
echo " -j <API_KEY.JSON> Path to JSON file generated with \`rcodesign encode-app-store-connect-api-key\` (required for notarization)"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
SIGN=
|
||||
NOTARIZE=
|
||||
|
||||
ARM64_DEPLOY_TARGET='MACOSX_DEPLOYMENT_TARGET=11.0'
|
||||
X86_64_DEPLOY_TARGET='MACOSX_DEPLOYMENT_TARGET=10.9'
|
||||
|
||||
# As of this writing, the most recent Rust release supports macOS back to 10.12.
|
||||
# The first supported version of macOS on arm64 is 10.15, so any Rust is fine for arm64.
|
||||
# We wish to support back to 10.9 on x86-64; the last version of Rust to support that is
|
||||
# version 1.73.0.
|
||||
RUST_VERSION_X86_64=1.73.0
|
||||
|
||||
while getopts "sf:i:p:e:nj:" opt; do
|
||||
case $opt in
|
||||
s) SIGN=1;;
|
||||
f) P12_APP_FILE=$(realpath "$OPTARG");;
|
||||
i) P12_INSTALL_FILE=$(realpath "$OPTARG");;
|
||||
p) P12_PASSWORD="$OPTARG";;
|
||||
e) ENTITLEMENTS_FILE=$(realpath "$OPTARG");;
|
||||
n) NOTARIZE=1;;
|
||||
j) API_KEY_FILE=$(realpath "$OPTARG");;
|
||||
\?) usage;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$SIGN" ] && { [ -z "$P12_APP_FILE" ] || [ -z "$P12_INSTALL_FILE" ] || [ -z "$P12_PASSWORD" ]; }; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -n "$NOTARIZE" ] && [ -z "$API_KEY_FILE" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
VERSION=$(git describe --always --dirty 2>/dev/null)
|
||||
VERSION=`git describe --always --dirty 2>/dev/null`
|
||||
if test -z "$VERSION" ; then
|
||||
echo "Could not get version from git"
|
||||
if test -f version; then
|
||||
VERSION=$(cat version)
|
||||
VERSION=`sed -E -n 's/^.*PACKAGE_VERSION "([0-9a-z.\-]+)"/\1/p' osx/config.h`
|
||||
if test -z "$VERSION"; then
|
||||
echo "Could not get version from osx/config.h"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Version is $VERSION"
|
||||
|
||||
PKGDIR=$(mktemp -d)
|
||||
echo "$PKGDIR"
|
||||
set -x
|
||||
|
||||
make distclean
|
||||
|
||||
#Exit on error
|
||||
set -e
|
||||
|
||||
PKGDIR=`mktemp -d`
|
||||
|
||||
SRC_DIR=$PWD
|
||||
OUTPUT_PATH=${FISH_ARTEFACT_PATH:-~/fish_built}
|
||||
|
||||
mkdir -p "$PKGDIR/build_x86_64" "$PKGDIR/build_arm64" "$PKGDIR/root" "$PKGDIR/intermediates" "$PKGDIR/dst"
|
||||
mkdir -p $PKGDIR/root $PKGDIR/intermediates $PKGDIR/dst
|
||||
xcodebuild install -scheme install_tree -configuration Release DSTROOT=$PKGDIR/root/
|
||||
pkgbuild --scripts build_tools/osx_package_scripts --root $PKGDIR/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" $PKGDIR/intermediates/fish.pkg
|
||||
|
||||
# Build and install for arm64.
|
||||
# Pass FISH_USE_SYSTEM_PCRE2=OFF because a system PCRE2 on macOS will not be signed by fish,
|
||||
# and will probably not be built universal, so the package will fail to validate/run on other systems.
|
||||
# Note CMAKE_OSX_ARCHITECTURES is still relevant for the Mac app.
|
||||
{ cd "$PKGDIR/build_arm64" \
|
||||
&& cmake \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-ld_classic" \
|
||||
-DWITH_GETTEXT=OFF \
|
||||
-DRust_CARGO_TARGET=aarch64-apple-darwin \
|
||||
-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' \
|
||||
-DFISH_USE_SYSTEM_PCRE2=OFF \
|
||||
"$SRC_DIR" \
|
||||
&& env $ARM64_DEPLOY_TARGET make VERBOSE=1 -j 12 \
|
||||
&& env DESTDIR="$PKGDIR/root/" $ARM64_DEPLOY_TARGET make install;
|
||||
}
|
||||
productbuild --package-path $PKGDIR/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ $OUTPUT_PATH/fish-$VERSION.pkg
|
||||
|
||||
# Build for x86-64 but do not install; instead we will make some fat binaries inside the root.
|
||||
# Set RUST_VERSION_X86_64 to the last version of Rust that supports macOS 10.9.
|
||||
{ cd "$PKGDIR/build_x86_64" \
|
||||
&& cmake \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-ld_classic" \
|
||||
-DWITH_GETTEXT=OFF \
|
||||
-DRust_TOOLCHAIN="$RUST_VERSION_X86_64" \
|
||||
-DRust_CARGO_TARGET=x86_64-apple-darwin \
|
||||
-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' \
|
||||
-DFISH_USE_SYSTEM_PCRE2=OFF "$SRC_DIR" \
|
||||
&& env $X86_64_DEPLOY_TARGET make VERBOSE=1 -j 12; }
|
||||
|
||||
# Fatten them up.
|
||||
for FILE in "$PKGDIR"/root/usr/local/bin/*; do
|
||||
X86_FILE="$PKGDIR/build_x86_64/$(basename "$FILE")"
|
||||
rcodesign macho-universal-create --output "$FILE" "$FILE" "$X86_FILE"
|
||||
chmod 755 "$FILE"
|
||||
done
|
||||
|
||||
if test -n "$SIGN"; then
|
||||
echo "Signing executables"
|
||||
ARGS=(
|
||||
--p12-file "$P12_APP_FILE"
|
||||
--p12-password "$P12_PASSWORD"
|
||||
--code-signature-flags runtime
|
||||
--for-notarization
|
||||
)
|
||||
if [ -n "$ENTITLEMENTS_FILE" ]; then
|
||||
ARGS+=(--entitlements-xml-file "$ENTITLEMENTS_FILE")
|
||||
fi
|
||||
for FILE in "$PKGDIR"/root/usr/local/bin/*; do
|
||||
(set +x; rcodesign sign "${ARGS[@]}" "$FILE")
|
||||
done
|
||||
fi
|
||||
|
||||
pkgbuild --scripts "$SRC_DIR/build_tools/osx_package_scripts" --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg"
|
||||
productbuild --package-path "$PKGDIR/intermediates" --distribution "$SRC_DIR/build_tools/osx_distribution.xml" --resources "$SRC_DIR/build_tools/osx_package_resources/" "$OUTPUT_PATH/fish-$VERSION.pkg"
|
||||
|
||||
if test -n "$SIGN"; then
|
||||
echo "Signing installer"
|
||||
ARGS=(
|
||||
--p12-file "$P12_INSTALL_FILE"
|
||||
--p12-password "$P12_PASSWORD"
|
||||
--code-signature-flags runtime
|
||||
--for-notarization
|
||||
)
|
||||
(set +x; rcodesign sign "${ARGS[@]}" "$OUTPUT_PATH/fish-$VERSION.pkg")
|
||||
fi
|
||||
|
||||
# Make the app
|
||||
(cd "$PKGDIR/build_arm64" && env $ARM64_DEPLOY_TARGET make -j 12 fish_macapp)
|
||||
(cd "$PKGDIR/build_x86_64" && env $X86_64_DEPLOY_TARGET make -j 12 fish_macapp)
|
||||
xcodebuild -scheme fish.app -configuration Release DSTROOT=/tmp/fish_app/ SYMROOT=DerivedData/fish/Build/Products
|
||||
|
||||
# Make the app's /usr/local/bin binaries universal. Note fish.app/Contents/MacOS/fish already is, courtesy of CMake.
|
||||
cd "$PKGDIR/build_arm64"
|
||||
for FILE in fish.app/Contents/Resources/base/usr/local/bin/*; do
|
||||
X86_FILE="$PKGDIR/build_x86_64/fish.app/Contents/Resources/base/usr/local/bin/$(basename "$FILE")"
|
||||
rcodesign macho-universal-create --output "$FILE" "$FILE" "$X86_FILE"
|
||||
cd DerivedData/fish/Build/Products/Release/
|
||||
zip -r $OUTPUT_PATH/fish-$VERSION.app.zip fish.app
|
||||
|
||||
# macho-universal-create screws up the permissions.
|
||||
chmod 755 "$FILE"
|
||||
done
|
||||
|
||||
if test -n "$SIGN"; then
|
||||
echo "Signing app"
|
||||
ARGS=(
|
||||
--p12-file "$P12_APP_FILE"
|
||||
--p12-password "$P12_PASSWORD"
|
||||
--code-signature-flags runtime
|
||||
--for-notarization
|
||||
)
|
||||
if [ -n "$ENTITLEMENTS_FILE" ]; then
|
||||
ARGS+=(--entitlements-xml-file "$ENTITLEMENTS_FILE")
|
||||
fi
|
||||
(set +x; rcodesign sign "${ARGS[@]}" "fish.app")
|
||||
|
||||
fi
|
||||
|
||||
cp -R "fish.app" "$OUTPUT_PATH/fish-$VERSION.app"
|
||||
cd "$OUTPUT_PATH"
|
||||
|
||||
# Maybe notarize.
|
||||
if test -n "$NOTARIZE"; then
|
||||
echo "Notarizing"
|
||||
rcodesign notarize --staple --wait --max-wait-seconds 1800 --api-key-file "$API_KEY_FILE" "$OUTPUT_PATH/fish-$VERSION.pkg"
|
||||
rcodesign notarize --staple --wait --max-wait-seconds 1800 --api-key-file "$API_KEY_FILE" "$OUTPUT_PATH/fish-$VERSION.app"
|
||||
fi
|
||||
|
||||
# Zip it up.
|
||||
zip -r "fish-$VERSION.app.zip" "fish-$VERSION.app" && rm -Rf "fish-$VERSION.app"
|
||||
|
||||
rm -rf "$PKGDIR"
|
||||
rm -r $PKGDIR
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Script to generate a tarball
|
||||
# We use git to output a tree. But we also want to build the user documentation
|
||||
# and put that in the tarball, so that nobody needs to have sphinx installed
|
||||
# and put that in the tarball, so that nobody needs to have doxygen installed
|
||||
# to build it.
|
||||
# Outputs to $FISH_ARTEFACT_PATH or ~/fish_built by default
|
||||
|
||||
@@ -14,15 +14,8 @@ set -e
|
||||
# but to get the documentation in, we need to make a symlink called "fish-VERSION"
|
||||
# and tar from that, so that the documentation gets the right prefix
|
||||
|
||||
# Use Ninja if available, as it automatically paralellises
|
||||
BUILD_TOOL="make"
|
||||
BUILD_GENERATOR="Unix Makefiles"
|
||||
if command -v ninja >/dev/null; then
|
||||
BUILD_TOOL="ninja"
|
||||
BUILD_GENERATOR="Ninja"
|
||||
fi
|
||||
|
||||
# We need GNU tar as that supports the --mtime and --transform options
|
||||
# We need GNU tar as that supports the --mtime option
|
||||
# BSD tar supports --mtree but keeping them in sync sounds too hard
|
||||
TAR=notfound
|
||||
for try in tar gtar gnutar; do
|
||||
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||
@@ -40,7 +33,7 @@ fi
|
||||
wd="$PWD"
|
||||
|
||||
# Get the version from git-describe
|
||||
VERSION=$(git describe --dirty 2>/dev/null)
|
||||
VERSION=`git describe --dirty 2>/dev/null`
|
||||
|
||||
# The name of the prefix, which is the directory that you get when you untar
|
||||
prefix="fish-$VERSION"
|
||||
@@ -50,30 +43,35 @@ prefix="fish-$VERSION"
|
||||
path=${FISH_ARTEFACT_PATH:-~/fish_built}/$prefix.tar
|
||||
|
||||
# Clean up stuff we've written before
|
||||
rm -f "$path" "$path".xz
|
||||
rm -f "$path" "$path".gz
|
||||
|
||||
# git starts the archive
|
||||
git archive --format=tar --prefix="$prefix"/ HEAD > "$path"
|
||||
|
||||
# tarball out the documentation, generate a version file
|
||||
PREFIX_TMPDIR=$(mktemp -d)
|
||||
cd "$PREFIX_TMPDIR"
|
||||
echo "$VERSION" > version
|
||||
cmake -G "$BUILD_GENERATOR" -DCMAKE_BUILD_TYPE=Debug "$wd"
|
||||
$BUILD_TOOL doc
|
||||
# tarball out the documentation, generate a configure script and version file
|
||||
autoreconf --no-recursive
|
||||
./configure --with-doxygen
|
||||
make doc share/man
|
||||
echo $VERSION > version
|
||||
|
||||
TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 \
|
||||
--mode=g+w,a+rX --transform s/^/$prefix\//"
|
||||
$TAR_APPEND --no-recursion user_doc
|
||||
$TAR_APPEND user_doc/html user_doc/man
|
||||
$TAR_APPEND version
|
||||
PREFIX_TMPDIR=`mktemp -d`
|
||||
cd $PREFIX_TMPDIR
|
||||
|
||||
ln -s "$wd" "$prefix"
|
||||
TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 --mode=g+w,a+rX"
|
||||
$TAR_APPEND --no-recursion "$prefix"/user_doc
|
||||
$TAR_APPEND "$prefix"/user_doc/html "$prefix"/share/man
|
||||
$TAR_APPEND "$prefix"/version
|
||||
$TAR_APPEND "$prefix"/configure "$prefix"/config.h.in
|
||||
rm "$prefix"/version
|
||||
unlink "$prefix"
|
||||
|
||||
cd -
|
||||
rm -r "$PREFIX_TMPDIR"
|
||||
rmdir $PREFIX_TMPDIR
|
||||
|
||||
# xz it
|
||||
xz "$path"
|
||||
# gzip it
|
||||
gzip "$path"
|
||||
|
||||
# Output what we did, and the sha256 hash
|
||||
echo "Tarball written to $path".xz
|
||||
openssl dgst -sha256 "$path".xz
|
||||
# Output what we did, and the sha1 hash
|
||||
echo "Tarball written to $path".gz
|
||||
openssl dgst -sha256 "$path".gz
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script to generate a tarball of vendored (downloaded) Rust dependencies
|
||||
# and the cargo configuration to ensure they are used
|
||||
# This tarball should be unpacked into a fish source directory
|
||||
# Outputs to $FISH_ARTEFACT_PATH or ~/fish_built by default
|
||||
|
||||
# Exit on error
|
||||
set -e
|
||||
|
||||
# We need GNU tar as that supports the --mtime and --transform options
|
||||
TAR=notfound
|
||||
for try in tar gtar gnutar; do
|
||||
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||
TAR=$try
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$TAR" = "notfound" ]; then
|
||||
echo 'No suitable tar (supporting --mtime) found as tar/gtar/gnutar in PATH'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the current directory, which we'll use for telling Cargo where to find the sources
|
||||
wd="$PWD"
|
||||
|
||||
# Get the version from git-describe
|
||||
VERSION=$(git describe --dirty 2>/dev/null)
|
||||
|
||||
# The name of the prefix, which is the directory that you get when you untar
|
||||
prefix="fish-$VERSION"
|
||||
|
||||
# The path where we will output the tar file
|
||||
# Defaults to ~/fish_built
|
||||
path=${FISH_ARTEFACT_PATH:-~/fish_built}/$prefix-vendor.tar
|
||||
|
||||
# Clean up stuff we've written before
|
||||
rm -f "$path" "$path".xz
|
||||
|
||||
# Work in a temporary directory to avoid clobbering the source directory
|
||||
PREFIX_TMPDIR=$(mktemp -d)
|
||||
cd "$PREFIX_TMPDIR"
|
||||
|
||||
mkdir .cargo
|
||||
cargo vendor --manifest-path "$wd/Cargo.toml" > .cargo/config.toml
|
||||
|
||||
tar cfvJ "$path".xz vendor .cargo
|
||||
|
||||
cd -
|
||||
rm -r "$PREFIX_TMPDIR"
|
||||
|
||||
# Output what we did, and the sha256 hash
|
||||
echo "Tarball written to $path".xz
|
||||
openssl dgst -sha256 "$path".xz
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<installer-gui-script minSpecVersion="1">
|
||||
<title>fish shell</title>
|
||||
<welcome file="welcome.html" mime-type="text/html"/>
|
||||
<welcome file="welcome.rtf"/>
|
||||
<background file="terminal_logo.png" scaling="proportional" alignment="bottomleft"/>
|
||||
<pkg-ref id="com.ridiculousfish.fish-shell-pkg"/>
|
||||
<options hostArchitectures="arm64,x86_64" rootVolumeOnly="true"/>
|
||||
<options customize="never" require-scripts="true"/>
|
||||
<options customize="never" require-scripts="false"/>
|
||||
<choices-outline>
|
||||
<line choice="default">
|
||||
<line choice="com.ridiculousfish.fish-shell-pkg"/>
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font-family: system-ui, -apple-system, "Helvetica Neue", sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
code, tt {
|
||||
font-family: ui-monospace, Menlo, monospace;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<strong>fish</strong> is a smart and user-friendly command line shell. For more information, visit <a href="https://fishshell.com">fishshell.com</a>.
|
||||
</p>
|
||||
<p>
|
||||
<strong>fish</strong> will be installed into <tt>/usr/local/</tt>, and its path will be added to <wbr><tt>/etc/shells</tt> if necessary.
|
||||
</p>
|
||||
<p>
|
||||
Your default shell will <em>not</em> be changed. To make <strong>fish</strong> your login shell after the installation, run:
|
||||
</p>
|
||||
<p>
|
||||
<code>chsh -s /usr/local/bin/fish</code>
|
||||
</p>
|
||||
<p>Enjoy! Bugs can be reported on <a href="https://github.org/fish-shell/fish-shell/">GitHub</a>.</p>
|
||||
</body>
|
||||
</html>
|
||||
26
build_tools/osx_package_resources/welcome.rtf
Normal file
26
build_tools/osx_package_resources/welcome.rtf
Normal file
@@ -0,0 +1,26 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1485\cocoasubrtf410
|
||||
{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;\f1\fnil\fcharset0 Menlo-Regular;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;\csgenericrgb\c100000\c100000\c100000;}
|
||||
{\info
|
||||
{\author dlkfjslfjsfdlkfk}}\margl1440\margr1440\vieww10800\viewh8400\viewkind0
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs30 \cf0 Fish is a smart and user friendly command line shell. For more information, visit {\field{\*\fldinst{HYPERLINK "https://fishshell.com"}}{\fldrslt https://fishshell.com}}\
|
||||
\
|
||||
fish will be installed into
|
||||
\f1\fs26 /usr/local/
|
||||
\f0\fs30 , and fish will be added to
|
||||
\f1\fs26 /etc/shells
|
||||
\f0\fs30 if necessary.\
|
||||
\
|
||||
Your default shell will
|
||||
\i not
|
||||
\i0 be changed. To make fish your default, run:\
|
||||
\
|
||||
|
||||
\f1 chsh -s /usr/local/bin/fish
|
||||
\f0 \
|
||||
\
|
||||
Enjoy!\
|
||||
}
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
if test $# -eq 0
|
||||
then
|
||||
echo "usage: $0 shellname [shellname ...]"
|
||||
echo usage: $0 shellname [shellname ...]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
scriptname=$(basename "$0")
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
scriptname=`basename "$0"`
|
||||
if [[ $UID -ne 0 ]]; then
|
||||
echo "${scriptname} must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
@@ -20,7 +20,6 @@ tmpfile=${file}.tmp
|
||||
|
||||
set -o noclobber
|
||||
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -f $tmpfile" EXIT
|
||||
|
||||
if ! cat $file > $tmpfile
|
||||
@@ -33,13 +32,15 @@ EOF
|
||||
fi
|
||||
|
||||
# Append a newline if it doesn't exist
|
||||
[ -z "$(tail -c1 "$tmpfile")" ] || echo "" >> "$tmpfile"
|
||||
if [ "$(tail -c1 "$tmpfile"; echo x)" != $'\nx' ]; then
|
||||
echo "" >> "$tmpfile"
|
||||
fi
|
||||
|
||||
for i
|
||||
do
|
||||
if ! grep -q "^${i}$" "$tmpfile"
|
||||
then
|
||||
echo "$i" >> "$tmpfile"
|
||||
echo $i >> "$tmpfile"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
./add-shell "${DSTVOLUME}"usr/local/bin/fish
|
||||
./add-shell /usr/local/bin/fish > /tmp/fish_postinstall_output.log
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
echo "Removing any previous installation"
|
||||
pkgutil --pkg-info "${INSTALL_PKG_SESSION_ID}" && pkgutil --only-files --files "${INSTALL_PKG_SESSION_ID}" | while read -r installed
|
||||
do rm -v "${DSTVOLUME}${installed}"
|
||||
done
|
||||
echo "... removed"
|
||||
@@ -1,14 +1,17 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This is meant to be run by "make style" or "make style-all". It is not meant to
|
||||
# be run directly from a shell prompt although it can be.
|
||||
#
|
||||
# This runs C++ files and fish scripts (*.fish) through their respective code
|
||||
# formatting programs.
|
||||
#
|
||||
set -l fish_files
|
||||
set -l python_files
|
||||
set -l rust_files
|
||||
set -l all no
|
||||
set git_clang_format no
|
||||
set c_files
|
||||
set f_files
|
||||
set all no
|
||||
|
||||
if test "$argv[1]" = --all
|
||||
if test "$argv[1]" = "--all"
|
||||
set all yes
|
||||
set -e argv[1]
|
||||
end
|
||||
@@ -19,58 +22,94 @@ if set -q argv[1]
|
||||
end
|
||||
|
||||
if test $all = yes
|
||||
set -l files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//')
|
||||
set files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//')
|
||||
if set -q files[1]
|
||||
echo
|
||||
echo 'You have uncommitted changes. Are you sure you want to restyle?'
|
||||
read -P 'y/N? ' -n1 -l ans
|
||||
if not string match -qi y -- $ans
|
||||
exit 1
|
||||
end
|
||||
echo You have uncommited changes. Cowardly refusing to restyle the entire code base.
|
||||
echo
|
||||
exit 1
|
||||
end
|
||||
set fish_files share/**.fish
|
||||
set python_files {doc_src,share,tests}/**.py
|
||||
set rust_files fish-rust/src/**.rs
|
||||
set c_files src/*.h src/*.cpp src/*.c
|
||||
# For now we don't restyle all fish scripts other than completion scripts. That's because people
|
||||
# really like to vertically align the elements of the `complete` command and fish_indent
|
||||
# currently does not honor that whitespace.
|
||||
set f_files (printf '%s\n' share/***.fish | grep -v /completions/)
|
||||
else
|
||||
# We haven't been asked to reformat all the source. If there are uncommitted changes reformat
|
||||
# those using `git clang-format`. Else reformat the files in the most recent commit.
|
||||
# Select (cached files) (modified but not cached, and untracked files)
|
||||
set files (git diff-index --cached HEAD --name-only) (git ls-files --exclude-standard --others --modified)
|
||||
if set -q files[1]
|
||||
set git_clang_format yes
|
||||
else
|
||||
# No pending changes so lint the files in the most recent commit.
|
||||
set files (git diff-tree --no-commit-id --name-only -r HEAD)
|
||||
end
|
||||
|
||||
# Extract just the C/C++ files that exist.
|
||||
set c_files
|
||||
for file in (string match -r '^.*\.(?:c|cpp|h)$' -- $files)
|
||||
test -f $file; and set c_files $c_files $file
|
||||
end
|
||||
# Extract just the fish files.
|
||||
set fish_files (string match -r '^.*\.fish$' -- $files)
|
||||
set python_files (string match -r '^.*\.py$' -- $files)
|
||||
set rust_files (string match -r '^.*\.rs$' -- $files)
|
||||
set f_files (string match -r '^.*\.fish$' -- $files)
|
||||
end
|
||||
|
||||
set -l red (set_color red)
|
||||
set -l green (set_color green)
|
||||
set -l blue (set_color blue)
|
||||
set -l normal (set_color normal)
|
||||
# Run the C++ reformatter if we have any C++ files.
|
||||
if set -q c_files[1]
|
||||
if test $git_clang_format = yes
|
||||
if type -q git-clang-format
|
||||
echo
|
||||
echo ========================================
|
||||
echo Running git-clang-format
|
||||
echo ========================================
|
||||
git add $c_files
|
||||
git-clang-format
|
||||
else
|
||||
echo
|
||||
echo 'WARNING: Cannot find git-clang-format command'
|
||||
echo
|
||||
end
|
||||
else if type -q clang-format
|
||||
echo
|
||||
echo ========================================
|
||||
echo Running clang-format
|
||||
echo ========================================
|
||||
for file in $c_files
|
||||
cp $file $file.new # preserves mode bits
|
||||
clang-format $file >$file.new
|
||||
if cmp --quiet $file $file.new
|
||||
rm $file.new
|
||||
else
|
||||
echo $file was NOT correctly formatted
|
||||
mv $file.new $file
|
||||
end
|
||||
end
|
||||
else
|
||||
echo
|
||||
echo 'WARNING: Cannot find clang-format command'
|
||||
echo
|
||||
end
|
||||
end
|
||||
|
||||
# Run the fish reformatter if we have any fish files.
|
||||
if set -q fish_files[1]
|
||||
if set -q f_files[1]
|
||||
if not type -q fish_indent
|
||||
make fish_indent
|
||||
set PATH . $PATH
|
||||
end
|
||||
echo === Running "$green"fish_indent"$normal"
|
||||
fish_indent -w -- $fish_files
|
||||
end
|
||||
|
||||
if set -q python_files[1]
|
||||
if not type -q black
|
||||
echo
|
||||
echo Please install "`black`" to style python
|
||||
echo
|
||||
else
|
||||
echo === Running "$blue"black"$normal"
|
||||
black $python_files
|
||||
end
|
||||
end
|
||||
|
||||
if set -q rust_files[1]
|
||||
if not type -q rustfmt
|
||||
echo
|
||||
echo Please install "`rustfmt`" to style rust
|
||||
echo
|
||||
else
|
||||
echo === Running "$blue"rustfmt"$normal"
|
||||
rustfmt $rust_files
|
||||
echo
|
||||
echo ========================================
|
||||
echo Running fish_indent
|
||||
echo ========================================
|
||||
for file in $f_files
|
||||
cp $file $file.new # preserves mode bits
|
||||
fish_indent <$file >$file.new
|
||||
if cmp --quiet $file $file.new
|
||||
rm $file.new
|
||||
else
|
||||
echo $file was NOT correctly formatted
|
||||
mv $file.new $file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
12
build_tools/xcode_version_gen.sh
Executable file
12
build_tools/xcode_version_gen.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# Expects to be called from Xcode (Run Script build phase),
|
||||
# write version number C preprocessor macro to header file.
|
||||
|
||||
ver="$SCRIPT_OUTPUT_FILE_0"
|
||||
|
||||
./build_tools/git_version_gen.sh
|
||||
|
||||
cmp --quiet "FISH-BUILD-VERSION-FILE" "$ver"
|
||||
if [ $? -ne 0 ]; then
|
||||
/bin/cp FISH-BUILD-VERSION-FILE "$ver"
|
||||
fi
|
||||
@@ -1,7 +0,0 @@
|
||||
# Support for benchmarking fish.
|
||||
|
||||
add_custom_target(benchmark
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/benchmarks/driver.sh ${CMAKE_BINARY_DIR}/fish
|
||||
DEPENDS fish
|
||||
USES_TERMINAL
|
||||
)
|
||||
123
cmake/CheckIncludeFiles.cmake
Normal file
123
cmake/CheckIncludeFiles.cmake
Normal file
@@ -0,0 +1,123 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See full license information in
|
||||
# doc_src/license.hdr or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# CheckIncludeFiles
|
||||
# -----------------
|
||||
#
|
||||
# Provides a macro to check if a list of one or more header files can
|
||||
# be included together in ``C``.
|
||||
#
|
||||
# .. command:: CHECK_INCLUDE_FILES
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CHECK_INCLUDE_FILES("<includes>" <variable> [LANGUAGE <language>])
|
||||
#
|
||||
# Check if the given ``<includes>`` list may be included together
|
||||
# in a ``C`` source file and store the result in an internal cache
|
||||
# entry named ``<variable>``. Specify the ``<includes>`` argument
|
||||
# as a :ref:`;-list <CMake Language Lists>` of header file names.
|
||||
#
|
||||
# If LANGUAGE is set, the specified compiler will be used to perform the
|
||||
# check. Acceptable values are C and CXX.
|
||||
#
|
||||
# The following variables may be set before calling this macro to modify
|
||||
# the way the check is run:
|
||||
#
|
||||
# ``CMAKE_REQUIRED_FLAGS``
|
||||
# string of compile command line flags
|
||||
# ``CMAKE_REQUIRED_DEFINITIONS``
|
||||
# list of macros to define (-DFOO=bar)
|
||||
# ``CMAKE_REQUIRED_INCLUDES``
|
||||
# list of include directories
|
||||
# ``CMAKE_REQUIRED_QUIET``
|
||||
# execute quietly without messages
|
||||
#
|
||||
# See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
|
||||
# to check for a single header file in ``C`` or ``CXX`` languages.
|
||||
|
||||
macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
||||
if(NOT DEFINED "${VARIABLE}")
|
||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
|
||||
|
||||
if("x${ARGN}" STREQUAL "x")
|
||||
if(CMAKE_C_COMPILER_LOADED)
|
||||
set(_lang C)
|
||||
elseif(CMAKE_CXX_COMPILER_LOADED)
|
||||
set(_lang CXX)
|
||||
else()
|
||||
message(FATAL_ERROR "CHECK_INCLUDE_FILES needs either C or CXX language enabled")
|
||||
endif()
|
||||
elseif("x${ARGN}" MATCHES "^xLANGUAGE;([a-zA-Z]+)$")
|
||||
set(_lang "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown arguments:\n ${ARGN}\n")
|
||||
endif()
|
||||
|
||||
if(_lang STREQUAL "C")
|
||||
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.c)
|
||||
elseif(_lang STREQUAL "CXX")
|
||||
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.cpp)
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n")
|
||||
endif()
|
||||
|
||||
if(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
|
||||
else()
|
||||
set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
|
||||
endif()
|
||||
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
|
||||
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||
foreach(FILE ${INCLUDE})
|
||||
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
|
||||
"#include <${FILE}>\n")
|
||||
endforeach()
|
||||
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
|
||||
"\n\nint main(void){return 0;}\n")
|
||||
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
|
||||
"${src}" @ONLY)
|
||||
|
||||
set(_INCLUDE ${INCLUDE}) # remove empty elements
|
||||
if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
|
||||
list(LENGTH _INCLUDE _INCLUDE_LEN)
|
||||
set(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
|
||||
elseif("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
|
||||
set(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
|
||||
else()
|
||||
set(_description "include file ${_INCLUDE}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${_description}")
|
||||
endif()
|
||||
try_compile(${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${src}
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
CMAKE_FLAGS
|
||||
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
|
||||
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${VARIABLE})
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${_description} - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if files ${INCLUDE} "
|
||||
"exist passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${_description} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if files ${INCLUDE} "
|
||||
"exist failed with the following output:\n"
|
||||
"${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
147
cmake/ConfigureChecks.cmake
Normal file
147
cmake/ConfigureChecks.cmake
Normal file
@@ -0,0 +1,147 @@
|
||||
# Detect curses.
|
||||
FIND_PACKAGE(Curses REQUIRED)
|
||||
|
||||
# Get threads.
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
# FindThreads < 3.4.0 doesn't work for C++-only projects
|
||||
IF(CMAKE_VERSION VERSION_LESS 3.4.0)
|
||||
ENABLE_LANGUAGE(C)
|
||||
ENDIF()
|
||||
FIND_PACKAGE(Threads REQUIRED)
|
||||
|
||||
IF(APPLE)
|
||||
# 10.7+ only.
|
||||
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Werror=unguarded-availability")
|
||||
ENDIF()
|
||||
|
||||
# Detect WSL. Does not match against native Windows/WIN32.
|
||||
if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-Microsoft")
|
||||
SET(WSL 1)
|
||||
endif()
|
||||
|
||||
# Set up the config.h file.
|
||||
SET(PACKAGE_NAME "fish")
|
||||
SET(PACKAGE_TARNAME "fish")
|
||||
INCLUDE(CheckCXXSymbolExists)
|
||||
INCLUDE(CheckIncludeFileCXX)
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(CheckStructHasMember)
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
INCLUDE(CheckTypeSize)
|
||||
INCLUDE(CMakePushCheckState)
|
||||
CHECK_CXX_SYMBOL_EXISTS(backtrace_symbols execinfo.h HAVE_BACKTRACE_SYMBOLS)
|
||||
CHECK_CXX_SYMBOL_EXISTS(clock_gettime time.h HAVE_CLOCK_GETTIME)
|
||||
CHECK_CXX_SYMBOL_EXISTS(ctermid_r stdio.h HAVE_CTERMID_R)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_type dirent.h HAVE_STRUCT_DIRENT_D_TYPE LANGUAGE CXX)
|
||||
CHECK_CXX_SYMBOL_EXISTS(dirfd "sys/types.h;dirent.h" HAVE_DIRFD)
|
||||
CHECK_INCLUDE_FILE_CXX(execinfo.h HAVE_EXECINFO_H)
|
||||
CHECK_CXX_SYMBOL_EXISTS(flock sys/file.h HAVE_FLOCK)
|
||||
# futimens is new in OS X 10.13 but is a weak symbol.
|
||||
# Don't assume it exists just because we can link - it may be null.
|
||||
CHECK_CXX_SYMBOL_EXISTS(futimens sys/stat.h HAVE_FUTIMENS)
|
||||
CHECK_CXX_SYMBOL_EXISTS(futimes sys/time.h HAVE_FUTIMES)
|
||||
CHECK_CXX_SYMBOL_EXISTS(getifaddrs ifaddrs.h HAVE_GETIFADDRS)
|
||||
CHECK_CXX_SYMBOL_EXISTS(getpwent pwd.h HAVE_GETPWENT)
|
||||
CHECK_CXX_SYMBOL_EXISTS(gettext libintl.h HAVE_GETTEXT)
|
||||
CHECK_CXX_SYMBOL_EXISTS(killpg "sys/types.h;signal.h" HAVE_KILLPG)
|
||||
CHECK_CXX_SYMBOL_EXISTS(lrand48_r stdlib.h HAVE_LRAND48_R)
|
||||
# mkostemp is in stdlib in glibc and FreeBSD, but unistd on macOS
|
||||
CHECK_CXX_SYMBOL_EXISTS(mkostemp "stdlib.h;unistd.h" HAVE_MKOSTEMP)
|
||||
SET(HAVE_CURSES_H ${CURSES_HAVE_CURSES_H})
|
||||
SET(HAVE_NCURSES_CURSES_H ${CURSES_HAVE_NCURSES_CURSES_H})
|
||||
SET(HAVE_NCURSES_H ${CURSES_HAVE_NCURSES_H})
|
||||
CHECK_INCLUDE_FILES("curses.h;term.h" HAVE_TERM_H)
|
||||
CHECK_INCLUDE_FILE_CXX("ncurses/term.h" HAVE_NCURSES_TERM_H)
|
||||
CHECK_INCLUDE_FILE_CXX(siginfo.h HAVE_SIGINFO_H)
|
||||
CHECK_INCLUDE_FILE_CXX(spawn.h HAVE_SPAWN_H)
|
||||
CHECK_CXX_SYMBOL_EXISTS(std::wcscasecmp wchar.h HAVE_STD__WCSCASECMP)
|
||||
CHECK_CXX_SYMBOL_EXISTS(std::wcsdup wchar.h HAVE_STD__WCSDUP)
|
||||
CHECK_CXX_SYMBOL_EXISTS(std::wcsncasecmp wchar.h HAVE_STD__WCSNCASECMP)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct stat" st_ctime_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_CTIME_NSEC
|
||||
LANGUAGE CXX)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec "sys/stat.h"
|
||||
HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC LANGUAGE CXX)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
||||
LANGUAGE CXX)
|
||||
CHECK_CXX_SYMBOL_EXISTS(sys_errlist stdio.h HAVE_SYS_ERRLIST)
|
||||
CHECK_INCLUDE_FILE_CXX(sys/ioctl.h HAVE_SYS_IOCTL_H)
|
||||
CHECK_INCLUDE_FILE_CXX(sys/select.h HAVE_SYS_SELECT_H)
|
||||
CHECK_INCLUDE_FILES("sys/types.h;sys/sysctl.h" HAVE_SYS_SYSCTL_H)
|
||||
CHECK_INCLUDE_FILE_CXX(termios.h HAVE_TERMIOS_H) # Needed for TIOCGWINSZ
|
||||
CHECK_CXX_SYMBOL_EXISTS(wcscasecmp wchar.h HAVE_WCSCASECMP)
|
||||
CHECK_CXX_SYMBOL_EXISTS(wcsdup wchar.h HAVE_WCSDUP)
|
||||
CHECK_CXX_SYMBOL_EXISTS(wcslcpy wchar.h HAVE_WCSLCPY)
|
||||
CHECK_CXX_SYMBOL_EXISTS(wcsncasecmp wchar.h HAVE_WCSNCASECMP)
|
||||
CHECK_CXX_SYMBOL_EXISTS(wcsndup wchar.h HAVE_WCSNDUP)
|
||||
|
||||
CMAKE_PUSH_CHECK_STATE(RESET)
|
||||
# `wcstod_l` is a GNU-extension, sometimes hidden behind the following define
|
||||
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE=1)
|
||||
# `xlocale.h` is required to find `wcstod_l` in `wchar.h` under FreeBSD, but
|
||||
# it's not present under Linux.
|
||||
SET(WCSTOD_L_INCLUDES "")
|
||||
CHECK_INCLUDE_FILES("xlocale.h" HAVE_XLOCALE_H)
|
||||
IF(HAVE_XLOCALE_H)
|
||||
LIST(APPEND WCSTOD_L_INCLUDES "xlocale.h")
|
||||
ENDIF()
|
||||
LIST(APPEND WCSTOD_L_INCLUDES "wchar.h")
|
||||
CHECK_CXX_SYMBOL_EXISTS(wcstod_l "${WCSTOD_L_INCLUDES}" HAVE_WCSTOD_L)
|
||||
CMAKE_POP_CHECK_STATE()
|
||||
|
||||
CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS)
|
||||
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES termios.h sys/ioctl.h)
|
||||
CHECK_TYPE_SIZE("struct winsize" STRUCT_WINSIZE LANGUAGE CXX)
|
||||
CHECK_CXX_SYMBOL_EXISTS("TIOCGWINSZ" "termios.h;sys/ioctl.h" HAVE_TIOCGWINSZ)
|
||||
IF(STRUCT_WINSIZE GREATER -1 AND HAVE_TIOCGWINSZ EQUAL 1)
|
||||
SET(HAVE_WINSIZE 1)
|
||||
ENDIF()
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
|
||||
IF(EXISTS "/proc/self/stat")
|
||||
SET(HAVE__PROC_SELF_STAT 1)
|
||||
ENDIF()
|
||||
CHECK_TYPE_SIZE("wchar_t[8]" WCHAR_T_BITS LANGUAGE CXX)
|
||||
|
||||
# Solaris, NetBSD and X/Open-conforming systems have a fixed-args tparm
|
||||
SET(TPARM_INCLUDES)
|
||||
IF(HAVE_NCURSES_H)
|
||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses.h>\n")
|
||||
ELSEIF(HAVE_NCURSES_CURSES_H)
|
||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses/curses.h>\n")
|
||||
ELSE()
|
||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <curses.h>\n")
|
||||
ENDIF()
|
||||
|
||||
IF(HAVE_TERM_H)
|
||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <term.h>\n")
|
||||
ELSEIF(HAVE_NCURSES_TERM_H)
|
||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses/term.h>\n")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
${TPARM_INCLUDES}
|
||||
|
||||
int main () {
|
||||
tparm( \"\" );
|
||||
}
|
||||
"
|
||||
TPARM_TAKES_VARARGS
|
||||
)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||
IF(NOT TPARM_TAKES_VARARGS)
|
||||
SET(TPARM_SOLARIS_KLUDGE 1)
|
||||
ENDIF()
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <memory>
|
||||
|
||||
int main () {
|
||||
std::unique_ptr<int> foo = std::make_unique<int>();
|
||||
}
|
||||
"
|
||||
HAVE_STD__MAKE_UNIQUE
|
||||
)
|
||||
|
||||
FIND_PROGRAM(SED sed)
|
||||
204
cmake/Docs.cmake
204
cmake/Docs.cmake
@@ -1,86 +1,150 @@
|
||||
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
|
||||
HINTS
|
||||
$ENV{SPHINX_DIR}
|
||||
PATH_SUFFIXES bin
|
||||
DOC "Sphinx documentation generator")
|
||||
FIND_PACKAGE(Doxygen 1.8.7)
|
||||
|
||||
include(FeatureSummary)
|
||||
INCLUDE(FeatureSummary)
|
||||
|
||||
set(SPHINX_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc_src")
|
||||
set(SPHINX_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/user_doc")
|
||||
set(SPHINX_BUILD_DIR "${SPHINX_ROOT_DIR}/build")
|
||||
set(SPHINX_HTML_DIR "${SPHINX_ROOT_DIR}/html")
|
||||
set(SPHINX_MANPAGE_DIR "${SPHINX_ROOT_DIR}/man")
|
||||
IF(DOXYGEN_FOUND)
|
||||
OPTION(BUILD_DOCS "build documentation (requires Doxygen)" ON)
|
||||
ELSE(DOXYGEN_FOUND)
|
||||
OPTION(BUILD_DOCS "build documentation (requires Doxygen)" OFF)
|
||||
ENDIF(DOXYGEN_FOUND)
|
||||
|
||||
# sphinx-docs uses fish_indent for highlighting.
|
||||
# Prepend the output dir of fish_indent to PATH.
|
||||
add_custom_target(sphinx-docs
|
||||
mkdir -p ${SPHINX_HTML_DIR}/_static/
|
||||
COMMAND env PATH="${CMAKE_BINARY_DIR}:$$PATH"
|
||||
${SPHINX_EXECUTABLE}
|
||||
-j auto
|
||||
-q -b html
|
||||
-c "${SPHINX_SRC_DIR}"
|
||||
-d "${SPHINX_ROOT_DIR}/.doctrees-html"
|
||||
"${SPHINX_SRC_DIR}"
|
||||
"${SPHINX_HTML_DIR}"
|
||||
DEPENDS ${SPHINX_SRC_DIR}/fish_indent_lexer.py fish_indent
|
||||
COMMENT "Building HTML documentation with Sphinx")
|
||||
IF(BUILD_DOCS AND NOT DOXYGEN_FOUND)
|
||||
MESSAGE(FATAL_ERROR "build documentation selected, but Doxygen could not be found")
|
||||
ENDIF()
|
||||
|
||||
# sphinx-manpages needs the fish_indent binary for the version number
|
||||
add_custom_target(sphinx-manpages
|
||||
env FISH_BUILD_VERSION_FILE=${CMAKE_CURRENT_BINARY_DIR}/${FBVF}
|
||||
${SPHINX_EXECUTABLE}
|
||||
-j auto
|
||||
-q -b man
|
||||
-c "${SPHINX_SRC_DIR}"
|
||||
-d "${SPHINX_ROOT_DIR}/.doctrees-man"
|
||||
"${SPHINX_SRC_DIR}"
|
||||
# TODO: This only works if we only have section 1 manpages.
|
||||
"${SPHINX_MANPAGE_DIR}/man1"
|
||||
DEPENDS CHECK-FISH-BUILD-VERSION-FILE
|
||||
COMMENT "Building man pages with Sphinx")
|
||||
IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/html
|
||||
AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/share/man/man1)
|
||||
SET(HAVE_PREBUILT_DOCS TRUE)
|
||||
ELSE()
|
||||
SET(HAVE_PREBUILT_DOCS FALSE)
|
||||
ENDIF()
|
||||
|
||||
if(SPHINX_EXECUTABLE)
|
||||
option(BUILD_DOCS "build documentation (requires Sphinx)" ON)
|
||||
else(SPHINX_EXECUTABLE)
|
||||
option(BUILD_DOCS "build documentation (requires Sphinx)" OFF)
|
||||
endif(SPHINX_EXECUTABLE)
|
||||
IF(BUILD_DOCS OR HAVE_PREBUILT_DOCS)
|
||||
SET(INSTALL_DOCS ON)
|
||||
ELSE()
|
||||
SET(INSTALL_DOCS OFF)
|
||||
ENDIF()
|
||||
|
||||
if(BUILD_DOCS AND NOT SPHINX_EXECUTABLE)
|
||||
message(FATAL_ERROR "build documentation selected, but sphinx-build could not be found")
|
||||
endif()
|
||||
ADD_FEATURE_INFO(Documentation INSTALL_DOCS "user manual and documentation")
|
||||
|
||||
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/html
|
||||
AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/man)
|
||||
set(HAVE_PREBUILT_DOCS TRUE)
|
||||
else()
|
||||
set(HAVE_PREBUILT_DOCS FALSE)
|
||||
endif()
|
||||
IF(BUILD_DOCS)
|
||||
# Files in ./share/completions/
|
||||
FILE(GLOB COMPLETIONS_DIR_FILES share/completions/*.fish)
|
||||
|
||||
if(BUILD_DOCS OR HAVE_PREBUILT_DOCS)
|
||||
set(INSTALL_DOCS ON)
|
||||
else()
|
||||
set(INSTALL_DOCS OFF)
|
||||
endif()
|
||||
# Files in ./share/functions/
|
||||
FILE(GLOB FUNCTIONS_DIR_FILES share/functions/*.fish)
|
||||
|
||||
add_feature_info(Documentation INSTALL_DOCS "user manual and documentation")
|
||||
# Files in doc_src
|
||||
FILE(GLOB DOC_SRC_FILES doc_src/*)
|
||||
|
||||
if(BUILD_DOCS)
|
||||
configure_file("${SPHINX_SRC_DIR}/conf.py" "${SPHINX_BUILD_DIR}/conf.py" @ONLY)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS sphinx-docs sphinx-manpages)
|
||||
# .txt files in doc_src
|
||||
FILE(GLOB HELP_SRC doc_src/*.txt)
|
||||
|
||||
# These files are the source files, they contain a few @FOO@-style substitutions.
|
||||
# Note that this order defines the order that they appear in the documentation.
|
||||
SET(HDR_FILES_SRC doc_src/index.hdr.in doc_src/tutorial.hdr doc_src/design.hdr
|
||||
doc_src/license.hdr doc_src/commands.hdr.in doc_src/faq.hdr)
|
||||
|
||||
# These are the generated result files.
|
||||
STRING(REPLACE ".in" "" HDR_FILES "${HDR_FILES_SRC}")
|
||||
|
||||
# Header files except for index.hdr
|
||||
SET(HDR_FILES_NO_INDEX ${HDR_FILES})
|
||||
LIST(REMOVE_ITEM HDR_FILES_NO_INDEX doc_src/index.hdr)
|
||||
|
||||
# Copy doc_src files
|
||||
FILE(COPY ${DOC_SRC_FILES} DESTINATION doc_src)
|
||||
|
||||
# Build lexicon_filter.
|
||||
ADD_CUSTOM_COMMAND(OUTPUT lexicon_filter
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_lexicon_filter.sh
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/functions/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/completions/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lexicon_filter.in
|
||||
${SED}
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/lexicon_filter
|
||||
&& chmod a+x ${CMAKE_CURRENT_BINARY_DIR}/lexicon_filter
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${FUNCTIONS_DIR_FILES} ${COMPLETIONS_DIR_FILES}
|
||||
doc_src/commands.hdr ${CMAKE_CURRENT_SOURCE_DIR}/lexicon_filter.in
|
||||
share/functions/__fish_config_interactive.fish
|
||||
build_tools/build_lexicon_filter.sh command_list_toc.txt)
|
||||
|
||||
# Other targets should depend on this target, otherwise the lexicon
|
||||
# filter can be built twice.
|
||||
ADD_CUSTOM_TARGET(build_lexicon_filter DEPENDS lexicon_filter)
|
||||
|
||||
#
|
||||
# commands.hdr collects documentation on all commands, functions and
|
||||
# builtins
|
||||
#
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc_src)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT doc_src/commands.hdr command_list_toc.txt
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_commands_hdr.sh ${HELP_SRC}
|
||||
< doc_src/commands.hdr.in
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/doc_src/commands.hdr
|
||||
DEPENDS ${HELP_SRC}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/doc_src/commands.hdr.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_commands_hdr.sh)
|
||||
|
||||
# doc.h is a compilation of the various snippets of text used both for
|
||||
# the user documentation and for internal help functions into a single
|
||||
# file that can be parsed by Doxygen to generate the user
|
||||
# documentation.
|
||||
ADD_CUSTOM_COMMAND(OUTPUT doc.h
|
||||
COMMAND cat ${HDR_FILES} > ${CMAKE_CURRENT_BINARY_DIR}/doc.h
|
||||
DEPENDS ${HDR_FILES})
|
||||
|
||||
# toc.txt: $(HDR_FILES:index.hdr=index.hdr.in) build_tools/build_toc_txt.sh | show-SED
|
||||
# FISH_BUILD_VERSION=${FISH_BUILD_VERSION} build_tools/build_toc_txt.sh \
|
||||
# $(HDR_FILES:index.hdr=index.hdr.in) > toc.txt
|
||||
# Note we would like to add doc_src/index.hdr.in as a dependency but CMake replaces this with
|
||||
# doc_src/index.hdr; CMake bug?
|
||||
ADD_CUSTOM_COMMAND(OUTPUT toc.txt
|
||||
COMMAND env `cat ${FBVF} | tr -d '\"'` ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_toc_txt.sh
|
||||
doc_src/index.hdr.in ${HDR_FILES_NO_INDEX}
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/toc.txt
|
||||
DEPENDS ${CFBVF} ${HDR_FILES_NO_INDEX})
|
||||
|
||||
# doc_src/index.hdr: toc.txt doc_src/index.hdr.in | show-AWK
|
||||
# @echo " AWK CAT $(em)$@$(sgr0)"
|
||||
# $v cat $@.in | $(AWK) '{if ($$0 ~ /@toc@/){ system("cat toc.txt");} else{ print $$0;}}' >$@
|
||||
ADD_CUSTOM_COMMAND(OUTPUT doc_src/index.hdr
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_index_hdr.sh toc.txt
|
||||
< doc_src/index.hdr.in
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/doc_src/index.hdr
|
||||
DEPENDS toc.txt)
|
||||
|
||||
# doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h $(HDR_FILES) lexicon_filter
|
||||
# @echo " doxygen $(em)user_doc$(sgr0)"
|
||||
# $v (cat Doxyfile.user; echo INPUT_FILTER=./lexicon_filter; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION) | $(SED) "s/-.*//") | doxygen - && touch user_doc
|
||||
# $v rm -f $(wildcard $(addprefix ./user_doc/html/,arrow*.png bc_s.png bdwn.png closed.png doc.png folder*.png ftv2*.png nav*.png open.png splitbar.png sync_*.png tab*.* doxygen.* dynsections.js jquery.js pages.html))
|
||||
ADD_CUSTOM_TARGET(doc ALL
|
||||
COMMAND env `cat ${FBVF}`
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_user_doc.sh
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.user ./lexicon_filter
|
||||
DEPENDS ${CFBVF} Doxyfile.user ${DOC_SRC_FILES} doc.h ${HDR_FILES} build_lexicon_filter command_list_toc.txt)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT share/man/
|
||||
COMMAND env `cat ${FBVF} | tr -d '\"' `
|
||||
INPUT_FILTER=lexicon_filter ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/build_documentation.sh ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.help doc_src ./share
|
||||
DEPENDS ${CFBVF} ${HELP_SRC} build_lexicon_filter)
|
||||
|
||||
ADD_CUSTOM_TARGET(BUILD_MANUALS ALL DEPENDS share/man/)
|
||||
|
||||
# Group docs targets into a DocsTargets folder
|
||||
set_property(TARGET doc sphinx-docs sphinx-manpages
|
||||
SET_PROPERTY(TARGET doc BUILD_MANUALS build_lexicon_filter
|
||||
PROPERTY FOLDER cmake/DocTargets)
|
||||
|
||||
elseif(HAVE_PREBUILT_DOCS)
|
||||
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
ELSEIF(HAVE_PREBUILT_DOCS)
|
||||
IF(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
# Out of tree build - link the prebuilt documentation to the build tree
|
||||
add_custom_target(link_doc ALL)
|
||||
add_custom_command(TARGET link_doc
|
||||
ADD_CUSTOM_TARGET(link_doc ALL)
|
||||
ADD_CUSTOM_COMMAND(TARGET link_doc
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/share/man ${CMAKE_CURRENT_BINARY_DIR}/share/man
|
||||
POST_BUILD)
|
||||
ADD_CUSTOM_COMMAND(TARGET link_doc
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/user_doc ${CMAKE_CURRENT_BINARY_DIR}/user_doc
|
||||
POST_BUILD)
|
||||
endif()
|
||||
endif(BUILD_DOCS)
|
||||
ENDIF()
|
||||
ENDIF(BUILD_DOCS)
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#[=======================================================================[.rst:
|
||||
Imported from Corrosion https://github.com/corrosion-rs/corrosion/
|
||||
|
||||
Copyright (c) 2018 Andrew Gaspar
|
||||
|
||||
Licensed under the MIT license
|
||||
|
||||
However this is absolutely gutted and reduced to the bare minimum.
|
||||
#]=======================================================================]
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# List of user variables that will override any toolchain-provided setting
|
||||
set(_Rust_USER_VARS Rust_COMPILER Rust_CARGO Rust_CARGO_TARGET)
|
||||
foreach(_VAR ${_Rust_USER_VARS})
|
||||
if (DEFINED "${_VAR}")
|
||||
set(${_VAR}_CACHED "${${_VAR}}" CACHE INTERNAL "Internal cache of ${_VAR}")
|
||||
else()
|
||||
unset(${_VAR}_CACHED CACHE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (NOT DEFINED Rust_CARGO_CACHED)
|
||||
find_program(Rust_CARGO_CACHED cargo PATHS "$ENV{HOME}/.cargo/bin")
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS "${Rust_CARGO_CACHED}")
|
||||
message(FATAL_ERROR "The cargo executable ${Rust_CARGO_CACHED} was not found. "
|
||||
"Consider setting `Rust_CARGO_CACHED` to the absolute path of `cargo`."
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED Rust_COMPILER_CACHED)
|
||||
find_program(Rust_COMPILER_CACHED rustc PATHS "$ENV{HOME}/.cargo/bin")
|
||||
endif()
|
||||
|
||||
|
||||
if (NOT EXISTS "${Rust_COMPILER_CACHED}")
|
||||
message(FATAL_ERROR "The rustc executable ${Rust_COMPILER} was not found. "
|
||||
"Consider setting `Rust_COMPILER` to the absolute path of `rustc`."
|
||||
)
|
||||
endif()
|
||||
|
||||
# Figure out the target by just using the host target.
|
||||
# If you want to cross-compile, you'll have to set Rust_CARGO_TARGET
|
||||
if(NOT Rust_CARGO_TARGET_CACHED)
|
||||
execute_process(
|
||||
COMMAND "${Rust_COMPILER_CACHED}" --version --verbose
|
||||
OUTPUT_VARIABLE _RUSTC_VERSION_RAW
|
||||
RESULT_VARIABLE _RUSTC_VERSION_RESULT
|
||||
)
|
||||
|
||||
if(NOT ( "${_RUSTC_VERSION_RESULT}" EQUAL "0" ))
|
||||
message(FATAL_ERROR "Failed to get rustc version.\n"
|
||||
"${Rust_COMPILER} --version failed with error: `${_RUSTC_VERSION_RESULT}`")
|
||||
endif()
|
||||
|
||||
if (_RUSTC_VERSION_RAW MATCHES "host: ([a-zA-Z0-9_\\-]*)\n")
|
||||
set(Rust_DEFAULT_HOST_TARGET "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Failed to parse rustc host target. `rustc --version --verbose` evaluated to:\n${_RUSTC_VERSION_RAW}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
message(FATAL_ERROR "CMake is in cross-compiling mode."
|
||||
"Manually set `Rust_CARGO_TARGET`."
|
||||
)
|
||||
endif()
|
||||
set(Rust_CARGO_TARGET_CACHED "${Rust_DEFAULT_HOST_TARGET}" CACHE STRING "Target triple")
|
||||
endif()
|
||||
|
||||
# Set the input variables as non-cache variables so that the variables are available after
|
||||
# `find_package`, even if the values were evaluated to defaults.
|
||||
foreach(_VAR ${_Rust_USER_VARS})
|
||||
set(${_VAR} "${${_VAR}_CACHED}")
|
||||
# Ensure cached variables have type INTERNAL
|
||||
set(${_VAR}_CACHED "${${_VAR}_CACHED}" CACHE INTERNAL "Internal cache of ${_VAR}")
|
||||
endforeach()
|
||||
|
||||
find_package_handle_standard_args(
|
||||
Rust
|
||||
REQUIRED_VARS Rust_COMPILER Rust_CARGO Rust_CARGO_TARGET
|
||||
)
|
||||
|
||||
@@ -1,143 +1,177 @@
|
||||
set(CMAKE_INSTALL_MESSAGE NEVER)
|
||||
# -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
# -DPREFIX=L"${CMAKE_INSTALL_PREFIX}"
|
||||
# -DDATADIR=L"${CMAKE_INSTALL_FULL_DATADIR}"
|
||||
# -DSYSCONFDIR=L"${CMAKE_INSTALL_FULL_SYSCONFDIR}"
|
||||
# -DBINDIR=L"${CMAKE_INSTALL_FULL_BINDIR}"
|
||||
# -DDOCDIR=L"${CMAKE_INSTALL_FULL_DOCDIR}")
|
||||
|
||||
set(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/fish ${CMAKE_CURRENT_BINARY_DIR}/fish_indent ${CMAKE_CURRENT_BINARY_DIR}/fish_key_reader)
|
||||
SET(CMAKE_INSTALL_MESSAGE NEVER)
|
||||
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(bindir ${CMAKE_INSTALL_BINDIR})
|
||||
set(sysconfdir ${CMAKE_INSTALL_SYSCONFDIR})
|
||||
set(mandir ${CMAKE_INSTALL_MANDIR})
|
||||
SET(PROGRAMS fish fish_indent fish_key_reader)
|
||||
|
||||
set(datadir ${CMAKE_INSTALL_FULL_DATADIR})
|
||||
file(RELATIVE_PATH rel_datadir ${CMAKE_INSTALL_PREFIX} ${datadir})
|
||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
SET(bindir ${CMAKE_INSTALL_BINDIR})
|
||||
SET(sysconfdir ${CMAKE_INSTALL_SYSCONFDIR})
|
||||
SET(mandir ${CMAKE_INSTALL_MANDIR})
|
||||
|
||||
set(docdir ${CMAKE_INSTALL_DOCDIR})
|
||||
SET(rel_datadir ${CMAKE_INSTALL_DATADIR})
|
||||
SET(datadir ${CMAKE_INSTALL_FULL_DATADIR})
|
||||
|
||||
set(rel_completionsdir "fish/vendor_completions.d")
|
||||
set(rel_functionsdir "fish/vendor_functions.d")
|
||||
set(rel_confdir "fish/vendor_conf.d")
|
||||
SET(docdir ${CMAKE_INSTALL_DOCDIR})
|
||||
|
||||
set(extra_completionsdir
|
||||
"${datadir}/${rel_completionsdir}"
|
||||
# Comment at the top of some .in files
|
||||
SET(configure_input
|
||||
"This file was generated from a corresponding .in file.\
|
||||
DO NOT MANUALLY EDIT THIS FILE!")
|
||||
|
||||
SET(extra_completionsdir
|
||||
${datadir}/fish/vendor_completions.d
|
||||
CACHE STRING "Path for extra completions")
|
||||
|
||||
set(extra_functionsdir
|
||||
"${datadir}/${rel_functionsdir}"
|
||||
CACHE STRING "Path for extra functions")
|
||||
SET(extra_functionsdir
|
||||
${datadir}/fish/vendor_functions.d
|
||||
CACHE STRING "Path for extra completions")
|
||||
|
||||
set(extra_confdir
|
||||
"${datadir}/${rel_confdir}"
|
||||
SET(extra_confdir
|
||||
${datadir}/fish/vendor_conf.d
|
||||
CACHE STRING "Path for extra configuration")
|
||||
|
||||
|
||||
# These are the man pages that go in system manpath; all manpages go in the fish-specific manpath.
|
||||
set(MANUALS ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish_indent.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish_key_reader.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-doc.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-tutorial.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-language.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-interactive.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-completions.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-prompt-tutorial.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-for-bash-users.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish-faq.1)
|
||||
SET(MANUALS ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish_indent.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish_key_reader.1)
|
||||
|
||||
# Determine which man page we don't want to install.
|
||||
# On OS X, don't install a man page for open, since we defeat fish's open
|
||||
# function on OS X.
|
||||
# On other operating systems, don't install a realpath man page, as they almost all have a realpath
|
||||
# command, while macOS does not.
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(CONDEMNED_PAGE "open.1")
|
||||
else()
|
||||
set(CONDEMNED_PAGE "realpath.1")
|
||||
endif()
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
SET(CONDEMNED_PAGE "open.1")
|
||||
ELSE()
|
||||
SET(CONDEMNED_PAGE "none")
|
||||
ENDIF()
|
||||
|
||||
# Define a function to help us create directories.
|
||||
function(FISH_CREATE_DIRS)
|
||||
foreach(dir ${ARGV})
|
||||
install(DIRECTORY DESTINATION ${dir})
|
||||
endforeach(dir)
|
||||
endfunction(FISH_CREATE_DIRS)
|
||||
FUNCTION(FISH_CREATE_DIRS)
|
||||
FOREACH(dir ${ARGV})
|
||||
IF(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/${dir})
|
||||
INSTALL(DIRECTORY DESTINATION ${dir})
|
||||
ENDIF()
|
||||
ENDFOREACH(dir)
|
||||
ENDFUNCTION(FISH_CREATE_DIRS)
|
||||
|
||||
function(FISH_TRY_CREATE_DIRS)
|
||||
foreach(dir ${ARGV})
|
||||
if(NOT IS_ABSOLUTE ${dir})
|
||||
set(abs_dir "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${dir}")
|
||||
else()
|
||||
set(abs_dir "\$ENV{DESTDIR}${dir}")
|
||||
endif()
|
||||
install(SCRIPT CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${abs_dir} OUTPUT_QUIET ERROR_QUIET)
|
||||
execute_process(COMMAND chmod 755 ${abs_dir} OUTPUT_QUIET ERROR_QUIET)
|
||||
FUNCTION(FISH_TRY_CREATE_DIRS)
|
||||
FOREACH(dir ${ARGV})
|
||||
IF(NOT IS_ABSOLUTE ${dir})
|
||||
SET(abs_dir "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${dir}")
|
||||
ELSE()
|
||||
SET(abs_dir "\$ENV{DESTDIR}${dir}")
|
||||
ENDIF()
|
||||
INSTALL(SCRIPT CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${abs_dir} OUTPUT_QUIET ERROR_QUIET)
|
||||
EXECUTE_PROCESS(COMMAND chmod 755 ${abs_dir} OUTPUT_QUIET ERROR_QUIET)
|
||||
")
|
||||
endforeach()
|
||||
endfunction(FISH_TRY_CREATE_DIRS)
|
||||
ENDFOREACH()
|
||||
ENDFUNCTION(FISH_TRY_CREATE_DIRS)
|
||||
|
||||
install(PROGRAMS ${PROGRAMS}
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
|
||||
# $v for i in $(PROGRAMS); do\
|
||||
# $(INSTALL) -m 755 $$i $(DESTDIR)$(bindir);\
|
||||
# echo " Installing $(bo)$$i$(sgr0)";\
|
||||
# true ;\
|
||||
# done;
|
||||
|
||||
INSTALL(TARGETS ${PROGRAMS}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
||||
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
DESTINATION ${bindir})
|
||||
|
||||
fish_create_dirs(${sysconfdir}/fish/conf.d ${sysconfdir}/fish/completions
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/conf.d
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/completions
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/functions
|
||||
# $v $(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/
|
||||
FISH_CREATE_DIRS(${sysconfdir}/fish/conf.d ${sysconfdir}/fish/completions
|
||||
${sysconfdir}/fish/functions)
|
||||
install(FILES etc/config.fish DESTINATION ${sysconfdir}/fish/)
|
||||
INSTALL(FILES etc/config.fish DESTINATION ${sysconfdir}/fish/)
|
||||
|
||||
fish_create_dirs(${rel_datadir}/fish ${rel_datadir}/fish/completions
|
||||
FISH_CREATE_DIRS(${rel_datadir}/fish ${rel_datadir}/fish/completions
|
||||
${rel_datadir}/fish/functions ${rel_datadir}/fish/groff
|
||||
${rel_datadir}/fish/man/man1 ${rel_datadir}/fish/tools
|
||||
${rel_datadir}/fish/tools/web_config
|
||||
${rel_datadir}/fish/tools/web_config/js
|
||||
${rel_datadir}/fish/tools/web_config/sample_prompts
|
||||
${rel_datadir}/fish/tools/web_config/themes
|
||||
)
|
||||
${rel_datadir}/fish/tools/web_config/partials
|
||||
${rel_datadir}/fish/tools/web_config/sample_prompts)
|
||||
|
||||
configure_file(share/__fish_build_paths.fish.in share/__fish_build_paths.fish)
|
||||
install(FILES share/config.fish
|
||||
# $v $(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/
|
||||
# $v $(INSTALL) -m 644 share/__fish_build_paths.fish $(DESTDIR)$(datadir)/fish/
|
||||
CONFIGURE_FILE(share/__fish_build_paths.fish.in share/__fish_build_paths.fish)
|
||||
INSTALL(FILES share/config.fish
|
||||
${CMAKE_CURRENT_BINARY_DIR}/share/__fish_build_paths.fish
|
||||
DESTINATION ${rel_datadir}/fish)
|
||||
|
||||
# Create only the vendor directories inside the prefix (#5029 / #6508)
|
||||
fish_create_dirs(${rel_datadir}/fish/vendor_completions.d ${rel_datadir}/fish/vendor_functions.d
|
||||
${rel_datadir}/fish/vendor_conf.d)
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/pkgconfig
|
||||
# @echo "Creating placeholder vendor/'extra_' directories"
|
||||
# -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir)
|
||||
# -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir)
|
||||
# -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir)
|
||||
FISH_CREATE_DIRS(${rel_datadir}/pkgconfig)
|
||||
# Don't try too hard to create these directories as they may be outside our writeable area
|
||||
# https://github.com/Homebrew/homebrew-core/pull/2813
|
||||
FISH_TRY_CREATE_DIRS(${extra_completionsdir} ${extra_functionsdir} ${extra_confdir})
|
||||
|
||||
fish_try_create_dirs(${rel_datadir}/pkgconfig)
|
||||
configure_file(fish.pc.in fish.pc.noversion @ONLY)
|
||||
# @echo "Installing pkgconfig file"
|
||||
# $v $(INSTALL) -m 644 fish.pc $(DESTDIR)$(datadir)/pkgconfig
|
||||
CONFIGURE_FILE(fish.pc.in fish.pc.noversion)
|
||||
|
||||
add_custom_command(OUTPUT fish.pc
|
||||
ADD_CUSTOM_COMMAND(OUTPUT fish.pc
|
||||
COMMAND sed '/Version/d' fish.pc.noversion > fish.pc
|
||||
COMMAND printf "Version: " >> fish.pc
|
||||
COMMAND cat ${FBVF} >> fish.pc
|
||||
COMMAND sed 's/FISH_BUILD_VERSION=//\;s/\"//g' ${FBVF} >> fish.pc
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS CHECK-FISH-BUILD-VERSION-FILE ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion)
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FBVF} ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion)
|
||||
|
||||
add_custom_target(build_fish_pc ALL DEPENDS fish.pc)
|
||||
ADD_CUSTOM_TARGET(build_fish_pc ALL DEPENDS fish.pc)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fish.pc
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/fish.pc
|
||||
DESTINATION ${rel_datadir}/pkgconfig)
|
||||
|
||||
install(DIRECTORY share/completions/
|
||||
# @echo "Installing the $(bo)fish completion library$(sgr0)...";
|
||||
# $v $(INSTALL) -m 644 $(COMPLETIONS_DIR_FILES:%='%') $(DESTDIR)$(datadir)/fish/completions/
|
||||
INSTALL(DIRECTORY share/completions/
|
||||
DESTINATION ${rel_datadir}/fish/completions
|
||||
FILES_MATCHING PATTERN "*.fish")
|
||||
|
||||
install(DIRECTORY share/functions/
|
||||
# @echo "Installing $(bo)fish functions$(sgr0)";
|
||||
# $v $(INSTALL) -m 644 $(FUNCTIONS_DIR_FILES:%='%') $(DESTDIR)$(datadir)/fish/functions/
|
||||
INSTALL(DIRECTORY share/functions/
|
||||
DESTINATION ${rel_datadir}/fish/functions
|
||||
FILES_MATCHING PATTERN "*.fish")
|
||||
|
||||
install(DIRECTORY share/groff
|
||||
# @echo "Installing $(bo)man pages$(sgr0)";
|
||||
# $v $(INSTALL) -m 644 share/groff/* $(DESTDIR)$(datadir)/fish/groff/
|
||||
INSTALL(DIRECTORY share/groff
|
||||
DESTINATION ${rel_datadir}/fish)
|
||||
|
||||
# $v test -z "$(wildcard share/man/man1/*.1)" || $(INSTALL) -m 644 $(filter-out $(addprefix share/man/man1/, $(CONDEMNED_PAGES)), $(wildcard share/man/man1/*.1)) $(DESTDIR)$(datadir)/fish/man/man1/
|
||||
# CONDEMNED_PAGE is managed by the conditional above
|
||||
# Building the man pages is optional: if sphinx isn't installed, they're not built
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/
|
||||
# Building the man pages is optional: if doxygen isn't installed, they're not built
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/
|
||||
DESTINATION ${rel_datadir}/fish/man/man1
|
||||
FILES_MATCHING
|
||||
PATTERN "*.1"
|
||||
PATTERN ${CONDEMNED_PAGE} EXCLUDE)
|
||||
|
||||
install(PROGRAMS share/tools/create_manpage_completions.py share/tools/deroff.py
|
||||
# @echo "Installing helper tools";
|
||||
# $v $(INSTALL) -m 755 share/tools/*.py $(DESTDIR)$(datadir)/fish/tools/
|
||||
INSTALL(PROGRAMS share/tools/create_manpage_completions.py share/tools/deroff.py
|
||||
DESTINATION ${rel_datadir}/fish/tools/)
|
||||
|
||||
install(DIRECTORY share/tools/web_config
|
||||
# $v $(INSTALL) -m 644 share/tools/web_config/*.* $(DESTDIR)$(datadir)/fish/tools/web_config/
|
||||
# $v $(INSTALL) -m 644 share/tools/web_config/js/*.* $(DESTDIR)$(datadir)/fish/tools/web_config/js/
|
||||
# $v $(INSTALL) -m 644 share/tools/web_config/partials/* $(DESTDIR)$(datadir)/fish/tools/web_config/partials/
|
||||
# $v $(INSTALL) -m 644 share/tools/web_config/sample_prompts/*.fish $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts/
|
||||
# $v $(INSTALL) -m 755 share/tools/web_config/*.py $(DESTDIR)$(datadir)/fish/tools/web_config/
|
||||
|
||||
INSTALL(DIRECTORY share/tools/web_config
|
||||
DESTINATION ${rel_datadir}/fish/tools/
|
||||
FILES_MATCHING
|
||||
PATTERN "*.png"
|
||||
@@ -145,31 +179,51 @@ install(DIRECTORY share/tools/web_config
|
||||
PATTERN "*.html"
|
||||
PATTERN "*.py"
|
||||
PATTERN "*.js"
|
||||
PATTERN "*.theme"
|
||||
PATTERN "*.fish")
|
||||
|
||||
# Building the man pages is optional: if Sphinx isn't installed, they're not built
|
||||
install(FILES ${MANUALS} DESTINATION ${mandir}/man1/ OPTIONAL)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/html/ # Trailing slash is important!
|
||||
# @echo "Installing more man pages";
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1;
|
||||
# $v for i in $(MANUALS); do \
|
||||
# $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \
|
||||
# true; \
|
||||
# done;
|
||||
# Building the man pages is optional: if doxygen isn't installed, they're not built
|
||||
INSTALL(FILES ${MANUALS} DESTINATION ${mandir}/man1/ OPTIONAL)
|
||||
|
||||
#install-doc: $(user_doc)
|
||||
# @echo "Installing online user documentation";
|
||||
# $v $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
|
||||
# $v for i in user_doc/html/* CHANGELOG.md; do \
|
||||
# if test -f $$i; then \
|
||||
# $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
|
||||
# fi; \
|
||||
# done;
|
||||
# Building the manual is optional
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/html/ # Trailing slash is important!
|
||||
DESTINATION ${docdir} OPTIONAL)
|
||||
install(FILES CHANGELOG.rst DESTINATION ${docdir})
|
||||
INSTALL(FILES CHANGELOG.md DESTINATION ${docdir})
|
||||
|
||||
# $v $(INSTALL) -m 644 share/lynx.lss $(DESTDIR)$(datadir)/fish/
|
||||
INSTALL(FILES share/lynx.lss DESTINATION ${rel_datadir}/fish/)
|
||||
|
||||
# These files are built by cmake/gettext.cmake, but using GETTEXT_PROCESS_PO_FILES's
|
||||
# INSTALL_DESTINATION leads to them being installed as ${lang}.gmo, not fish.mo
|
||||
# The ${languages} array comes from cmake/gettext.cmake
|
||||
if(GETTEXT_FOUND)
|
||||
foreach(lang ${languages})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo DESTINATION
|
||||
IF(GETTEXT_FOUND)
|
||||
FOREACH(lang ${languages})
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo DESTINATION
|
||||
${CMAKE_INSTALL_LOCALEDIR}/${lang}/LC_MESSAGES/ RENAME fish.mo)
|
||||
endforeach()
|
||||
endif()
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
# Group install targets into a InstallTargets folder
|
||||
set_property(TARGET build_fish_pc CHECK-FISH-BUILD-VERSION-FILE
|
||||
SET_PROPERTY(TARGET build_fish_pc CHECK-FISH-BUILD-VERSION-FILE
|
||||
test_invocation test_fishscript
|
||||
test_prep tests_buildroot_target
|
||||
PROPERTY FOLDER cmake/InstallTargets)
|
||||
|
||||
# Make a target build_root that installs into the buildroot directory, for testing.
|
||||
set(BUILDROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/buildroot)
|
||||
add_custom_target(build_root
|
||||
SET(BUILDROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/buildroot)
|
||||
ADD_CUSTOM_TARGET(build_root
|
||||
COMMAND DESTDIR=${BUILDROOT_DIR} ${CMAKE_COMMAND}
|
||||
--build ${CMAKE_CURRENT_BINARY_DIR} --target install)
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
# This is Mac-only.
|
||||
if (NOT APPLE)
|
||||
return()
|
||||
endif (NOT APPLE)
|
||||
|
||||
# The source tree containing certain macOS resources.
|
||||
set(OSX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/osx)
|
||||
|
||||
# 10.9 is the minimum supported version.
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
|
||||
|
||||
set(RESOURCE_FILES
|
||||
${OSX_DIR}/launch_fish.scpt
|
||||
${OSX_DIR}/fish_term_icon.icns
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/build_tools/osx_package_scripts/add-shell
|
||||
${OSX_DIR}/install.sh
|
||||
)
|
||||
|
||||
# Resource files must be present in the source list.
|
||||
add_executable(fish_macapp EXCLUDE_FROM_ALL
|
||||
${OSX_DIR}/osx_fish_launcher.m
|
||||
${RESOURCE_FILES}
|
||||
)
|
||||
|
||||
# Compute the version. Note this is done at generation time, not build time,
|
||||
# so cmake must be re-run after version changes for the app to be updated. But
|
||||
# generally this will be run by make_pkg.sh which always re-runs cmake.
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/git_version_gen.sh --stdout
|
||||
COMMAND cut -d- -f1
|
||||
OUTPUT_VARIABLE FISH_SHORT_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
|
||||
# Note CMake appends .app, so the real output name will be fish.app.
|
||||
# This target does not include the 'base' resource.
|
||||
set_target_properties(fish_macapp PROPERTIES OUTPUT_NAME "fish")
|
||||
|
||||
find_library(FOUNDATION_LIB Foundation)
|
||||
target_link_libraries(fish_macapp ${FOUNDATION_LIB})
|
||||
|
||||
set_target_properties(fish_macapp PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_INFO_PLIST ${OSX_DIR}/CMakeMacAppInfo.plist.in
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.ridiculousfish.fish-shell"
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${FISH_SHORT_VERSION}
|
||||
RESOURCE "${RESOURCE_FILES}"
|
||||
)
|
||||
|
||||
# The fish Mac app contains a fish installation inside the package.
|
||||
# Here is where it gets built.
|
||||
# Copy into the fish mac app after.
|
||||
set(MACAPP_FISH_BUILDROOT ${CMAKE_CURRENT_BINARY_DIR}/macapp_buildroot/base)
|
||||
|
||||
add_custom_command(TARGET fish_macapp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${MACAPP_FISH_BUILDROOT}
|
||||
COMMAND DESTDIR=${MACAPP_FISH_BUILDROOT} ${CMAKE_COMMAND}
|
||||
--build ${CMAKE_CURRENT_BINARY_DIR} --target install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${MACAPP_FISH_BUILDROOT}/..
|
||||
$<TARGET_BUNDLE_CONTENT_DIR:fish_macapp>/Resources/
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# The entitlements file.
|
||||
set(MACAPP_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/osx/MacApp.entitlements")
|
||||
|
||||
# Group our targets in a folder.
|
||||
set_property(TARGET fish_macapp PROPERTY FOLDER macapp)
|
||||
@@ -1,9 +1,20 @@
|
||||
set(FISH_USE_SYSTEM_PCRE2 ON CACHE BOOL
|
||||
"Try to use PCRE2 from the system, instead of the pcre2-sys version")
|
||||
# PCRE2 needs some settings.
|
||||
SET(PCRE2_WIDTH ${WCHAR_T_BITS})
|
||||
SET(PCRE2_BUILD_PCRE2_8 OFF CACHE BOOL "Build 8bit PCRE2 library")
|
||||
SET(PCRE2_BUILD_PCRE2_${PCRE2_WIDTH} ON CACHE BOOL "Build ${PCRE2_WIDTH}bit PCRE2 library")
|
||||
SET(PCRE2_SHOW_REPORT OFF CACHE BOOL "Show the final configuration report")
|
||||
SET(PCRE2_BUILD_PCRE2GREP OFF CACHE BOOL "Build pcre2grep")
|
||||
|
||||
if(FISH_USE_SYSTEM_PCRE2)
|
||||
message(STATUS "Trying to use PCRE2 from the system")
|
||||
else()
|
||||
message(STATUS "Forcing static build of PCRE2")
|
||||
set(FISH_PCRE2_BUILDFLAG "PCRE2_SYS_STATIC=1")
|
||||
endif(FISH_USE_SYSTEM_PCRE2)
|
||||
|
||||
SET(PCRE2_MIN_VERSION 10.21)
|
||||
FIND_LIBRARY(PCRE2_LIB pcre2-${PCRE2_WIDTH})
|
||||
FIND_PATH(PCRE2_INCLUDE_DIR pcre2.h)
|
||||
IF (PCRE2_LIB AND PCRE2_INCLUDE_DIR)
|
||||
MESSAGE(STATUS "Found system PCRE2 library ${PCRE2_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Using bundled PCRE2 library")
|
||||
ADD_SUBDIRECTORY(pcre2-10.22 EXCLUDE_FROM_ALL)
|
||||
SET(PCRE2_INCLUDE_DIR ${CMAKE_BINARY_DIR}/pcre2-10.22/)
|
||||
SET(PCRE2_LIB pcre2-${PCRE2_WIDTH})
|
||||
endif(PCRE2_LIB AND PCRE2_INCLUDE_DIR)
|
||||
INCLUDE_DIRECTORIES(${PCRE2_INCLUDE_DIR})
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
include(FindRust)
|
||||
find_package(Rust REQUIRED)
|
||||
|
||||
set(FISH_RUST_BUILD_DIR "${CMAKE_BINARY_DIR}/cargo/build")
|
||||
|
||||
if(DEFINED ASAN)
|
||||
list(APPEND CARGO_FLAGS "-Z" "build-std")
|
||||
list(APPEND FISH_CRATE_FEATURES "asan")
|
||||
endif()
|
||||
if(DEFINED TSAN)
|
||||
list(APPEND CARGO_FLAGS "-Z" "build-std")
|
||||
list(APPEND FISH_CRATE_FEATURES "tsan")
|
||||
endif()
|
||||
|
||||
if (Rust_CARGO_TARGET)
|
||||
set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_TARGET}")
|
||||
else()
|
||||
set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_HOST_TARGET}")
|
||||
endif()
|
||||
|
||||
set(rust_profile $<IF:$<CONFIG:Debug>,debug,$<IF:$<CONFIG:RelWithDebInfo>,release-with-debug,release>>)
|
||||
set(rust_debugflags "$<$<CONFIG:Debug>:-g>$<$<CONFIG:RelWithDebInfo>:-g>")
|
||||
|
||||
|
||||
# Temporary hack to propagate CMake flags/options to build.rs. We need to get CMake to evaluate the
|
||||
# truthiness of the strings if they are set.
|
||||
set(CMAKE_WITH_GETTEXT "1")
|
||||
if(DEFINED WITH_GETTEXT AND NOT "${WITH_GETTEXT}")
|
||||
set(CMAKE_WITH_GETTEXT "0")
|
||||
endif()
|
||||
|
||||
if(FISH_CRATE_FEATURES)
|
||||
set(FEATURES_ARG ${FISH_CRATE_FEATURES})
|
||||
list(PREPEND FEATURES_ARG "--features")
|
||||
endif()
|
||||
|
||||
# Tell Cargo where our build directory is so it can find Cargo.toml.
|
||||
set(VARS_FOR_CARGO
|
||||
"FISH_BUILD_DIR=${CMAKE_BINARY_DIR}"
|
||||
"PREFIX=${CMAKE_INSTALL_PREFIX}"
|
||||
# Temporary hack to propagate CMake flags/options to build.rs.
|
||||
"CMAKE_WITH_GETTEXT=${CMAKE_WITH_GETTEXT}"
|
||||
# Cheesy so we can tell cmake was used to build
|
||||
"CMAKE=1"
|
||||
"DOCDIR=${CMAKE_INSTALL_FULL_DOCDIR}"
|
||||
"DATADIR=${CMAKE_INSTALL_FULL_DATADIR}"
|
||||
"SYSCONFDIR=${CMAKE_INSTALL_FULL_SYSCONFDIR}"
|
||||
"BINDIR=${CMAKE_INSTALL_FULL_BINDIR}"
|
||||
"LOCALEDIR=${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
"CARGO_TARGET_DIR=${FISH_RUST_BUILD_DIR}"
|
||||
"CARGO_BUILD_RUSTC=${Rust_COMPILER}"
|
||||
"${FISH_PCRE2_BUILDFLAG}"
|
||||
"RUSTFLAGS=$ENV{RUSTFLAGS} ${rust_debugflags}"
|
||||
)
|
||||
@@ -1,116 +1,131 @@
|
||||
# This adds ctest support to the project
|
||||
enable_testing()
|
||||
# Define fish_tests.
|
||||
ADD_EXECUTABLE(fish_tests EXCLUDE_FROM_ALL
|
||||
src/fish_tests.cpp)
|
||||
FISH_LINK_DEPS(fish_tests)
|
||||
|
||||
# By default, ctest runs tests serially
|
||||
# Support CTEST_PARALLEL_LEVEL as an environment variable in addition to a CMake variable
|
||||
if(NOT CTEST_PARALLEL_LEVEL)
|
||||
set(CTEST_PARALLEL_LEVEL $ENV{CTEST_PARALLEL_LEVEL})
|
||||
if(NOT CTEST_PARALLEL_LEVEL)
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(CORES)
|
||||
math(EXPR halfcores "${CORES} / 2")
|
||||
set(CTEST_PARALLEL_LEVEL ${halfcores})
|
||||
endif()
|
||||
endif()
|
||||
# The "test" directory.
|
||||
SET(TEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
|
||||
# The directory into which fish is installed.
|
||||
SET(TEST_INSTALL_DIR ${TEST_DIR}/buildroot)
|
||||
|
||||
# The directory where the tests expect to find the fish root (./bin, etc)
|
||||
SET(TEST_ROOT_DIR ${TEST_DIR}/root)
|
||||
|
||||
# Copy tests files.
|
||||
FILE(GLOB TESTS_FILES tests/*)
|
||||
ADD_CUSTOM_TARGET(tests_dir DEPENDS tests)
|
||||
|
||||
IF(NOT FISH_IN_TREE_BUILD)
|
||||
ADD_CUSTOM_COMMAND(TARGET tests_dir
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_SOURCE_DIR}/tests/ ${CMAKE_BINARY_DIR}/tests/
|
||||
COMMENT "Copying test files to binary dir"
|
||||
VERBATIM)
|
||||
|
||||
ADD_DEPENDENCIES(fish_tests tests_dir)
|
||||
ENDIF()
|
||||
|
||||
# Create the 'test' target.
|
||||
# Set a policy so CMake stops complaining about the name 'test'.
|
||||
CMAKE_POLICY(PUSH)
|
||||
IF(POLICY CMP0037)
|
||||
CMAKE_POLICY(SET CMP0037 OLD)
|
||||
ENDIF()
|
||||
ADD_CUSTOM_TARGET(test)
|
||||
CMAKE_POLICY(POP)
|
||||
|
||||
ADD_CUSTOM_TARGET(test_low_level
|
||||
COMMAND env XDG_DATA_HOME=test/data XDG_CONFIG_HOME=test/home ./fish_tests
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS fish_tests
|
||||
USES_TERMINAL)
|
||||
ADD_DEPENDENCIES(test test_low_level tests_dir)
|
||||
|
||||
# Make the directory in which to run tests.
|
||||
# Also symlink fish to where the tests expect it to be.
|
||||
ADD_CUSTOM_TARGET(tests_buildroot_target
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_INSTALL_DIR}
|
||||
COMMAND DESTDIR=${TEST_INSTALL_DIR} ${CMAKE_COMMAND}
|
||||
--build ${CMAKE_CURRENT_BINARY_DIR} --target install
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
${TEST_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}
|
||||
${TEST_ROOT_DIR}
|
||||
DEPENDS fish)
|
||||
|
||||
IF(NOT FISH_IN_TREE_BUILD)
|
||||
# We need to symlink share/functions for the tests.
|
||||
# This should be simplified.
|
||||
ADD_CUSTOM_TARGET(symlink_functions
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/functions
|
||||
${CMAKE_CURRENT_BINARY_DIR}/share/functions)
|
||||
ADD_DEPENDENCIES(tests_buildroot_target symlink_functions)
|
||||
ELSE()
|
||||
ADD_CUSTOM_TARGET(symlink_functions)
|
||||
ENDIF()
|
||||
|
||||
#
|
||||
# Prep the environment for running the unit tests.
|
||||
# test-prep: show-DESTDIR show-LN_S show-FISH_VERSION
|
||||
# $v rm -rf test
|
||||
# $v $(MKDIR_P) test/data test/home test/temp
|
||||
# ifdef DESTDIR
|
||||
# $v $(LN_S) $(DESTDIR) test/root
|
||||
# else
|
||||
# $v $(MKDIR_P) test/root
|
||||
# endif
|
||||
ADD_CUSTOM_TARGET(test_prep
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/data
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/home
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/temp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
${TEST_DIR}/data ${TEST_DIR}/home ${TEST_DIR}/temp
|
||||
DEPENDS tests_buildroot_target
|
||||
USES_TERMINAL)
|
||||
|
||||
|
||||
# Put in a tests folder to reduce the top level targets in IDEs.
|
||||
set(CMAKE_FOLDER tests)
|
||||
# test_high_level_test_deps = test_fishscript test_interactive test_invocation
|
||||
# test_high_level: DESTDIR = $(PWD)/test/root/
|
||||
# test_high_level: prefix = .
|
||||
# test_high_level: test-prep install-force test_fishscript test_interactive test_invocation
|
||||
# .PHONY: test_high_level
|
||||
#
|
||||
# test_invocation: $(call filter_up_to,test_invocation,$(active_test_goals))
|
||||
# cd tests; ./invocation.sh
|
||||
# .PHONY: test_invocation
|
||||
ADD_CUSTOM_TARGET(test_invocation
|
||||
COMMAND ./invocation.sh
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/
|
||||
DEPENDS test_prep test_low_level
|
||||
USES_TERMINAL)
|
||||
|
||||
# We will use 125 as a reserved exit code to indicate that a test has been skipped, i.e. it did not
|
||||
# pass but it should not be considered a failed test run, either.
|
||||
set(SKIP_RETURN_CODE 125)
|
||||
#
|
||||
# test_fishscript: $(call filter_up_to,test_fishscript,$(active_test_goals))
|
||||
# cd tests; ../test/root/bin/fish test.fish
|
||||
# .PHONY: test_fishscript
|
||||
|
||||
# Even though we are using CMake's ctest for testing, we still define our own `make fish_run_tests` target
|
||||
# rather than use its default for many reasons:
|
||||
# * CMake doesn't run tests in-proc or even add each tests as an individual node in the ninja
|
||||
# dependency tree, instead it just bundles all tests into a target called `test` that always just
|
||||
# shells out to `ctest`, so there are no build-related benefits to not doing that ourselves.
|
||||
# * CMake devs insist that it is appropriate for `make fish_run_tests` to never depend on `make all`, i.e.
|
||||
# running `make fish_run_tests` does not require any of the binaries to be built before testing.
|
||||
# * It is not possible to set top-level CTest options/settings such as CTEST_PARALLEL_LEVEL from
|
||||
# within the CMake configuration file.
|
||||
# * The only way to have a test depend on a binary is to add a fake test with a name like
|
||||
# "build_fish" that executes CMake recursively to build the `fish` target.
|
||||
# * Circling back to the point about individual tests not being actual Makefile targets, CMake does
|
||||
# not offer any way to execute a named test via the `make`/`ninja`/whatever interface; the only
|
||||
# way to manually invoke test `foo` is to to manually run `ctest` and specify a regex matching
|
||||
# `foo` as an argument, e.g. `ctest -R ^foo$`... which is really crazy.
|
||||
ADD_CUSTOM_TARGET(test_fishscript
|
||||
COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish test.fish
|
||||
DEPENDS test_prep test_invocation
|
||||
USES_TERMINAL)
|
||||
#
|
||||
# test_interactive: $(call filter_up_to,test_interactive,$(active_test_goals))
|
||||
# cd tests; ../test/root/bin/fish interactive.fish
|
||||
# .PHONY: test_interactive
|
||||
|
||||
# The top-level test target is "fish_run_tests".
|
||||
add_custom_target(fish_run_tests
|
||||
COMMAND env CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL} FISH_FORCE_COLOR=1
|
||||
${CMAKE_CTEST_COMMAND} --force-new-ctest-process # --verbose
|
||||
--output-on-failure --progress
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper
|
||||
USES_TERMINAL
|
||||
)
|
||||
ADD_CUSTOM_TARGET(test_interactive
|
||||
COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish interactive.fish
|
||||
DEPENDS test_prep test_invocation test_fishscript
|
||||
USES_TERMINAL)
|
||||
|
||||
# CMake being CMake, you can't just add a DEPENDS argument to add_test to make it depend on any of
|
||||
# your binaries actually being built before `make fish_run_tests` is executed (requiring `make all` first),
|
||||
# and the only dependency a test can have is on another test. So we make building fish
|
||||
# prerequisites to our entire top-level `test` target.
|
||||
function(add_test_target NAME)
|
||||
string(REPLACE "/" "-" NAME ${NAME})
|
||||
add_custom_target("test_${NAME}" COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$"
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper USES_TERMINAL)
|
||||
endfunction()
|
||||
ADD_CUSTOM_TARGET(test_high_level
|
||||
DEPENDS test_invocation test_fishscript test_interactive)
|
||||
ADD_DEPENDENCIES(test test_high_level)
|
||||
|
||||
add_executable(fish_test_helper tests/fish_test_helper.c)
|
||||
|
||||
FILE(GLOB FISH_CHECKS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/tests/checks/*.fish)
|
||||
foreach(CHECK ${FISH_CHECKS})
|
||||
get_filename_component(CHECK_NAME ${CHECK} NAME)
|
||||
get_filename_component(CHECK ${CHECK} NAME_WE)
|
||||
add_test(NAME ${CHECK_NAME}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py --cachedir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
checks/${CHECK}.fish
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
||||
)
|
||||
set_tests_properties(${CHECK_NAME} PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
set_tests_properties(${CHECK_NAME} PROPERTIES ENVIRONMENT FISH_FORCE_COLOR=1)
|
||||
add_test_target("${CHECK_NAME}")
|
||||
endforeach(CHECK)
|
||||
|
||||
FILE(GLOB PEXPECTS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/tests/pexpects/*.py)
|
||||
foreach(PEXPECT ${PEXPECTS})
|
||||
get_filename_component(PEXPECT ${PEXPECT} NAME)
|
||||
add_test(NAME ${PEXPECT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py --cachedir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
pexpects/${PEXPECT}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
||||
)
|
||||
set_tests_properties(${PEXPECT} PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
set_tests_properties(${PEXPECT} PROPERTIES ENVIRONMENT FISH_FORCE_COLOR=1)
|
||||
add_test_target("${PEXPECT}")
|
||||
endforeach(PEXPECT)
|
||||
|
||||
set(cargo_test_flags)
|
||||
# Rust stuff.
|
||||
if(DEFINED ASAN)
|
||||
# Rust w/ -Zsanitizer=address requires explicitly specifying the --target triple or else linker
|
||||
# errors pertaining to asan symbols will ensue.
|
||||
if(NOT DEFINED Rust_CARGO_TARGET)
|
||||
message(FATAL_ERROR "ASAN requires defining the CMake variable Rust_CARGO_TARGET to the
|
||||
intended target triple")
|
||||
endif()
|
||||
endif()
|
||||
if(DEFINED TSAN)
|
||||
if(NOT DEFINED Rust_CARGO_TARGET)
|
||||
message(FATAL_ERROR "TSAN requires defining the CMake variable Rust_CARGO_TARGET to the
|
||||
intended target triple")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED Rust_CARGO_TARGET)
|
||||
list(APPEND cargo_test_flags "--target" ${Rust_CARGO_TARGET})
|
||||
list(APPEND cargo_test_flags "--lib")
|
||||
endif()
|
||||
|
||||
add_test(
|
||||
NAME "cargo-test"
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test --no-default-features ${CARGO_FLAGS} --workspace --target-dir ${rust_target_dir} ${cargo_test_flags}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
)
|
||||
set_tests_properties("cargo-test" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
add_test_target("cargo-test")
|
||||
# Group test targets into a TestTargets folder
|
||||
SET_PROPERTY(TARGET test test_low_level test_high_level tests_dir
|
||||
test_invocation test_fishscript test_prep
|
||||
tests_buildroot_target
|
||||
symlink_functions
|
||||
PROPERTY FOLDER cmake/TestTargets)
|
||||
|
||||
@@ -31,25 +31,25 @@
|
||||
# stays the same (incremental builds must be fast).
|
||||
|
||||
# Just a handy abbreviation.
|
||||
set(FBVF FISH-BUILD-VERSION-FILE)
|
||||
SET(FBVF FISH-BUILD-VERSION-FILE)
|
||||
|
||||
# TODO: find a cleaner way to do this.
|
||||
IF (${CMAKE_GENERATOR} STREQUAL Ninja)
|
||||
set(FBVF-OUTPUT fish-build-version-witness.txt)
|
||||
set(CFBVF-BYPRODUCTS ${FBVF})
|
||||
else(${CMAKE_GENERATOR} STREQUAL Ninja)
|
||||
set(FBVF-OUTPUT ${FBVF})
|
||||
set(CFBVF-BYPRODUCTS)
|
||||
endif(${CMAKE_GENERATOR} STREQUAL Ninja)
|
||||
SET(FBVF-OUTPUT fish-build-version-witness.txt)
|
||||
SET(CFBVF-BYPRODUCTS ${FBVF})
|
||||
ELSE(${CMAKE_GENERATOR} STREQUAL Ninja)
|
||||
SET(FBVF-OUTPUT ${FBVF})
|
||||
SET(CFBVF-BYPRODUCTS)
|
||||
ENDIF(${CMAKE_GENERATOR} STREQUAL Ninja)
|
||||
|
||||
# Set up the version targets
|
||||
add_custom_target(CHECK-FISH-BUILD-VERSION-FILE
|
||||
ADD_CUSTOM_TARGET(CHECK-FISH-BUILD-VERSION-FILE
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/git_version_gen.sh ${CMAKE_CURRENT_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
BYPRODUCTS ${CFBVF-BYPRODUCTS})
|
||||
|
||||
add_custom_command(OUTPUT ${FBVF-OUTPUT}
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${FBVF-OUTPUT}
|
||||
DEPENDS CHECK-FISH-BUILD-VERSION-FILE)
|
||||
|
||||
# Abbreviation for the target.
|
||||
set(CFBVF CHECK-FISH-BUILD-VERSION-FILE)
|
||||
SET(CFBVF CHECK-FISH-BUILD-VERSION-FILE)
|
||||
|
||||
@@ -1,22 +1,42 @@
|
||||
set(languages de en fr pl pt_BR sv zh_CN)
|
||||
SET(languages de en fr nb nn pl pt_BR sv zh_CN)
|
||||
|
||||
include(FeatureSummary)
|
||||
INCLUDE(FeatureSummary)
|
||||
|
||||
option(WITH_GETTEXT "translate messages if gettext is available" ON)
|
||||
if(WITH_GETTEXT)
|
||||
find_package(Gettext)
|
||||
endif()
|
||||
add_feature_info(gettext GETTEXT_FOUND "translate messages with gettext")
|
||||
OPTION(WITH_GETTEXT "translate messages if gettext is available" ON)
|
||||
IF(WITH_GETTEXT)
|
||||
FIND_PACKAGE(Intl)
|
||||
FIND_PACKAGE(Gettext)
|
||||
IF(GETTEXT_FOUND)
|
||||
SET(HAVE_GETTEXT 1)
|
||||
INCLUDE_DIRECTORIES(${Intl_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ADD_FEATURE_INFO(gettext GETTEXT_FOUND "translate messages with gettext")
|
||||
|
||||
# Define translations
|
||||
if(GETTEXT_FOUND)
|
||||
# Group pofile targets into their own folder, as there's a lot of them.
|
||||
set(CMAKE_FOLDER pofiles)
|
||||
foreach(lang ${languages})
|
||||
IF(GETTEXT_FOUND)
|
||||
FOREACH(lang ${languages})
|
||||
# Our translations aren't set up entirely as CMake expects, so installation is done in
|
||||
# cmake/Install.cmake instead of using INSTALL_DESTINATION
|
||||
gettext_process_po_files(${lang} ALL
|
||||
GETTEXT_PROCESS_PO_FILES(${lang} ALL
|
||||
PO_FILES po/${lang}.po)
|
||||
endforeach()
|
||||
set(CMAKE_FOLDER)
|
||||
endif()
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
|
||||
# libintl.h can be compiled into the stdlib on some GLibC systems
|
||||
IF(Intl_FOUND AND Intl_LIBRARIES)
|
||||
SET(LIBINTL_INCLUDE "#include <libintl.h>")
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Intl_INCLUDE_DIR})
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Intl_LIBRARIES})
|
||||
ENDIF()
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
${LIBINTL_INCLUDE}
|
||||
#include <stdlib.h>
|
||||
int main () {
|
||||
extern int _nl_msg_cat_cntr;
|
||||
int tmp = _nl_msg_cat_cntr;
|
||||
exit(tmp);
|
||||
}
|
||||
"
|
||||
HAVE__NL_MSG_CAT_CNTR)
|
||||
|
||||
1438
config.guess
vendored
Executable file
1438
config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
1810
config.sub
vendored
Executable file
1810
config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
178
config_cmake.h.in
Normal file
178
config_cmake.h.in
Normal file
@@ -0,0 +1,178 @@
|
||||
/* Define to 1 if you have the `backtrace_symbols' function. */
|
||||
#cmakedefine HAVE_BACKTRACE_SYMBOLS 1
|
||||
|
||||
/* Define to 1 if compiled on WSL */
|
||||
#cmakedefine WSL 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
#cmakedefine HAVE_CLOCK_GETTIME 1
|
||||
|
||||
/* Define to 1 if you have the `ctermid_r' function. */
|
||||
#cmakedefine HAVE_CTERMID_R 1
|
||||
|
||||
/* Define to 1 if you have the `dirfd' function. */
|
||||
#cmakedefine HAVE_DIRFD 1
|
||||
|
||||
/* Define to 1 if you have the <execinfo.h> header file. */
|
||||
#cmakedefine HAVE_EXECINFO_H 1
|
||||
|
||||
/* Define to 1 if you have the `flock' function. */
|
||||
#cmakedefine HAVE_FLOCK 1
|
||||
|
||||
/* Define to 1 if you have the `futimens' function. */
|
||||
#cmakedefine HAVE_FUTIMENS 1
|
||||
|
||||
/* Define to 1 if you have the `futimes' function. */
|
||||
#cmakedefine HAVE_FUTIMES 1
|
||||
|
||||
/* Define to 1 if you have the `getifaddrs' function. */
|
||||
#cmakedefine HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the `getpwent' function. */
|
||||
#cmakedefine HAVE_GETPWENT 1
|
||||
|
||||
/* Define to 1 if you have the `gettext' function. */
|
||||
#cmakedefine HAVE_GETTEXT 1
|
||||
|
||||
/* Define to 1 if you have the `killpg' function. */
|
||||
#cmakedefine HAVE_KILLPG 1
|
||||
|
||||
/* Define to 1 if you have the `lrand48_r' function. */
|
||||
#cmakedefine HAVE_LRAND48_R 1
|
||||
|
||||
/* Define to 1 if you have the `mkostemp' function. */
|
||||
#cmakedefine HAVE_MKOSTEMP 1
|
||||
|
||||
/* Define to 1 if you have the <curses.h> header file. */
|
||||
#cmakedefine HAVE_CURSES_H 1
|
||||
|
||||
/* Define to 1 if you have the <ncurses/curses.h> header file. */
|
||||
#cmakedefine HAVE_NCURSES_CURSES_H 1
|
||||
|
||||
/* Define to 1 if you have the <ncurses.h> header file. */
|
||||
#cmakedefine HAVE_NCURSES_H 1
|
||||
|
||||
/* Define to 1 if you have the <ncurses/term.h> header file. */
|
||||
#cmakedefine HAVE_NCURSES_TERM_H 1
|
||||
|
||||
/* Define to 1 if you have the <siginfo.h> header file. */
|
||||
#cmakedefine HAVE_SIGINFO_H 1
|
||||
|
||||
/* Define to 1 if you have the <spawn.h> header file. */
|
||||
#cmakedefine HAVE_SPAWN_H 1
|
||||
|
||||
/* Define to 1 if you have the `std::wcscasecmp' function. */
|
||||
#cmakedefine HAVE_STD__WCSCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `std::wcsdup' function. */
|
||||
#cmakedefine HAVE_STD__WCSDUP 1
|
||||
|
||||
/* Define to 1 if you have the `std::wcsncasecmp' function. */
|
||||
#cmakedefine HAVE_STD__WCSNCASECMP 1
|
||||
|
||||
/* Define to 1 if `d_type' is a member of `struct dirent'. */
|
||||
#cmakedefine HAVE_STRUCT_DIRENT_D_TYPE 1
|
||||
|
||||
/* Define to 1 if `st_ctime_nsec' is a member of `struct stat'. */
|
||||
#cmakedefine HAVE_STRUCT_STAT_ST_CTIME_NSEC 1
|
||||
|
||||
/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */
|
||||
#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
|
||||
|
||||
/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */
|
||||
#cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
|
||||
|
||||
/* Define to 1 if the sys_errlist array is available. */
|
||||
#cmakedefine HAVE_SYS_ERRLIST 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#cmakedefine HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/sysctl.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SYSCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#cmakedefine HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <term.h> header file. */
|
||||
#cmakedefine HAVE_TERM_H 1
|
||||
|
||||
/* Define to 1 if you have the `wcscasecmp' function. */
|
||||
#cmakedefine HAVE_WCSCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `wcsdup' function. */
|
||||
#cmakedefine HAVE_WCSDUP 1
|
||||
|
||||
/* Define to 1 if you have the `wcslcpy' function. */
|
||||
#cmakedefine HAVE_WCSLCPY 1
|
||||
|
||||
/* Define to 1 if you have the `wcsncasecmp' function. */
|
||||
#cmakedefine HAVE_WCSNCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `wcsndup' function. */
|
||||
#cmakedefine HAVE_WCSNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `wcstod_l' function. */
|
||||
#cmakedefine HAVE_WCSTOD_L 1
|
||||
|
||||
/* Define to 1 if the winsize struct and TIOCGWINSZ macro exist */
|
||||
#cmakedefine HAVE_WINSIZE 1
|
||||
|
||||
/* Define to 1 if the _nl_msg_cat_cntr symbol is exported. */
|
||||
#cmakedefine HAVE__NL_MSG_CAT_CNTR 1
|
||||
|
||||
/* Define to 1 if you have the file `/proc/self/stat'. */
|
||||
#cmakedefine HAVE__PROC_SELF_STAT 1
|
||||
|
||||
/* Define to 1 if the _sys_errs array is available. */
|
||||
#cmakedefine HAVE__SYS__ERRS 1
|
||||
|
||||
/* Define to 1 to disable ncurses macros that conflict with the STL */
|
||||
#define NCURSES_NOMACROS 1
|
||||
|
||||
/* Define to 1 to disable curses macros that conflict with the STL */
|
||||
#define NOMACROS 1
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "https://github.com/fish-shell/fish-shell/issues"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "fish"
|
||||
|
||||
/* Define to 1 if tparm accepts a fixed amount of paramters. */
|
||||
#cmakedefine TPARM_SOLARIS_KLUDGE 1
|
||||
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
/* The size of wchar_t in bits. */
|
||||
#define WCHAR_T_BITS ${WCHAR_T_BITS}
|
||||
|
||||
/* Define if xlocale.h is required for locale_t or wide character support */
|
||||
#cmakedefine HAVE_XLOCALE_H 1
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#ifndef __warn_unused
|
||||
#define __warn_unused __attribute__ ((warn_unused_result))
|
||||
#endif
|
||||
#ifndef __sentinel
|
||||
#define __sentinel __attribute__ ((sentinel))
|
||||
#endif
|
||||
#ifndef __packed
|
||||
#define __packed __attribute__ ((packed))
|
||||
#endif
|
||||
#else
|
||||
#define __warn_unused
|
||||
#define __sentinel
|
||||
#define __packed
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user