diff --git a/.cargo/audit.toml b/.cargo/audit.toml new file mode 100644 index 0000000..9c5241d --- /dev/null +++ b/.cargo/audit.toml @@ -0,0 +1,6 @@ +# cargo audit (supply-chain.yml) reads this; keep it in step with the +# [advisories] ignore list in deny.toml, which carries the reasons. +[advisories] +ignore = [ + "RUSTSEC-2026-0543", # chrono unmaintained +] diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ec9c974..61d91e6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,18 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - version: 2 - updates: - # Rust (Cargo) - package-ecosystem: "cargo" directory: "/" + # The vendored forks' manifests are updated with their upstreams + # (vendor/README.md), not one dependency at a time. + exclude-paths: + - "vendor/**" schedule: interval: "weekly" - open-pull-requests-limit: 1 + open-pull-requests-limit: 5 commit-message: - prefix: "cargo" + prefix: "chore(deps)" labels: - "dependencies" - - "ci" groups: cargo-minor-and-patch: patterns: @@ -24,18 +20,22 @@ updates: update-types: - "minor" - "patch" + ignore: + # termina still requires parking_lot ^0.12, so 0.13 would link two copies + # of the lock crates and raise the MSRV to 1.95; see the parking_lot line + # in Cargo.toml. + - dependency-name: "parking_lot" + versions: [">=0.13"] - # GitHub Actions - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" - open-pull-requests-limit: 1 + open-pull-requests-limit: 5 commit-message: - prefix: "gha" + prefix: "ci" labels: - "dependencies" - - "ci" groups: gha-minor-and-patch: patterns: @@ -44,21 +44,21 @@ updates: - "minor" - "patch" - # Docker - package-ecosystem: "docker" - directory: "docker/" + directory: "/docker" schedule: interval: "weekly" - open-pull-requests-limit: 1 + open-pull-requests-limit: 5 commit-message: - prefix: "docker" + prefix: "chore(deps)" labels: - "dependencies" - - "ci" - groups: - docker-minor-and-patch: - patterns: - - "*" - update-types: - - "minor" - - "patch" + ignore: + # Every Ubuntu tag is chosen on purpose and explained in its Dockerfile: + # 22.04 is the oldest-LTS install test and the bash-version image needs + # a GCC that still compiles bash 5.1. Bump them by hand. + - dependency-name: "ubuntu" + # docker/builder.Dockerfile's AlmaLinux 9 is the glibc 2.34 floor of + # every Linux release build; a major bump raises it. + - dependency-name: "almalinux" + update-types: ["version-update:semver-major"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fba1021..4327198 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,17 +7,20 @@ on: branches: [ "**" ] workflow_dispatch: +# A newer push to the same PR supersedes the older run. A single global group +# made every PR queue behind every other and cancelled whichever was pending. +# Never cancel master/dispatch runs. concurrency: - group: ci - cancel-in-progress: false + group: ci-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read packages: write jobs: - build-ubuntu-1604: - name: Build and test on Ubuntu 16.04 + build: + name: Build and test (glibc 2.34 floor) runs-on: ubuntu-latest steps: - name: Set up Docker Buildx @@ -29,11 +32,9 @@ jobs: files: docker-bake.hcl targets: | extract-integration-test-build-artifact - extract-pre-bash-4-4-integration-test-build-artifact lib-tests set: | extract-integration-test-build-artifact.output=type=local,dest=${{ runner.temp }}/docker/build - extract-pre-bash-4-4-integration-test-build-artifact.output=type=local,dest=${{ runner.temp }}/docker/build-pre-bash-4-4 *.cache-from=type=gha *.cache-to=type=gha,mode=max @@ -48,11 +49,11 @@ jobs: name: Bash integration tests using built library runs-on: ubuntu-latest needs: - - build-ubuntu-1604 + - build strategy: fail-fast: false matrix: - bash_version_slug: [ "4_4-rc1", "4_4_18", "5_0", "5_3" ] + bash_version_slug: [ "5_1", "5_2", "5_3" ] steps: - name: Set up Docker Buildx @@ -83,44 +84,3 @@ jobs: bash-integration-test-${{ matrix.bash_version_slug }}.cache-to=type=gha,mode=max built-artifact.cache-from=type=gha built-artifact.cache-to=type=gha,mode=max - - bash-integration-tests-pre-4-4: - name: Bash integration tests (pre-4.4) using built library - runs-on: ubuntu-latest - needs: - - build-ubuntu-1604 - strategy: - fail-fast: false - matrix: - bash_version_slug: [ "3_2_57" ] - - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - - - name: Login to GHCR - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set lower case owner name - run: | - echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} - env: - OWNER: '${{ github.repository_owner }}' - - - name: Run integration tests - uses: docker/bake-action@v7 - with: - files: docker-bake.hcl - targets: bash-integration-test-${{ matrix.bash_version_slug }} - set: | - specific-bash-version-${{ matrix.bash_version_slug }}.cache-from=type=registry,ref=ghcr.io/${{ env.OWNER_LC }}/bash-${{ matrix.bash_version_slug }}:cache - ${{ github.event_name != 'pull_request' && format('specific-bash-version-{0}.cache-to=type=registry,ref=ghcr.io/{1}/bash-{0}:cache,mode=min', matrix.bash_version_slug, env.OWNER_LC) || '' }} - bash-integration-test-${{ matrix.bash_version_slug }}.cache-from=type=gha - bash-integration-test-${{ matrix.bash_version_slug }}.cache-to=type=gha,mode=max - built-artifact.cache-from=type=gha - built-artifact.cache-to=type=gha,mode=max - diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 3dafd70..109437b 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -5,7 +5,7 @@ run-name: Code Quality on: # yamllint disable-line rule:truthy workflow_dispatch: push: - branches: [ main ] + branches: [ master ] pull_request: branches: [ '**' ] @@ -21,24 +21,62 @@ defaults: permissions: contents: read +env: + CARGO_TERM_COLOR: always + CARGO_NET_RETRY: 5 + jobs: build: name: Check Code runs-on: ubuntu-latest - container: docker.io/rust:1.94.1-slim-trixie + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + + # Same version as rust-toolchain.toml, so this gate and local clippy agree. + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "1.100.0" + components: clippy, rustfmt + + - uses: Swatinem/rust-cache@v2 + with: + key: code-quality - permissions: - contents: write # Required to checkout the repository and push to a release + - name: Check Code + run: | + # No --all: that would also format the vendored path dependencies. + cargo fmt -- --check + cargo clippy --workspace --locked --quiet --all-features --all-targets -- -D warnings + cargo doc --workspace --locked --quiet --no-deps --document-private-items + msrv: + name: Check MSRV (1.91) + runs-on: ubuntu-latest + timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@v7.0.1 with: persist-credentials: false - - name: Check Code + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "1.91.0" + + - uses: Swatinem/rust-cache@v2 + with: + key: msrv-1.91 + + - name: Check advertised minimum Rust version + # rust-toolchain.toml pins 1.100.0 for the workspace; this job must + # override it explicitly or rustup follows the file and the check + # below runs on the pinned version instead of exercising the MSRV. + env: + RUSTUP_TOOLCHAIN: "1.91.0" run: | - rustup component add clippy rustfmt rust-docs - cargo fmt --all -- --check - cargo clippy --workspace --quiet --all-features -- -D warnings - cargo doc --workspace --quiet --no-deps --document-private-items + rustc --version | grep -E '^rustc 1[.]91[.]0 ' + cargo check --workspace --locked --all-targets diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8b1519..bc6a61d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,57 +36,64 @@ jobs: version: ${{ env.VERSION }} build-release: - name: Build ${{ matrix.target }}${{ matrix.suffix }} + name: Build ${{ matrix.target }} needs: create-release runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - # Linux (via cross) - - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: x86_64-unknown-linux-musl, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: aarch64-unknown-linux-musl, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - # Additional Linux architectures - - { target: armv7-unknown-linux-gnueabihf, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: i686-unknown-linux-gnu, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: riscv64gc-unknown-linux-gnu, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: powerpc64le-unknown-linux-gnu, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - # Linux pre_bash_4_4 - - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "--features pre_bash_4_4", suffix: "_pre_bash_4_4" } - # FreeBSD (via cross) - - { target: x86_64-unknown-freebsd, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } + # Linux glibc: docker/builder.Dockerfile (AlmaLinux 9, glibc 2.34 floor), built natively per arch + - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, build_tool: bake, lib: libflyline.so } + - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm, build_tool: bake, lib: libflyline.so } + # Linux musl (via cross) + - { target: x86_64-unknown-linux-musl, os: ubuntu-latest, build_tool: cross, lib: libflyline.so } + - { target: aarch64-unknown-linux-musl, os: ubuntu-latest, build_tool: cross, lib: libflyline.so } # Android (via cross) - - { target: aarch64-linux-android, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: x86_64-linux-android, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: armv7-linux-androideabi, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } - - { target: i686-linux-android, os: ubuntu-latest, build_tool: cross, lib: libflyline.so, feature_flags: "", suffix: "" } + - { target: aarch64-linux-android, os: ubuntu-latest, build_tool: cross, lib: libflyline.so } # macOS (native cargo) - - { target: x86_64-apple-darwin, os: macos-latest, build_tool: cargo, lib: libflyline.dylib, feature_flags: "", suffix: "" } - - { target: aarch64-apple-darwin, os: macos-latest, build_tool: cargo, lib: libflyline.dylib, feature_flags: "", suffix: "" } + - { target: aarch64-apple-darwin, os: macos-latest, build_tool: cargo, lib: libflyline.dylib } steps: - name: Checkout uses: actions/checkout@v7 + # The version pinned in rust-toolchain.toml. `@stable` would install a + # different toolchain from the one rustup then selects in the repo, and + # the target would be added to the wrong one. - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + if: matrix.build_tool != 'bake' + uses: dtolnay/rust-toolchain@master with: + toolchain: "1.100.0" targets: ${{ matrix.target }} - name: Install cross if: matrix.build_tool == 'cross' uses: taiki-e/install-action@v2 with: - tool: cross + tool: cross@0.2.5 - - name: Build ${{ matrix.target }}${{ matrix.suffix }} - run: ${{ matrix.build_tool }} build --release --target ${{ matrix.target }} ${{ matrix.feature_flags }} + - name: Set up Docker Buildx + if: matrix.build_tool == 'bake' + uses: docker/setup-buildx-action@v4 + + - name: Build ${{ matrix.target }} + if: matrix.build_tool == 'bake' + uses: docker/bake-action@v7 + with: + files: docker-bake.hcl + targets: extract-release-artifact + set: | + extract-release-artifact.output=type=local,dest=target/${{ matrix.target }}/release + + - name: Build ${{ matrix.target }} + if: matrix.build_tool != 'bake' + run: ${{ matrix.build_tool }} build --release --lib --target ${{ matrix.target }} - name: Prepare release artifact run: | - ARCHIVE="libflyline-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.suffix }}" + ARCHIVE="libflyline-${{ github.ref_name }}-${{ matrix.target }}" echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV - name: Build archive @@ -136,7 +143,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release edit "${{ needs.create-release.outputs.version }}" --prerelease --draft=false --repo HalFrgrd/flyline + gh release edit "${{ needs.create-release.outputs.version }}" --prerelease --draft=false test-installation: name: test-installation (${{ matrix.target }}) @@ -145,7 +152,7 @@ jobs: strategy: fail-fast: false matrix: - target: [install-test-alpine, install-test-ubuntu, install-test-arch, install-test-termux, install-test-bash-3-2-57] + target: [install-test-alpine, install-test-ubuntu, install-test-arch, install-test-termux] steps: - uses: actions/checkout@v7 - name: Set up Docker Buildx diff --git a/.github/workflows/supply-chain.yml b/.github/workflows/supply-chain.yml new file mode 100644 index 0000000..af634a6 --- /dev/null +++ b/.github/workflows/supply-chain.yml @@ -0,0 +1,58 @@ +name: Supply chain + +# Advisories, licences, bans and sources of the dependency tree (deny.toml). +# Pull requests run it when the dependencies change; the schedule catches +# advisories published against a lockfile nobody touched. +on: + workflow_dispatch: + schedule: + - cron: "0 5 * * *" + push: + branches: [master] + paths: &deps + - "Cargo.toml" + - "Cargo.lock" + - "crates/*/Cargo.toml" + - "vendor/**/Cargo.toml" + - "deny.toml" + - ".cargo/audit.toml" + - ".github/workflows/supply-chain.yml" + pull_request: + branches: [master] + paths: *deps + +concurrency: + group: supply-chain-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: always + CARGO_NET_RETRY: 5 + +jobs: + deny: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "1.100.0" + - uses: Swatinem/rust-cache@v2 + with: + key: supply-chain + - name: Install cargo-deny and cargo-audit + # Pinned; rust-cache keeps ~/.cargo/bin, so later runs skip the build. + run: cargo install --locked cargo-deny@0.22.0 cargo-audit@0.23.0 + - name: cargo deny + run: cargo deny check + - name: cargo audit + # cargo-deny checks the crates the build compiles; cargo-audit reads + # every Cargo.lock entry, including ones never compiled (weak optional + # dependencies of the git forks), so it sees what cargo-deny skips. + run: cargo audit diff --git a/AGENTS.md b/AGENTS.md index 4472adb..5b950a5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,6 +10,7 @@ This document provides a simplified developer guide for [flyline](.), a Bash plu - **[src/shell/bash/symbols.rs](src/shell/bash/symbols.rs)**: C-compatible definitions of GNU Bash internal types, structures, and global variables. - **[src/prompt_manager.rs](src/prompt_manager.rs)**: Asynchronous shell prompt widgets, PS1 configurations, and terminal animations. - **[crates/flybuffer](crates/flybuffer)**: Text state management, cursor movements, and undo/redo stacks. +- **[vendor/](vendor/README.md)**: Vendored forks of ratatui, termina and skim (git subtree). Edit them in place; update from upstream with `git subtree pull` as described in vendor/README.md. ## Useful Commands ```bash @@ -32,13 +33,13 @@ cargo test -p flycomp cargo fmt # Run Code Quality CI checks locally -cargo fmt --all -- --check +cargo fmt -- --check cargo clippy --workspace --all-features -- -D warnings cargo doc --workspace --no-deps --document-private-items ``` > [!TIP] -> Avoid running the full `cargo test` suite locally. The integration tests (`tests/docker_integration_tests.rs`) spawn Docker containers testing multiple versions of Bash, which is extremely slow. Prefer running `cargo test --lib` or testing specific packages. Before pushing, verify code quality with `cargo fmt --all -- --check`, `cargo clippy --workspace --all-features -- -D warnings`, and `cargo doc --workspace --no-deps --document-private-items`. +> Avoid running the full `cargo test` suite locally. The integration tests (`tests/docker_integration_tests.rs`) spawn Docker containers testing multiple versions of Bash, which is extremely slow. Prefer running `cargo test --lib` or testing specific packages. Before pushing, verify code quality with `cargo fmt -- --check`, `cargo clippy --workspace --all-features -- -D warnings`, and `cargo doc --workspace --no-deps --document-private-items`. ## Guidelines 1. **Safety & Stability**: `flyline` runs inside the active shell process. Avoid unwinding panics across the C FFI boundary; wrap entry points in `catch_unwind_safe` to prevent shell crashes. Never create an `App` instance in library unit tests, as `App` depends on global FFI symbols (like `history_list` or `current_readline_prompt`) that are only resolved dynamically when loaded inside Bash, causing linker failures in library test targets. diff --git a/Cargo.lock b/Cargo.lock index 8cc8fef..b0a6a4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,13 +35,14 @@ dependencies = [ [[package]] name = "ansi-to-tui" version = "8.0.1" -source = "git+https://github.com/HalFrgrd/ansi-to-tui.git?branch=main#b9617878f5eb668d8b32830cb38476041756faeb" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42366bb9d958f042bf58f0a85e1b2d091997c1257ca49bddd7e4827aadc65fd" dependencies = [ "nom 8.0.0", "ratatui-core", "simdutf8", "smallvec", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] @@ -110,19 +111,19 @@ dependencies = [ ] [[package]] -name = "arrayvec" -version = "0.7.8" +name = "ar_archive_writer" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" +checksum = "523e5e187fff36fcb8d1d19ccf0ca4ca43ec3d158316057f66dc6f72716bc5ec" +dependencies = [ + "object", +] [[package]] -name = "atomic" -version = "0.6.1" +name = "arrayvec" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" -dependencies = [ - "bytemuck", -] +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "autocfg" @@ -159,9 +160,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.13.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" dependencies = [ "serde_core", ] @@ -177,9 +178,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.3" +version = "3.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" [[package]] name = "by_address" @@ -187,12 +188,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" -[[package]] -name = "bytemuck" -version = "1.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" - [[package]] name = "castaway" version = "0.2.4" @@ -204,9 +199,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.4.2" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e" +checksum = "02f0e023adb368345ce0ca6cdfc0f24a06554468d0e8503e14a0841de79bfa69" dependencies = [ "find-msvc-tools", "shlex", @@ -214,9 +209,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" [[package]] name = "cfg_aliases" @@ -226,12 +221,12 @@ checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", - "cpufeatures 0.3.0", + "cpufeatures 0.3.1", "rand_core 0.10.1", ] @@ -250,9 +245,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.7" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946" +checksum = "844c5c0b65be192cb68d570cca1b21a6444431d24e39c084dc0336177015337c" dependencies = [ "clap_builder", "clap_derive", @@ -272,9 +267,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.6.11" +version = "4.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037e2a1a92236d0aff7e845093f64661d6df4c02c9fcc61a60e9e1d736fa392f" +checksum = "6a35200383f20018d41c14d1ab19c1727c697f544492143f7d93aa39f0187848" dependencies = [ "clap", "clap_lex", @@ -284,21 +279,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.6.7" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0" +checksum = "b4c174f11f949b9ca8c60580925e282b9cbd5454750e506f08648b2038080cd7" dependencies = [ "heck", "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] name = "clap_lex" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +checksum = "e0921b3876b3a1df8a1c9f912e7f94342458022c2e84288015893d83c4d62a79" [[package]] name = "colorchoice" @@ -347,18 +342,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.5.0" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64" dependencies = [ "cfg-if", ] @@ -369,7 +364,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "crossterm_winapi", "mio", "parking_lot", @@ -386,13 +381,13 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "crossterm_winapi", "derive_more", "document-features", "mio", "parking_lot", - "rustix 1.1.4", + "rustix 1.1.6", "serde", "signal-hook", "signal-hook-mio", @@ -428,21 +423,11 @@ dependencies = [ "phf 0.11.3", ] -[[package]] -name = "ctor" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" -dependencies = [ - "link-section", - "linktime-proc-macro", -] - [[package]] name = "darling" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88490bf1b990d87eaaa7ac8aa887f629a08e7359765b4911faf63c3763347d23" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" dependencies = [ "darling_core", "darling_macro", @@ -450,26 +435,26 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084e274f91c482280130e1e34e0b8d6e66776a060d7b6de7b84289ca778868c4" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" dependencies = [ "ident_case", "proc-macro2", "quote", "strsim", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] name = "darling_macro" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5792fa0d41cd2325ce0ffa64f0a340eaebd4971a3a0c5e1ffd2cc488a355e" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ "darling_core", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -480,9 +465,9 @@ checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4" [[package]] name = "deranged" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" [[package]] name = "derive_more" @@ -518,9 +503,9 @@ dependencies = [ [[package]] name = "dirs" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f" dependencies = [ "dirs-sys", ] @@ -534,7 +519,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -552,11 +537,8 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "027cd1402a609c71a9ac333c7e3d90ee042e7a131da1a83da8c60df323f12f61" dependencies = [ - "chrono", "rust_decimal", - "serde", - "thiserror 2.0.20", - "time", + "thiserror 2.0.21", "winnow", ] @@ -568,24 +550,24 @@ checksum = "1ff18235504129e34c411871066cfa4ad108ed6a28d5fb2417057aff7f99bee4" [[package]] name = "either" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" [[package]] name = "errno" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -626,15 +608,15 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.10" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" [[package]] name = "finl_unicode" -version = "1.4.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9844ddc3a6e533d62bba727eb6c28b5d360921d5175e9ff0f1e621a5c590a4d5" +checksum = "09ded33109e99472f809cb7495544506eea45e366725dacf2a383e184f660456" [[package]] name = "fixedbitset" @@ -644,12 +626,13 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.1.9" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4" dependencies = [ "crc32fast", "miniz_oxide", + "zlib-rs", ] [[package]] @@ -667,7 +650,7 @@ dependencies = [ [[package]] name = "flycomp" version = "1.1.2" -source = "git+https://github.com/HalFrgrd/flycomp.git?rev=754be16d7a2130ad12b6d038d42a8933c92c103f#754be16d7a2130ad12b6d038d42a8933c92c103f" +source = "git+https://github.com/HalFrgrd/flycomp.git?rev=34e8e6e798fa35b4daa3d4c5586241e95d2dbacf#34e8e6e798fa35b4daa3d4c5586241e95d2dbacf" dependencies = [ "anyhow", "chrono", @@ -694,7 +677,7 @@ dependencies = [ "lscolors", "parse-style", "pulldown-cmark", - "rand 0.10.3", + "rand 0.10.4", "ratatui", "serde", "skim", @@ -714,7 +697,6 @@ dependencies = [ "chrono", "clap", "clap_complete", - "ctor", "dirs", "duration-str", "easing-function", @@ -726,11 +708,11 @@ dependencies = [ "log", "lscolors", "mimalloc", - "nix", + "nix 0.32.0", "parking_lot", "parse-style", "pulldown-cmark", - "rand 0.10.3", + "rand 0.10.4", "ratatui", "rmp-serde", "rusty-fork", @@ -792,17 +774,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "getrandom" version = "0.3.4" @@ -829,20 +800,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" dependencies = [ "allocator-api2", "equivalent", @@ -893,34 +853,34 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.14.0" +version = "2.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" dependencies = [ "equivalent", - "hashbrown 0.17.1", + "hashbrown", ] [[package]] name = "indoc" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +checksum = "a37b2691796cffeb8a8cd305ac66e65841559f147f4e63231d0eafa4db5384d1" dependencies = [ "rustversion", ] [[package]] name = "instability" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf84e73fa6f27f299dec58e13223cf70db80da872eb921d4f6138342a0eabc8" +checksum = "4c3b5acc1e2fd9375041a388da33d1eb8aed5f7a8c0dd3543e3ea2805adfbe20" dependencies = [ "darling", "indoc", "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -929,7 +889,7 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82cb6a9f675da968c63b6208c641b9dca58fc0133ae53375736b1767b0cab8bd" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -958,15 +918,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" [[package]] name = "js-sys" -version = "0.3.104" +version = "0.3.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" dependencies = [ "cfg-if", "futures-util", @@ -975,13 +935,13 @@ dependencies = [ [[package]] name = "kasuari" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde5057d6143cc94e861d90f591b9303d6716c6b9602309150bd068853c10899" +checksum = "72f14c90e40a6133f4805b83542a7ed7364f56070b447f56e7f4e90297122209" dependencies = [ - "hashbrown 0.16.1", + "hashbrown", "portable-atomic", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] @@ -992,9 +952,9 @@ checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f" [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" [[package]] name = "libc" @@ -1019,9 +979,9 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.19" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" dependencies = [ "libc", ] @@ -1032,21 +992,9 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e752191d037c44ad111a8caa762921926658402f01cc1253f7bef2020ece4f5e" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", ] -[[package]] -name = "link-section" -version = "0.19.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c29a617ce3df32c08497bdc1ab6e2376e0b17948ac166a2fbe5977c5954cd9" - -[[package]] -name = "linktime-proc-macro" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e57c38c1e860fd37c604281cdfb1dd2216977fd76a50f85ba2f388ef3219616" - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -1061,9 +1009,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litrs" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" +checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70" [[package]] name = "lock_api" @@ -1076,17 +1024,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" [[package]] name = "lru" -version = "0.18.2" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d2f2f9b4ba7e6b24d95e7e899329d35be83bcded72c8540cdd5368932d1d90a" +checksum = "ef9ac18847474e638e3702b76c65d4eb93428471a74778ef0f1be711717f89b5" dependencies = [ - "hashbrown 0.17.1", + "hashbrown", ] [[package]] @@ -1101,12 +1049,12 @@ dependencies = [ [[package]] name = "mac_address" -version = "1.1.8" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" +checksum = "f3d0581a75c45969c63afd2bb87b1d8b25cfcc556c7a918cf9bb13b0fe8d2381" dependencies = [ - "nix", - "winapi", + "nix 0.31.4", + "windows-sys 0.61.2", ] [[package]] @@ -1147,9 +1095,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.9" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" dependencies = [ "adler2", "simd-adler32", @@ -1157,9 +1105,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.2" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +checksum = "20521a903f02b0a573cd6840e9d0a5a0cc043d361fe924092cd70f8556cc9c4a" dependencies = [ "libc", "log", @@ -1173,13 +1121,37 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nix" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc81ce8148d3b4f3274da811f11cdd824ae661ee4ef732cdb229825cf5be7f7" +dependencies = [ + "bitflags 2.13.2", "cfg-if", "cfg_aliases", "libc", "memoffset", ] +[[package]] +name = "nix" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77730ed34f01f4990cb2ea67fec715ecebc6fab9a6396cf83c5529b13f581bdc" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -1205,7 +1177,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1236,9 +1208,9 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +checksum = "cabcc654086861f9e1bc5115258de62ef92c79b20f4615a1b0cc57c4e82027d4" dependencies = [ "libc", ] @@ -1249,6 +1221,15 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f" +[[package]] +name = "object" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.21.4" @@ -1340,25 +1321,26 @@ checksum = "10540d36f138f1416b40b8506a837f851658864110501cf1273a33eb2b687282" dependencies = [ "phf 0.14.0", "strum", - "thiserror 2.0.20", + "thiserror 2.0.21", "unicase", ] [[package]] name = "pest" -version = "2.8.8" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df728be843c7070fab6ab7c328c4e9e9d78e23bf749c0669c86ee7ebfa050a2" +checksum = "5ec53fd1d256900a9a771bf2720d42cef6f8bc91b4e25065fbd291e3e7222576" dependencies = [ "memchr", + "pest_stack_guard", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.8.8" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2dd6fc3b26b3462ee188aac870f5a41d398f1cd5e2408d16531bd71c9591fd" +checksum = "adcf794fd301ddc20818a6b4de85ed507f4b45300245cec948982e69e12e3bd7" dependencies = [ "pest", "pest_generator", @@ -1366,26 +1348,36 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.8.8" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7a9205cfb6f596a9e8b689c0a15f9ceb7a1aafae7aaf788150ac65b29975b6" +checksum = "c3073afae5db334c25dea9fc3e230a4f191e920c1df080cb9c0b37c9ce1dbb41" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] name = "pest_meta" -version = "2.8.8" +version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85abd351c0de1e8384fc791a0737111a350394937e92b956b743dac12429f57c" +checksum = "7bc7f614b3742541642af1685faaa910bf6333e3cd3729c2cccd118146a57327" dependencies = [ "pest", ] +[[package]] +name = "pest_stack_guard" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac6154fd4418b8f0b82532c59c26f303f9ca59a64c883e8ce3971fd82733439" +dependencies = [ + "psm", + "stacker", +] + [[package]] name = "phf" version = "0.11.3" @@ -1424,7 +1416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared 0.11.3", - "rand 0.8.7", + "rand 0.8.8", ] [[package]] @@ -1485,9 +1477,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752" [[package]] name = "portable-atomic" @@ -1497,9 +1489,9 @@ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" [[package]] name = "powerfmt" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" [[package]] name = "proc-macro2" @@ -1510,13 +1502,23 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "psm" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd034599e63b970727f70d79e02d62390a4a84f7c6b827c27c46d5ac3fa622" +dependencies = [ + "ar_archive_writer", + "cc", +] + [[package]] name = "pulldown-cmark" version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3db2be46835f013dd3f4fa7f5f7402c537787b54ebb6fe2b94bbdd7e2669bb7b" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "memchr", "unicase", ] @@ -1550,18 +1552,18 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" dependencies = [ "rand_core 0.6.4", ] [[package]] name = "rand" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" +checksum = "8f6fa277c67e6ea590466f04c3fe82cb509f0864fe470643e5570de9514a9b11" dependencies = [ "chacha20", "getrandom 0.4.3", @@ -1583,7 +1585,6 @@ checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "ratatui" version = "0.30.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ "instability", "log", @@ -1600,11 +1601,10 @@ dependencies = [ [[package]] name = "ratatui-core" version = "0.1.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "compact_str", - "hashbrown 0.17.1", + "hashbrown", "itertools 0.14.0", "kasuari", "log", @@ -1612,7 +1612,7 @@ dependencies = [ "palette", "serde", "strum", - "thiserror 2.0.20", + "thiserror 2.0.21", "unicode-segmentation", "unicode-truncate", "unicode-width", @@ -1621,7 +1621,6 @@ dependencies = [ [[package]] name = "ratatui-crossterm" version = "0.1.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ "cfg-if", "crossterm 0.28.1", @@ -1633,7 +1632,6 @@ dependencies = [ [[package]] name = "ratatui-macros" version = "0.7.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ "ratatui-core", "ratatui-widgets", @@ -1642,7 +1640,6 @@ dependencies = [ [[package]] name = "ratatui-termina" version = "0.1.0" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ "instability", "log", @@ -1653,7 +1650,6 @@ dependencies = [ [[package]] name = "ratatui-termion" version = "0.1.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ "instability", "ratatui-core", @@ -1663,7 +1659,6 @@ dependencies = [ [[package]] name = "ratatui-termwiz" version = "0.1.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ "ratatui-core", "termwiz", @@ -1672,10 +1667,9 @@ dependencies = [ [[package]] name = "ratatui-widgets" version = "0.3.2" -source = "git+https://github.com/HalFrgrd/ratatui.git?branch=inline_viewport_improvments#d14aea579c647f23d5ec9d37600cafd22acee3f4" dependencies = [ - "bitflags 2.13.1", - "hashbrown 0.17.1", + "bitflags 2.13.2", + "hashbrown", "indoc", "instability", "itertools 0.14.0", @@ -1694,25 +1688,24 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", ] [[package]] name = "redox_users" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" dependencies = [ - "getrandom 0.2.17", "libredox", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] name = "regex" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" dependencies = [ "aho-corasick", "memchr", @@ -1722,9 +1715,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" dependencies = [ "aho-corasick", "memchr", @@ -1739,9 +1732,9 @@ checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" [[package]] name = "regex-syntax" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" [[package]] name = "rmp" @@ -1764,9 +1757,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.42.1" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2a24f50780bc85f09cc6ac299bdf1424302742d77221106859c9d8b102126a" +checksum = "7653272e75dcac41dc199fbea6f5797633994fafd339943c06c9af16bf29cd3a" dependencies = [ "arrayvec", "num-traits", @@ -1787,7 +1780,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "errno", "libc", "linux-raw-sys 0.4.15", @@ -1796,15 +1789,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1870,7 +1863,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -1950,16 +1943,14 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" [[package]] name = "skim" -version = "4.6.0" -source = "git+https://github.com/HalFrgrd/skim?rev=7908ee85a5f6cd49575925fcc0bdef3999409d26#7908ee85a5f6cd49575925fcc0bdef3999409d26" +version = "5.9.0" dependencies = [ - "cfg_aliases", "log", "memchr", "thread_local", @@ -1973,9 +1964,22 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.2" +version = "1.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" + +[[package]] +name = "stacker" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" +checksum = "707f49d46706bacf8a2b00d51dace3f9de527c13eec3778f570c411f89e69967" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.61.2", +] [[package]] name = "static_assertions" @@ -2034,9 +2038,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.3" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" dependencies = [ "proc-macro2", "quote", @@ -2052,18 +2056,17 @@ dependencies = [ "fastrand", "getrandom 0.4.3", "once_cell", - "rustix 1.1.4", - "windows-sys 0.61.2", + "rustix 1.1.6", + "windows-sys 0.59.0", ] [[package]] name = "termina" -version = "0.3.3" -source = "git+https://github.com/HalFrgrd/termina.git?rev=dfa34e768a46d298e4b06fff6242c3d571f7061f#dfa34e768a46d298e4b06fff6242c3d571f7061f" +version = "0.4.0" dependencies = [ - "bitflags 2.13.1", + "bitflags 2.13.2", "parking_lot", - "rustix 1.1.4", + "rustix 1.1.6", "signal-hook", "windows-sys 0.61.2", ] @@ -2108,7 +2111,7 @@ checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7" dependencies = [ "anyhow", "base64", - "bitflags 2.13.1", + "bitflags 2.13.2", "fancy-regex", "filedescriptor", "finl_unicode", @@ -2118,7 +2121,7 @@ dependencies = [ "libc", "log", "memmem", - "nix", + "nix 0.29.0", "num-derive", "num-traits", "ordered-float", @@ -2154,11 +2157,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.20", + "thiserror-impl 2.0.21", ] [[package]] @@ -2174,13 +2177,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.10", ] [[package]] @@ -2231,21 +2234,21 @@ checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "ucd-trie" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" +checksum = "8f20bdbfc9915686faa18fb5bbe8b4552778505defbf9f12289beefbc44092a6" [[package]] name = "unicase" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" +checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-segmentation" @@ -2278,11 +2281,10 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.29.0" +version = "1.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" +checksum = "3c14b15dffa2f4bd712103e857140aa04a4f2ff6e955c77d7eb8e53ee02a3b64" dependencies = [ - "atomic", "getrandom 0.4.3", "js-sys", "serde_core", @@ -2330,12 +2332,11 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" dependencies = [ "cfg-if", - "once_cell", "rustversion", "wasm-bindgen-macro", "wasm-bindgen-shared", @@ -2343,9 +2344,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2353,22 +2354,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.127" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" dependencies = [ "unicode-ident", ] @@ -2625,6 +2626,12 @@ version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + [[package]] name = "zmij" version = "1.0.23" diff --git a/Cargo.toml b/Cargo.toml index 11946b0..fc10872 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,14 +3,22 @@ members = [ "crates/flybuffer", "crates/flycontent", ] +# Vendored forks keep their own workspaces, lints and formatting; see vendor/README.md. +exclude = ["vendor"] + +[workspace.package] +edition = "2024" +# MSRV, set by the dependency tree (skim needs 1.91). CI checks it in the msrv +# job of code-quality.yml; everything else builds with rust-toolchain.toml. +rust-version = "1.91" [workspace.dependencies] flybuffer = { path = "crates/flybuffer" } flycontent = { path = "crates/flycontent" } anyhow = "1.0" -clap = { version = "4.6.1", features = ["derive"] } -clap_complete = { version = "4.6.3", features = ["unstable-dynamic"] } +clap = { version = "4.6.9", features = ["derive"] } +clap_complete = { version = "4.6.12", features = ["unstable-dynamic"] } easing-function = "0.1" itertools = "0.15" log = "0.4" @@ -24,10 +32,12 @@ tui-scrollbar = "0.2" unicode-segmentation = "1.13" unicode-width = { version = "0.2", default-features = false } -ansi-to-tui = { git = "https://github.com/HalFrgrd/ansi-to-tui.git", branch = "main" } -ratatui = { git = "https://github.com/HalFrgrd/ratatui.git", branch = "inline_viewport_improvments", default-features = false, features = ["macros", "serde", "termina", "unstable-backend-writer", "unstable-rendered-line-info"] } -skim = { git = "https://github.com/HalFrgrd/skim", rev = "7908ee85a5f6cd49575925fcc0bdef3999409d26", default-features = false, features = ["algos_only"] } -termina = { git = "https://github.com/HalFrgrd/termina.git", rev = "dfa34e768a46d298e4b06fff6242c3d571f7061f" } +# crates.io release; [patch.crates-io] points its ratatui-core at the fork below. +ansi-to-tui = "8.0.1" +# Vendored forks (vendor/README.md): changes flyline needs that upstream does not have. +ratatui = { path = "vendor/ratatui/ratatui", default-features = false, features = ["macros", "serde", "termina", "unstable-backend-writer", "unstable-rendered-line-info"] } +skim = { path = "vendor/skim", default-features = false, features = ["algos_only"] } +termina = { path = "vendor/termina" } # ref: https://doc.rust-lang.org/stable/clippy/index.html [workspace.lints.clippy] @@ -39,7 +49,9 @@ multiple_crate_versions = { level = "allow", priority = 1 } [package] name = "flyline" version = "1.11.0" -edition = "2024" +edition.workspace = true +rust-version.workspace = true +publish = false [lints] workspace = true @@ -53,19 +65,23 @@ anyhow.workspace = true chrono = "0.4" clap.workspace = true clap_complete.workspace = true -ctor = "1.0" -dirs = "6.0" -duration-str = "0.21" +dirs = "7.0" +# Only `parse` is used; the default features pull in chrono, time and serde. +duration-str = { version = "0.21", default-features = false } easing-function.workspace = true flybuffer.workspace = true -flycomp = { git = "https://github.com/HalFrgrd/flycomp.git", rev = "754be16d7a2130ad12b6d038d42a8933c92c103f" } +flycomp = { git = "https://github.com/HalFrgrd/flycomp.git", rev = "34e8e6e798fa35b4daa3d4c5586241e95d2dbacf" } flycontent.workspace = true itertools.workspace = true libc = "0.2" log.workspace = true lscolors.workspace = true mimalloc = { version = "0.1", default-features = false, features = ["local_dynamic_tls"] } -nix = { version = "0.29", features = ["fs", "poll", "process", "signal", "user"] } +nix = { version = "0.32", features = ["fs", "poll", "process", "signal", "user"] } +# Held at 0.12: termina (^0.12, also in 0.4.0) would keep 0.12 in the graph, so +# 0.13 compiles parking_lot, parking_lot_core and lock_api twice into the dylib +# that every shell loads, and raises the MSRV to 1.95. Its gain is contended +# lock throughput, which a line editor does not hit. Move when termina does. parking_lot = "0.12" parse-style.workspace = true pulldown-cmark.workspace = true @@ -81,10 +97,7 @@ termina.workspace = true tui-scrollbar.workspace = true unicode-segmentation.workspace = true unicode-width.workspace = true -uuid = { version = "1.10", features = ["v7"] } - -[features] -pre_bash_4_4 = [] +uuid = { version = "1.29", features = ["v7"] } [dev-dependencies] rusty-fork = "0.3.1" @@ -101,18 +114,10 @@ chrono = "0.4" # cross-rs configurations [package.metadata.cross.target.aarch64-linux-android] dockerfile = "docker/cross/aarch64-linux-android.Dockerfile" -[package.metadata.cross.target.aarch64-unknown-linux-gnu] -dockerfile = "docker/cross/aarch64-unknown-linux-gnu.Dockerfile" -[package.metadata.cross.target.armv7-linux-androideabi] -dockerfile = "docker/cross/armv7-linux-androideabi.Dockerfile" -[package.metadata.cross.target.i686-linux-android] -dockerfile = "docker/cross/i686-linux-android.Dockerfile" -[package.metadata.cross.target.x86_64-linux-android] -dockerfile = "docker/cross/x86_64-linux-android.Dockerfile" -[package.metadata.cross.target.x86_64-unknown-linux-gnu] -dockerfile = "docker/cross/x86_64-unknown-linux-gnu.Dockerfile" +# crates.io dependents (ansi-to-tui, tui-scrollbar, ratatui-termina's termina) +# must link the vendored copies, not a second ratatui-core or termina. [patch.crates-io] -ratatui-core = { git = "https://github.com/HalFrgrd/ratatui.git", branch = "inline_viewport_improvments" } -termina = { git = "https://github.com/HalFrgrd/termina.git", rev = "dfa34e768a46d298e4b06fff6242c3d571f7061f" } +ratatui-core = { path = "vendor/ratatui/ratatui-core" } +termina = { path = "vendor/termina" } diff --git a/README.md b/README.md index de152ef..26524de 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,19 @@ Flyline is similar to [ble.sh](https://github.com/akinomyoga/ble.sh) but is writ > [!IMPORTANT] > After installing, run `flyline run-tutorial` and if you don't like the mouse capturing: `flyline mouse --mode disabled` +### Supported platforms + +Flyline needs Bash 4.4 or newer and is tested on Bash 5.1, 5.2 and 5.3. Prebuilt libraries are published for: + +| Platform | Minimum | +|---|---| +| Linux x86_64 / aarch64, glibc | glibc 2.34 (RHEL 9, Amazon Linux 2023, Ubuntu 22.04, Debian 13 and newer) | +| Linux x86_64 / aarch64, musl | Alpine and other musl distros | +| macOS, Apple silicon | macOS 11, with Homebrew Bash | +| Android aarch64 | Termux | + +Other platforms (Intel Macs, 32-bit, FreeBSD, …) can still [build from source](#build-from-source). + ### Quick install: `install.sh` > [!TIP] diff --git a/crates/flybuffer/Cargo.toml b/crates/flybuffer/Cargo.toml index a81c4ab..759a709 100644 --- a/crates/flybuffer/Cargo.toml +++ b/crates/flybuffer/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "flybuffer" version = "0.1.0" -edition = "2024" +edition.workspace = true +rust-version.workspace = true description = "Simple text buffer library" license = "MIT" repository = "https://github.com/HalFrgrd/flyline" diff --git a/crates/flycontent/Cargo.toml b/crates/flycontent/Cargo.toml index 879fd61..f5db477 100644 --- a/crates/flycontent/Cargo.toml +++ b/crates/flycontent/Cargo.toml @@ -1,7 +1,9 @@ [package] name = "flycontent" version = "0.1.0" -edition = "2024" +edition.workspace = true +rust-version.workspace = true +publish = false [lints] workspace = true diff --git a/crates/flycontent/src/builder.rs b/crates/flycontent/src/builder.rs index 783b917..84ee41a 100644 --- a/crates/flycontent/src/builder.rs +++ b/crates/flycontent/src/builder.rs @@ -589,10 +589,10 @@ impl Contents { } // Clear all cells spanning this grapheme - for c in start_col..=end_col { - self.buf[row][c].cell.reset(); - self.buf[row][c].tag = T::default(); - self.buf[row][c].is_continuation = false; + for tagged in &mut self.buf[row][start_col..=end_col] { + tagged.cell.reset(); + tagged.tag = T::default(); + tagged.is_continuation = false; } // Set cursor to start_col and write the character using write_span_internal diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..9f612c9 --- /dev/null +++ b/deny.toml @@ -0,0 +1,47 @@ +# `cargo deny check` runs in .github/workflows/supply-chain.yml. Every target +# triple is in the graph, so Linux-, Android- and macOS-only crates are all +# checked. + +[advisories] +yanked = "deny" +ignore = [ + # chrono is unmaintained (no fix exists). flyline's prompt `\D{format}` + # strings and `flyline` time formatting are chrono strftime by contract, + # and flycomp (build script) uses it too, so swapping to jiff or time is + # its own change. Not a vulnerability. + { id = "RUSTSEC-2026-0543", reason = "chrono unmaintained; migration tracked separately" }, +] + +[licenses] +# Exactly the licences the dependency tree needs; cargo-deny warns when one +# stops being used. Crates offering a choice (MIT OR Apache-2.0, …) are +# satisfied by one of these, so their other options need no entry. +allow = [ + "Apache-2.0", + "BSL-1.0", # ryu + "MIT", + "MPL-2.0", # termina, option-ext (dirs) + "Unicode-3.0", # unicode-ident + "Zlib", # foldhash +] + +[licenses.private] +# flyline and flycontent are `publish = false`; their licence is in +# LICENSE-MIT / LICENSE-GPLv3 and the README, not a crates.io field. +ignore = true + +[bans] +multiple-versions = "warn" +wildcards = "deny" +# Workspace path dependencies (flybuffer, flycontent) carry no version. +allow-wildcard-paths = true + +[sources] +unknown-registry = "deny" +unknown-git = "deny" +# flycomp is HalFrgrd's own crate with no crates.io release. The ratatui, +# termina and skim forks are vendored under vendor/. Nothing else may come +# from git. +allow-git = [ + "https://github.com/HalFrgrd/flycomp.git", +] diff --git a/docker-bake.hcl b/docker-bake.hcl index d1a1546..82c5337 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,9 +1,7 @@ +# The oldest bash on a supported distro is 5.1 (RHEL 9, Ubuntu 22.04); +# 5.2 is Debian 13 / Ubuntu 24.04, 5.3 is current upstream. variable "BASH_VERSION_MATRIX" { - default = ["4.4-rc1", "4.4.18", "5.0", "5.3"] -} - -variable "PRE_BASH_4_4_VERSION_MATRIX" { - default = ["3.2.57"] + default = ["5.1", "5.2", "5.3"] } variable "FLYLINE_INSTALL_VERSION" { @@ -38,16 +36,6 @@ target "extract-integration-test-build-artifact" { target = "flyline-built-artifact" } -target "extract-pre-bash-4-4-integration-test-build-artifact" { - context = "." - output = ["type=local,dest=docker/build-pre-bash-4-4-integration-test"] - dockerfile = "docker/builder.Dockerfile" - target = "flyline-built-artifact" - args = { - CARGO_FEATURES = "pre_bash_4_4" - } -} - target "lib-tests" { context = "." dockerfile = "docker/builder.Dockerfile" @@ -67,19 +55,6 @@ target "specific-bash-version" { tags = ["bash-${docker_bash_version}"] } -target "specific-bash-version-pre-4-4" { - context = "." - dockerfile = "docker/specific_bash_version.Dockerfile" - name = "specific-bash-version-${replace(docker_bash_version, ".", "_")}" - matrix = { - docker_bash_version = PRE_BASH_4_4_VERSION_MATRIX - } - args = { - DOCKER_BASH_VERSION = docker_bash_version - } - tags = ["bash-${docker_bash_version}"] -} - target "bash-integration-tests" { context = "." contexts = { @@ -96,23 +71,6 @@ target "bash-integration-tests" { } } -target "bash-integration-tests-pre-4-4" { - context = "." - contexts = { - built-artifact = "target:extract-pre-bash-4-4-integration-test-build-artifact", - specific-bash-version = "target:specific-bash-version-${replace(docker_bash_version, ".", "_")}" - } - name = "bash-integration-test-${replace(docker_bash_version, ".", "_")}" - tags = ["bash-integration-test-pre-4-4-${docker_bash_version}"] - matrix = { - docker_bash_version = PRE_BASH_4_4_VERSION_MATRIX - } - dockerfile = "docker/bash_integration_test.Dockerfile" - args = { - DOCKER_BASH_VERSION = docker_bash_version - } -} - @@ -302,17 +260,6 @@ target "install-test-termux" { } -target "install-test-bash-3-2-57" { - context = "." - contexts = { - specific-bash-version = "target:specific-bash-version-3_2_57" - } - dockerfile = "docker/install_test_bash_3.2.57.Dockerfile" - args = { - FLYLINE_INSTALL_VERSION = FLYLINE_INSTALL_VERSION - } -} - target "test-mimalloc-symbols" { context = "." dockerfile = "docker/arch_linux_mimalloc_symbols.Dockerfile" diff --git a/docker/builder.Dockerfile b/docker/builder.Dockerfile index 58af378..187f029 100644 --- a/docker/builder.Dockerfile +++ b/docker/builder.Dockerfile @@ -4,32 +4,31 @@ # the whole idea is to build dependencies in a separate stage and let docker cache them # so that we don't have to recompile all dependencies on every code change. -# Stage 1: Builder - Use Ubuntu 16.04 for glibc 2.23 compatibility -# targetting this older glibc version ensures compatibility with a wide range of host systems -FROM ubuntu:16.04 AS chef - -# Prevent interactive prompts during package installation -ENV DEBIAN_FRONTEND=noninteractive - -# Install build dependencies -RUN apt-get update && apt-get install -y \ - curl \ - build-essential \ - pkg-config \ - binutils \ - && rm -rf /var/lib/apt/lists/* - -# Install Rust -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# Stage 1: Builder. The base image's glibc is the oldest the library can be +# loaded with, so it is the support floor: AlmaLinux 9 has glibc 2.34, the +# oldest of the supported distros (RHEL 9, Amazon Linux 2023; Ubuntu 22.04 +# has 2.35, Debian 13 2.41). Built natively for amd64 and arm64. +FROM almalinux:9 AS chef + +RUN dnf install -y --setopt=install_weak_deps=False gcc git \ + && dnf clean all + +# Install rustup only; the toolchain itself is the one pinned in +# rust-toolchain.toml, so the release library is built with the same compiler +# CI lints with. A toolchain bump invalidates this layer and everything below. +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain none ENV PATH="/root/.cargo/bin:${PATH}" WORKDIR /app -RUN cargo install cargo-chef --locked +COPY rust-toolchain.toml ./ +RUN rustup toolchain install +RUN cargo install cargo-chef@0.1.78 --locked # Stage 2: Planner FROM chef AS planner COPY Cargo.toml Cargo.lock build.rs ./ COPY crates ./crates +COPY vendor ./vendor COPY src ./src COPY examples ./examples RUN cargo chef prepare --recipe-path recipe.json @@ -37,19 +36,24 @@ RUN cargo chef prepare --recipe-path recipe.json # Stage 3: Run final Build FROM chef AS flyline-builder -ARG CARGO_FEATURES COPY --from=planner /app/recipe.json recipe.json -RUN cargo chef cook --release ${CARGO_FEATURES:+--features $CARGO_FEATURES} --recipe-path recipe.json +# The vendored forks are path dependencies outside the workspace, which the +# recipe does not skeletonize; cook builds them with the other dependencies. +COPY vendor ./vendor +RUN cargo chef cook --release --recipe-path recipe.json COPY Cargo.toml Cargo.lock build.rs ./ COPY crates ./crates COPY src ./src COPY examples ./examples COPY tests ./tests -RUN cargo build --release ${CARGO_FEATURES:+--features $CARGO_FEATURES} +RUN cargo build --release +# Guard the floor: no symbol may need a glibc newer than the base image's. +RUN newest="$(objdump -T target/release/libflyline.so | grep -o 'GLIBC_2\.[0-9.]*' | sort -uV | tail -1)" \ + && echo "newest glibc symbol version: $newest" \ + && [ "$(printf '%s\nGLIBC_2.34\n' "$newest" | sort -V | tail -1)" = "GLIBC_2.34" ] FROM flyline-builder AS flyline-lib-tests -ARG CARGO_FEATURES -RUN cargo test --release ${CARGO_FEATURES:+--features $CARGO_FEATURES} --lib +RUN cargo test --release --lib # Build image with output. This won't have anything in the file system apart from the built library diff --git a/docker/cross/aarch64-unknown-linux-gnu.Dockerfile b/docker/cross/aarch64-unknown-linux-gnu.Dockerfile deleted file mode 100644 index 87c4b13..0000000 --- a/docker/cross/aarch64-unknown-linux-gnu.Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos - -# Create a compatibility stdatomic.h for GCC 4.8.5 -RUN echo '#ifndef _COMPAT_STDATOMIC_H' > /usr/local/include/stdatomic.h && \ - echo '#define _COMPAT_STDATOMIC_H' >> /usr/local/include/stdatomic.h && \ - echo '#include ' >> /usr/local/include/stdatomic.h && \ - echo '#include ' >> /usr/local/include/stdatomic.h && \ - echo 'typedef enum {' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_relaxed = __ATOMIC_RELAXED,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_consume = __ATOMIC_CONSUME,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_acquire = __ATOMIC_ACQUIRE,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_release = __ATOMIC_RELEASE,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_acq_rel = __ATOMIC_ACQ_REL,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_seq_cst = __ATOMIC_SEQ_CST' >> /usr/local/include/stdatomic.h && \ - echo '} memory_order;' >> /usr/local/include/stdatomic.h && \ - echo '#define _Atomic(T) T' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_load_explicit(object, order) __atomic_load_n(object, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_store_explicit(object, desired, order) __atomic_store_n(object, desired, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_exchange_explicit(object, desired, order) __atomic_exchange_n(object, desired, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) __atomic_compare_exchange_n(object, expected, desired, 0, success, failure)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) __atomic_compare_exchange_n(object, expected, desired, 1, success, failure)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_add_explicit(object, operand, order) __atomic_fetch_add(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_sub_explicit(object, operand, order) __atomic_fetch_sub(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_and_explicit(object, operand, order) __atomic_fetch_and(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_or_explicit(object, operand, order) __atomic_fetch_or(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#endif' >> /usr/local/include/stdatomic.h && \ - cp /usr/local/include/stdatomic.h /usr/aarch64-linux-gnu/include/stdatomic.h - -# Create a compiler wrapper to filter out the unsupported -Wno-error=date-time flag and inject C11 flags -RUN for bin in gcc g++ aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ x86_64-redhat-linux-gcc x86_64-redhat-linux-g++; do \ - if [ -f /usr/bin/$bin ]; then \ - mv /usr/bin/$bin /usr/bin/$bin.real && \ - echo '#!/bin/bash' > /usr/bin/$bin && \ - echo 'args=()' >> /usr/bin/$bin && \ - echo 'for arg in "$@"; do' >> /usr/bin/$bin && \ - echo ' if [[ "$arg" != "-Wno-error=date-time" && "$arg" != "-Werror=date-time" ]]; then' >> /usr/bin/$bin && \ - echo ' args+=("$arg")' >> /usr/bin/$bin && \ - echo ' fi' >> /usr/bin/$bin && \ - echo 'done' >> /usr/bin/$bin && \ - echo 'real_bin=$(readlink -f "$0")' >> /usr/bin/$bin && \ - echo 'binary_name=$(basename "$real_bin")' >> /usr/bin/$bin && \ - echo 'if [[ "$binary_name" != *g++* && "$binary_name" != *c++* ]]; then' >> /usr/bin/$bin && \ - echo ' args+=("-std=gnu11" "-D__has_include(x)=0")' >> /usr/bin/$bin && \ - echo 'fi' >> /usr/bin/$bin && \ - echo 'exec "$real_bin.real" "${args[@]}"' >> /usr/bin/$bin && \ - chmod +x /usr/bin/$bin; \ - fi; \ - done diff --git a/docker/cross/armv7-linux-androideabi.Dockerfile b/docker/cross/armv7-linux-androideabi.Dockerfile deleted file mode 100644 index 2d06653..0000000 --- a/docker/cross/armv7-linux-androideabi.Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM ghcr.io/cross-rs/armv7-linux-androideabi:main - -# Create libunwind.a symlinks where the NDK gcc linker expects them -RUN find /android-ndk -name "libgcc.a" -exec sh -c 'for f; do ln -sf "$f" "$(dirname "$f")/libunwind.a"; done' _ {} + || true -RUN find /android-ndk -name "libunwind.a" -exec sh -c 'for f; do cp -f "$f" /android-ndk/sysroot/usr/lib/arm-linux-androideabi/ 2>/dev/null || true; done' _ {} + -RUN sh -c 'cc=$(find /android-ndk -name "*arm*clang" | head -n1); "$cc" -shared -o /android-ndk/sysroot/usr/lib/arm-linux-androideabi/libreadline.so -x c /dev/null' || true -RUN find /android-ndk -name "libc.so" -o -name "libc.a" -exec sh -c 'for f; do cp -f /android-ndk/sysroot/usr/lib/arm-linux-androideabi/libreadline.so "$(dirname "$f")/" 2>/dev/null || true; done' _ {} + diff --git a/docker/cross/i686-linux-android.Dockerfile b/docker/cross/i686-linux-android.Dockerfile deleted file mode 100644 index c56e9c1..0000000 --- a/docker/cross/i686-linux-android.Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM ghcr.io/cross-rs/i686-linux-android:main - -# Create libunwind.a symlinks where the NDK gcc linker expects them -RUN find /android-ndk -name "libgcc.a" -exec sh -c 'for f; do ln -sf "$f" "$(dirname "$f")/libunwind.a"; done' _ {} + || true -RUN find /android-ndk -name "libunwind.a" -exec sh -c 'for f; do cp -f "$f" /android-ndk/sysroot/usr/lib/i686-linux-android/ 2>/dev/null || true; done' _ {} + -RUN sh -c 'cc=$(find /android-ndk -name "i686-linux-android*-clang" | head -n1); "$cc" -shared -o /android-ndk/sysroot/usr/lib/i686-linux-android/libreadline.so -x c /dev/null' || true -RUN find /android-ndk -name "libc.so" -o -name "libc.a" -exec sh -c 'for f; do cp -f /android-ndk/sysroot/usr/lib/i686-linux-android/libreadline.so "$(dirname "$f")/" 2>/dev/null || true; done' _ {} + diff --git a/docker/cross/x86_64-linux-android.Dockerfile b/docker/cross/x86_64-linux-android.Dockerfile deleted file mode 100644 index 6b7c633..0000000 --- a/docker/cross/x86_64-linux-android.Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM ghcr.io/cross-rs/x86_64-linux-android:main - -# Create libunwind.a symlinks where the NDK gcc linker expects them -RUN find /android-ndk -name "libgcc.a" -exec sh -c 'for f; do ln -sf "$f" "$(dirname "$f")/libunwind.a"; done' _ {} + || true -RUN find /android-ndk -name "libunwind.a" -exec sh -c 'for f; do cp -f "$f" /android-ndk/sysroot/usr/lib/x86_64-linux-android/ 2>/dev/null || true; done' _ {} + -RUN sh -c 'cc=$(find /android-ndk -name "x86_64-linux-android*-clang" | head -n1); "$cc" -shared -o /android-ndk/sysroot/usr/lib/x86_64-linux-android/libreadline.so -x c /dev/null' || true -RUN find /android-ndk -name "libc.so" -o -name "libc.a" -exec sh -c 'for f; do cp -f /android-ndk/sysroot/usr/lib/x86_64-linux-android/libreadline.so "$(dirname "$f")/" 2>/dev/null || true; done' _ {} + diff --git a/docker/cross/x86_64-unknown-linux-gnu.Dockerfile b/docker/cross/x86_64-unknown-linux-gnu.Dockerfile deleted file mode 100644 index 384ee0b..0000000 --- a/docker/cross/x86_64-unknown-linux-gnu.Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos - -# Create a compatibility stdatomic.h for GCC 4.8.5 -RUN echo '#ifndef _COMPAT_STDATOMIC_H' > /usr/local/include/stdatomic.h && \ - echo '#define _COMPAT_STDATOMIC_H' >> /usr/local/include/stdatomic.h && \ - echo '#include ' >> /usr/local/include/stdatomic.h && \ - echo '#include ' >> /usr/local/include/stdatomic.h && \ - echo 'typedef enum {' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_relaxed = __ATOMIC_RELAXED,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_consume = __ATOMIC_CONSUME,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_acquire = __ATOMIC_ACQUIRE,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_release = __ATOMIC_RELEASE,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_acq_rel = __ATOMIC_ACQ_REL,' >> /usr/local/include/stdatomic.h && \ - echo ' memory_order_seq_cst = __ATOMIC_SEQ_CST' >> /usr/local/include/stdatomic.h && \ - echo '} memory_order;' >> /usr/local/include/stdatomic.h && \ - echo '#define _Atomic(T) T' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_load_explicit(object, order) __atomic_load_n(object, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_store_explicit(object, desired, order) __atomic_store_n(object, desired, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_exchange_explicit(object, desired, order) __atomic_exchange_n(object, desired, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) __atomic_compare_exchange_n(object, expected, desired, 0, success, failure)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) __atomic_compare_exchange_n(object, expected, desired, 1, success, failure)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_add_explicit(object, operand, order) __atomic_fetch_add(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_sub_explicit(object, operand, order) __atomic_fetch_sub(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_and_explicit(object, operand, order) __atomic_fetch_and(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#define atomic_fetch_or_explicit(object, operand, order) __atomic_fetch_or(object, operand, order)' >> /usr/local/include/stdatomic.h && \ - echo '#endif' >> /usr/local/include/stdatomic.h - -# Create a compiler wrapper to filter out the unsupported -Wno-error=date-time flag and inject C11 flags -RUN for bin in gcc g++ x86_64-redhat-linux-gcc x86_64-redhat-linux-g++; do \ - if [ -f /usr/bin/$bin ]; then \ - mv /usr/bin/$bin /usr/bin/$bin.real && \ - echo '#!/bin/bash' > /usr/bin/$bin && \ - echo 'args=()' >> /usr/bin/$bin && \ - echo 'for arg in "$@"; do' >> /usr/bin/$bin && \ - echo ' if [[ "$arg" != "-Wno-error=date-time" && "$arg" != "-Werror=date-time" ]]; then' >> /usr/bin/$bin && \ - echo ' args+=("$arg")' >> /usr/bin/$bin && \ - echo ' fi' >> /usr/bin/$bin && \ - echo 'done' >> /usr/bin/$bin && \ - echo 'real_bin=$(readlink -f "$0")' >> /usr/bin/$bin && \ - echo 'binary_name=$(basename "$real_bin")' >> /usr/bin/$bin && \ - echo 'if [[ "$binary_name" != *g++* && "$binary_name" != *c++* ]]; then' >> /usr/bin/$bin && \ - echo ' args+=("-std=gnu11" "-D__has_include(x)=0")' >> /usr/bin/$bin && \ - echo 'fi' >> /usr/bin/$bin && \ - echo 'exec "$real_bin.real" "${args[@]}"' >> /usr/bin/$bin && \ - chmod +x /usr/bin/$bin; \ - fi; \ - done diff --git a/docker/demo_base.Dockerfile b/docker/demo_base.Dockerfile index 4020646..023a8ec 100644 --- a/docker/demo_base.Dockerfile +++ b/docker/demo_base.Dockerfile @@ -1,7 +1,7 @@ # Base image for demo generation # Use a recent Ubuntu base image -FROM ubuntu:24.04 AS demo-base +FROM ubuntu:26.04 AS demo-base # Create a non-root user for demos RUN useradd -m -s /bin/bash john diff --git a/docker/flyline_help.Dockerfile b/docker/flyline_help.Dockerfile index ca2fd6f..d9b2624 100644 --- a/docker/flyline_help.Dockerfile +++ b/docker/flyline_help.Dockerfile @@ -1,6 +1,6 @@ -FROM ubuntu:20.04 AS help-runner +FROM ubuntu:26.04 AS help-runner -# ubuntu:20.04 ships with bash 5.0; no extra install needed. +# Any bash >= 4.4 loads the library; the help text does not depend on its version. # Prevent interactive prompts during any potential package installation ENV DEBIAN_FRONTEND=noninteractive # Disable color output from clap so the saved text is plain ASCII diff --git a/docker/install_test_bash_3.2.57.Dockerfile b/docker/install_test_bash_3.2.57.Dockerfile deleted file mode 100644 index 59cd9d4..0000000 --- a/docker/install_test_bash_3.2.57.Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM specific-bash-version - -ARG FLYLINE_INSTALL_VERSION - -RUN apt-get update && apt-get install -y curl util-linux && rm -rf /var/lib/apt/lists/* - -RUN FLYLINE_INSTALL_VERSION=${FLYLINE_INSTALL_VERSION} bash -c "curl -sSfL https://github.com/HalFrgrd/flyline/releases/download/${FLYLINE_INSTALL_VERSION}/install.sh | bash" - -RUN script -q -e -c "/bin/bash -i -c 'flyline --version'" /dev/null diff --git a/docker/install_test_ubuntu.Dockerfile b/docker/install_test_ubuntu.Dockerfile index 197080f..945da7d 100644 --- a/docker/install_test_ubuntu.Dockerfile +++ b/docker/install_test_ubuntu.Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:22.04 +# The oldest supported Ubuntu LTS (glibc 2.35, bash 5.1), close to the glibc 2.34 floor. +FROM ubuntu:22.04 ARG FLYLINE_INSTALL_VERSION diff --git a/docker/specific_bash_version.Dockerfile b/docker/specific_bash_version.Dockerfile index 9d7a57e..7ce1205 100644 --- a/docker/specific_bash_version.Dockerfile +++ b/docker/specific_bash_version.Dockerfile @@ -1,3 +1,6 @@ +# Stays on 24.04 (GCC 13): 26.04's GCC 15 defaults to C23, where the K&R +# declarations in bash 5.1 and older are errors (mkbuiltins.c: "too many +# arguments to function 'xmalloc'"). FROM ubuntu:24.04 ARG DOCKER_BASH_VERSION diff --git a/flake.lock b/flake.lock index fe90317..1b51811 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1783522502, - "narHash": "sha256-iffAls3iaNTyJC2faYcUXSI+Gp02cDjYl+MygxKl2GI=", + "lastModified": 1795234589, + "narHash": "sha256-f/VVvxf5RsQgWVhUtefoca5ktVg0DA2bnkMOcmSnozo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0bb7ec54c8483066ec9d7720e780a5caa71f8612", + "rev": "2786a2a72088ecf32aea5b3ec52099e6a7cff78f", "type": "github" }, "original": { diff --git a/install.sh b/install.sh index f6a7085..49620e8 100755 --- a/install.sh +++ b/install.sh @@ -67,7 +67,7 @@ cleanup_flyline_install() { trap - EXIT 2>/dev/null || true fi unset -f expand_path say warn err err_no_exit need_cmd download get_latest_version detect_os detect_arch detect_libc detect_bash_version_parts is_bash_version_4_4_or_later is_system_bash_pre_4_4 find_homebrew_bash verify_bash_environment verify_sha256 cleanup_flyline_install is_sourced is_interactive main 2>/dev/null || true - unset REPO INSTALL_DIR BASHRC OS ARCH TARGET LIB_NAME VERSION LIB_PATH ENABLE_CMD TMP_DIR _FLYLINE_IS_SOURCED _FLYLINE_SAVED_OPTS _FLYLINE_SAVED_TRAP 2>/dev/null || true + unset REPO INSTALL_DIR BASHRC OS ARCH BREW_BASH TARGET LIB_NAME VERSION LIB_PATH ENABLE_CMD TMP_DIR _FLYLINE_IS_SOURCED _FLYLINE_SAVED_OPTS _FLYLINE_SAVED_TRAP 2>/dev/null || true fi } @@ -127,8 +127,7 @@ detect_os() { case "$os" in Linux) echo "linux" ;; Darwin) echo "darwin" ;; - FreeBSD) echo "freebsd" ;; - *) err "Unsupported OS: $os" ;; + *) err "Unsupported OS: $os. Prebuilt libraries exist for Linux, macOS and Android (Termux)." ;; esac } @@ -137,11 +136,7 @@ detect_arch() { case "$arch" in x86_64 | amd64) echo "x86_64" ;; aarch64 | arm64) echo "aarch64" ;; - armv7* | armhf) echo "armv7" ;; - i386 | i486 | i586 | i686) echo "i686" ;; - riscv64) echo "riscv64gc" ;; - ppc64le | powerpc64le) echo "powerpc64le" ;; - *) err "Unsupported architecture: $arch" ;; + *) err "Unsupported architecture: $arch. Prebuilt libraries exist for x86_64 and aarch64; build from source for others." ;; esac } @@ -254,70 +249,45 @@ main() { OS="$(detect_os)" ARCH="$(detect_arch)" + # flyline needs bash >= 4.4, which calls _builtin_load on `enable -f`. + # Every supported Linux and Termux ships newer; macOS's /bin/bash is 3.2. if is_system_bash_pre_4_4; then - use_bash_pre_4_4=true - else - use_bash_pre_4_4=false + BREW_BASH="" + if [ "$OS" = "darwin" ]; then + BREW_BASH="$(find_homebrew_bash)" + fi + if [ -n "$BREW_BASH" ]; then + warn "Your system Bash is older than 4.4 and cannot load flyline." + warn "Ensure that you use $BREW_BASH for flyline." + elif [ "$OS" = "darwin" ]; then + err_no_exit "Your system Bash is older than 4.4 and cannot load flyline." + err_no_exit "To use flyline on macOS, please install a modern Bash using Homebrew:" + err_no_exit " brew install bash" + err "Then re-run the installer using Homebrew Bash." + else + err "flyline needs Bash 4.4 or newer; this Bash is older." + fi fi if [ "$OS" = "darwin" ]; then - TARGET="${ARCH}-apple-darwin" - LIB_NAME="libflyline.dylib" - - # Flyline can run on the 3.2.57 version of Bash. - # However, the Bash binary on macOS is often compiled without linkable symbols required to load the Flyline plugin. - if $use_bash_pre_4_4; then - BREW_BASH="$(find_homebrew_bash)" - if [ -n "$BREW_BASH" ]; then - warn "Your system Bash is older than 4.4. This version won't have been compiled with custom plugin support." - warn "Ensure that you use $BREW_BASH for flyline." - use_bash_pre_4_4=false - else - err_no_exit "Your system Bash is older than 4.4 and lacks custom loadable plugin support." - err_no_exit "To use flyline on macOS, please install a modern Bash using Homebrew:" - err_no_exit " brew install bash" - err "Then re-run the installer using Homebrew Bash." - fi + if [ "$ARCH" != "aarch64" ]; then + err "Intel Macs have no prebuilt library; build from source with: cargo build --release --lib" fi - elif [ "$OS" = "freebsd" ]; then - if [ "$ARCH" != "x86_64" ]; then - err "Unsupported FreeBSD architecture: $ARCH. Only x86_64 is supported." - fi - TARGET="x86_64-unknown-freebsd" - LIB_NAME="libflyline.so" + TARGET="aarch64-apple-darwin" + LIB_NAME="libflyline.dylib" elif [ "$OS" = "android" ]; then case "$ARCH" in aarch64) TARGET="aarch64-linux-android" ;; - x86_64) - TARGET="x86_64-linux-android" - ;; - armv7) - TARGET="armv7-linux-androideabi" - ;; - i686) - TARGET="i686-linux-android" - ;; *) - err "Unsupported Android architecture: $ARCH" + err "Unsupported Android architecture: $ARCH. Only aarch64 (arm64) is supported." ;; esac LIB_NAME="libflyline.so" else LIBC="$(detect_libc)" - case "$ARCH" in - armv7) - if [ "$LIBC" = "gnu" ]; then - TARGET="armv7-unknown-linux-gnueabihf" - else - err "Unsupported libc ($LIBC) for armv7. Only gnu (gnueabihf) is supported." - fi - ;; - *) - TARGET="${ARCH}-unknown-linux-${LIBC}" - ;; - esac + TARGET="${ARCH}-unknown-linux-${LIBC}" LIB_NAME="libflyline.so" fi @@ -334,14 +304,8 @@ main() { ARCHIVE_STEM="libflyline-${VERSION}-${TARGET}" - if $use_bash_pre_4_4; then - say "Detected Bash < 4.4, using pre-bash-4.4 build..." - ARCHIVE="${ARCHIVE_STEM}_pre_bash_4_4.tar.gz" - ARCHIVE_SHA256="${ARCHIVE}.sha256" - else - ARCHIVE="${ARCHIVE_STEM}.tar.gz" - ARCHIVE_SHA256="${ARCHIVE}.sha256" - fi + ARCHIVE="${ARCHIVE_STEM}.tar.gz" + ARCHIVE_SHA256="${ARCHIVE}.sha256" DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}/${ARCHIVE}" SHA256_URL="https://github.com/${REPO}/releases/download/${VERSION}/${ARCHIVE_SHA256}" diff --git a/nix/package.nix b/nix/package.nix index 4e62a11..8a6cab2 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -39,10 +39,8 @@ rustPlatform.buildRustPackage { # The docker_integration_tests need Docker, which the sandbox lacks; skip them. checkFlags = [ - "--skip=test_bash_3_2_57" - "--skip=test_bash_4_4_18" - "--skip=test_bash_4_4_rc1" - "--skip=test_bash_5_0" + "--skip=test_bash_5_1" + "--skip=test_bash_5_2" "--skip=test_bash_5_3" ]; diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..a003f2a --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,7 @@ +# One toolchain for CI, Docker, release builds and every machine. A drifting +# `stable` means local clippy and CI clippy disagree, and a release can fail on +# a lint nobody saw locally. Bump this deliberately, with the code-quality gate +# run on the new version. The MSRV is `rust-version` in Cargo.toml. +[toolchain] +channel = "1.100.0" +components = ["clippy", "rustfmt"] diff --git a/src/app/ui.rs b/src/app/ui.rs index 70fcec0..9097c8a 100644 --- a/src/app/ui.rs +++ b/src/app/ui.rs @@ -2004,13 +2004,16 @@ impl App<'_> { // Retroactive style/fill pass for the single row let suggestion_width = main_text_width; - for col_idx in (x as usize + 1)..(x as usize + 1 + inner_width) { - let cell = &mut content.buf[current_y as usize][col_idx]; + let first_col = x as usize + 1; + let row = &mut content.buf[current_y as usize]; + for (relative_col, cell) in row[first_col..first_col + inner_width] + .iter_mut() + .enumerate() + { if cell.cell.symbol().is_empty() { cell.cell.set_symbol(" "); } cell.tag = tag; - let relative_col = col_idx - (x as usize + 1); if relative_col < suggestion_width { cell.cell .set_style(Palette::convert_to_highlighted(cell.cell.style())); @@ -2053,8 +2056,9 @@ impl App<'_> { // Retroactive style/fill pass for the selected item rows to make sure they are highlighted properly let mut in_description = false; for row_idx in item_start_row..=item_end_row { - for col_idx in (x as usize + 1)..(x as usize + 1 + inner_width) { - let cell = &mut content.buf[row_idx as usize][col_idx]; + let first_col = x as usize + 1; + let row = &mut content.buf[row_idx as usize]; + for cell in &mut row[first_col..first_col + inner_width] { if !cell.cell.symbol().is_empty() && !cell.cell.style().add_modifier.contains(Modifier::REVERSED) { diff --git a/src/bash_builtin.rs b/src/bash_builtin.rs index e6824b5..461192c 100644 --- a/src/bash_builtin.rs +++ b/src/bash_builtin.rs @@ -1,9 +1,6 @@ use libc::{c_char, c_int}; use std::sync::Mutex; -#[cfg(feature = "pre_bash_4_4")] -use ctor::ctor; - use crate::shell::bash::{funcs as bash_funcs, symbols as bash_symbols}; use crate::{LongLived, SigchldGuard, app, cli, logging, settings}; @@ -228,16 +225,7 @@ pub static mut flyline_struct: bash_symbols::BashBuiltin = bash_symbols::BashBui handle: std::ptr::null(), }; -// On pre-bash-4.4 builds, register a shared-library constructor so that flyline -// is initialised as soon as the library is loaded via `enable -f`. -// On newer versions of bash `flyline_builtin_load` is called automatically by bash during enable. -#[cfg(feature = "pre_bash_4_4")] -#[ctor(unsafe)] -fn flyline_builtin_load_ctor() { - let _ = flyline_load_common(); -} - -#[cfg(not(feature = "pre_bash_4_4"))] +// Bash >= 4.4 calls `flyline_builtin_load` itself during `enable -f`. #[unsafe(no_mangle)] pub extern "C" fn flyline_builtin_load(_arg: *const c_char) -> c_int { flyline_load_common() @@ -425,9 +413,7 @@ fn flyline_load_common() -> c_int { SUCCESS } -// Its easier to just not unload on older bash versions -// Maybe I could use a fini_array function to unload, but I doubt its worth the effort. -#[cfg(not(feature = "pre_bash_4_4"))] +// Bash >= 4.4 calls `flyline_builtin_unload` during `enable -d`. #[unsafe(no_mangle)] pub extern "C" fn flyline_builtin_unload() { log::info!("flyline_builtin_unload called, unloading flyline"); diff --git a/src/completions/flags.rs b/src/completions/flags.rs index f094685..4a3f556 100644 --- a/src/completions/flags.rs +++ b/src/completions/flags.rs @@ -3,34 +3,19 @@ use std::path::Path; use crate::grammar::{QuoteType, find_quote_type}; -/* Values for COMPSPEC options field. */ -// In bash >= 4.4, COPT_NOQUOTE was inserted at (1<<4), shifting later values. -// In bash < 4.4: NOSPACE=(1<<4), BASHDEFAULT=(1<<5), PLUSDIRS=(1<<6) -// In bash >= 4.4: NOQUOTE=(1<<4), NOSPACE=(1<<5), BASHDEFAULT=(1<<6), PLUSDIRS=(1<<7), NOSORT=(1<<8), FULLQUOTE=(1<<9) +/* Values for COMPSPEC options field (pcomplete.h, bash >= 4.4). */ #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum CompspecOption { Reserved = 1 << 0, Default = 1 << 1, Filenames = 1 << 2, Dirnames = 1 << 3, - #[cfg(not(feature = "pre_bash_4_4"))] NoQuote = 1 << 4, - #[cfg(not(feature = "pre_bash_4_4"))] NoSpace = 1 << 5, - #[cfg(not(feature = "pre_bash_4_4"))] BashDefault = 1 << 6, - #[cfg(not(feature = "pre_bash_4_4"))] PlusDirs = 1 << 7, - #[cfg(not(feature = "pre_bash_4_4"))] NoSort = 1 << 8, - #[cfg(not(feature = "pre_bash_4_4"))] FullQuote = 1 << 9, - #[cfg(feature = "pre_bash_4_4")] - NoSpace = 1 << 4, - #[cfg(feature = "pre_bash_4_4")] - BashDefault = 1 << 5, - #[cfg(feature = "pre_bash_4_4")] - PlusDirs = 1 << 6, } #[derive(Debug, Copy, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] @@ -61,19 +46,13 @@ impl CompletionFlags { quote_type, readline_default_fallback_desired: foundcs & (CompspecOption::Default as libc::c_int) != 0, - #[cfg(not(feature = "pre_bash_4_4"))] filename_quoting_desired: foundcs & (CompspecOption::NoQuote as libc::c_int) == 0, - #[cfg(feature = "pre_bash_4_4")] - filename_quoting_desired: true, filename_completion_desired: foundcs & (CompspecOption::Filenames as libc::c_int) != 0, no_suffix_desired: foundcs & (CompspecOption::NoSpace as libc::c_int) != 0, suffix_character: char::from_u32(append_char as u32).unwrap_or(' '), bash_default_fallback_desired: foundcs & (CompspecOption::BashDefault as libc::c_int) != 0, - #[cfg(not(feature = "pre_bash_4_4"))] nosort_desired: foundcs & (CompspecOption::NoSort as libc::c_int) != 0, - #[cfg(feature = "pre_bash_4_4")] - nosort_desired: false, some_dont_end_in_equal_sign, } } diff --git a/src/completions/tab_completion.rs b/src/completions/tab_completion.rs index eaa7344..198d921 100644 --- a/src/completions/tab_completion.rs +++ b/src/completions/tab_completion.rs @@ -2177,7 +2177,7 @@ mod tab_completion_tests { ); let outcome = apply_tab_complete_to_buffer(&mut buffer, &builder, &comp_context.word_under_cursor); - log::info!("Outcome of applying tab complete: {:?}", &outcome); + log::info!("Outcome of applying tab complete: {outcome:?}"); assert!(matches!(outcome, TabCompleteBufferOutcome::Pending { ref final_wuc } if final_wuc.as_ref() == "./fo/barA")); assert_eq!(buffer.buffer(), "mycmd ./fo/barA"); } diff --git a/src/grammar/dparser.rs b/src/grammar/dparser.rs index 9bbea8b..0771d96 100644 --- a/src/grammar/dparser.rs +++ b/src/grammar/dparser.rs @@ -2906,25 +2906,25 @@ mod test_keyword_bracket_color { let tokens = parser.tokens(); // echo - assert_eq!(tokens[0].annotations.is_glob, false); + assert!(!tokens[0].annotations.is_glob); // *.txt - assert_eq!(tokens[2].annotations.is_glob, true); + assert!(tokens[2].annotations.is_glob); // ./foo/ - assert_eq!(tokens[4].annotations.is_glob, false); + assert!(!tokens[4].annotations.is_glob); // { - assert_eq!(tokens[5].annotations.is_glob, true); + assert!(tokens[5].annotations.is_glob); // a,b - assert_eq!(tokens[6].annotations.is_glob, true); + assert!(tokens[6].annotations.is_glob); // } - assert_eq!(tokens[7].annotations.is_glob, true); + assert!(tokens[7].annotations.is_glob); // bar - assert_eq!(tokens[9].annotations.is_glob, false); + assert!(!tokens[9].annotations.is_glob); // [ - assert_eq!(tokens[10].annotations.is_glob, true); + assert!(tokens[10].annotations.is_glob); // 0-9 - assert_eq!(tokens[11].annotations.is_glob, true); + assert!(tokens[11].annotations.is_glob); // ] - assert_eq!(tokens[12].annotations.is_glob, true); + assert!(tokens[12].annotations.is_glob); } #[test] @@ -2934,12 +2934,12 @@ mod test_keyword_bracket_color { let tokens = parser.tokens(); // ls - assert_eq!(tokens[0].annotations.is_glob, false); + assert!(!tokens[0].annotations.is_glob); assert_eq!(tokens[0].annotations.command_word, Some("ls".to_string())); // All tokens inside @(...) should be marked is_glob = true for t in &tokens[2..] { - assert_eq!(t.annotations.is_glob, true); + assert!(t.annotations.is_glob); // '|' inside extglob should not create spurious command_word annotations assert_ne!(t.annotations.command_word, Some("bar".to_string())); assert_ne!(t.annotations.command_word, Some("baz2".to_string())); diff --git a/src/settings.rs b/src/settings.rs index 9542338..e931ec0 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -651,8 +651,10 @@ mod tests { #[test] fn test_settings_diff_detects_changed_history_jsonl_path() { - let mut settings = Settings::default(); - settings.history_jsonl_path = std::path::PathBuf::from("/tmp/test.jsonl"); + let settings = Settings { + history_jsonl_path: std::path::PathBuf::from("/tmp/test.jsonl"), + ..Settings::default() + }; let diff = settings.diff(); let changed: Vec<_> = diff.iter().filter(|e| !e.is_default).collect(); assert_eq!(changed.len(), 1); @@ -702,8 +704,10 @@ mod tests { #[test] fn test_settings_diff_detects_changed_delayed_startup_ms() { - let mut settings = Settings::default(); - settings.delayed_startup_ms = 300; + let settings = Settings { + delayed_startup_ms: 300, + ..Settings::default() + }; let diff = settings.diff(); let changed: Vec<_> = diff.iter().filter(|e| !e.is_default).collect(); assert_eq!(changed.len(), 1); diff --git a/src/shell/bash/funcs.rs b/src/shell/bash/funcs.rs index 42f9ddf..b6bc1a7 100644 --- a/src/shell/bash/funcs.rs +++ b/src/shell/bash/funcs.rs @@ -512,20 +512,14 @@ pub fn evaluate_shell_string(script: &str) -> Result<()> { let allocated_ptr = bash_symbols::locked_xmalloc_cstr(&script_cstr); let from_file_cstr = std::ffi::CString::new("flyline")?; - #[cfg(not(feature = "pre_bash_4_4"))] let flags = bash_symbols::SEVAL_NOHIST | bash_symbols::SEVAL_NOOPTIMIZE | bash_symbols::SEVAL_NOTIFY; - #[cfg(feature = "pre_bash_4_4")] - let flags = bash_symbols::SEVAL_NOHIST | bash_symbols::SEVAL_NOTIFY; // Save parser state (Bash's save_parser_state(NULL) uses xmalloc to allocate exact sizeof(sh_parser_state_t)) let ps_ptr = bash_symbols::save_parser_state(std::ptr::null_mut()); - #[cfg(not(feature = "pre_bash_4_4"))] bash_symbols::evalstring(allocated_ptr, from_file_cstr.as_ptr(), flags); - #[cfg(feature = "pre_bash_4_4")] - bash_symbols::parse_and_execute(allocated_ptr, from_file_cstr.as_ptr(), flags); // Restore parser state so expand_aliases and parser_state are preserved if !ps_ptr.is_null() { @@ -607,15 +601,9 @@ pub fn run_programmable_completions( // similar to set_completion_defaults bash_symbols::rl_filename_completion_desired = 0; bash_symbols::rl_filename_quoting_desired = 1; - #[cfg(not(feature = "pre_bash_4_4"))] - { - bash_symbols::rl_completion_suppress_append = 0; - } + bash_symbols::rl_completion_suppress_append = 0; bash_symbols::rl_completion_append_character = ' ' as c_int; - #[cfg(not(feature = "pre_bash_4_4"))] - { - bash_symbols::rl_sort_completion_matches = 1; - } + bash_symbols::rl_sort_completion_matches = 1; let foundcs: std::ffi::c_int = 0; @@ -635,7 +623,6 @@ pub fn run_programmable_completions( // Copying logic from bashline.c:attempt_shell_completion // This is to pickup the filename desire from calls like `complete -o filenames` // This probably isn't necessary since I am reading the values from foundcs directly but it doesn't hurt to be safe - #[cfg(not(feature = "pre_bash_4_4"))] bash_symbols::pcomp_set_readline_variables(foundcs, 1); } @@ -665,14 +652,11 @@ pub fn print_copt_flags(flag: c_int) { CompspecOption::Default, CompspecOption::Filenames, CompspecOption::Dirnames, - #[cfg(not(feature = "pre_bash_4_4"))] CompspecOption::NoQuote, CompspecOption::NoSpace, CompspecOption::BashDefault, CompspecOption::PlusDirs, - #[cfg(not(feature = "pre_bash_4_4"))] CompspecOption::NoSort, - #[cfg(not(feature = "pre_bash_4_4"))] CompspecOption::FullQuote, ]; for option in options { @@ -1106,28 +1090,10 @@ pub fn unset_env_var(name: &str) -> Result<()> { } pub fn is_autocd_enabled() -> bool { - #[cfg(feature = "pre_bash_4_4")] - { - false - } - #[cfg(not(feature = "pre_bash_4_4"))] - { - let _guard = super::symbols::BASH_LOCK.lock(); - unsafe { bash_symbols::autocd != 0 } - } -} - -#[cfg(feature = "pre_bash_4_4")] -pub fn has_pending_traps() -> bool { let _guard = super::symbols::BASH_LOCK.lock(); - unsafe { - let ptr = std::ptr::addr_of!(bash_symbols::pending_traps) as *const libc::c_int; - let slice = std::slice::from_raw_parts(ptr, 64); - slice.iter().any(|&count| count > 0) - } + unsafe { bash_symbols::autocd != 0 } } -#[cfg(not(feature = "pre_bash_4_4"))] pub fn has_pending_traps() -> bool { let _guard = super::symbols::BASH_LOCK.lock(); unsafe { bash_symbols::first_pending_trap() > 0 } diff --git a/src/shell/bash/mod.rs b/src/shell/bash/mod.rs index 9f57e63..4dfaa57 100644 --- a/src/shell/bash/mod.rs +++ b/src/shell/bash/mod.rs @@ -59,11 +59,8 @@ impl ShellBackend for BashBackend { let _guard = symbols::BASH_LOCK.lock(); let decoded = unsafe { - #[cfg(not(feature = "pre_bash_4_4"))] let decoded_prompt_cstr = symbols::decode_prompt_string(c_prompt.as_ptr(), _is_prompt as i32); - #[cfg(feature = "pre_bash_4_4")] - let decoded_prompt_cstr = symbols::decode_prompt_string(c_prompt.as_ptr()); if decoded_prompt_cstr.is_null() { log::warn!("decode_prompt_string returned null"); return None; diff --git a/src/shell/bash/symbols.rs b/src/shell/bash/symbols.rs index 079eb95..c635e4c 100644 --- a/src/shell/bash/symbols.rs +++ b/src/shell/bash/symbols.rs @@ -173,7 +173,6 @@ unsafe extern "C" { // from shell.h pub static interactive: c_int; pub static interactive_shell: c_int; - #[cfg(not(feature = "pre_bash_4_4"))] pub static autocd: c_int; pub fn save_parser_state(ps: *mut libc::c_void) -> *mut libc::c_void; pub fn restore_parser_state(ps: *mut libc::c_void); @@ -292,7 +291,6 @@ unsafe extern "C" { possible closing quote. This is set to 0 by rl_complete_internal and may be changed by an application-specific completion function. */ // int rl_completion_suppress_append = 0; - #[cfg(not(feature = "pre_bash_4_4"))] #[link_name = "rl_completion_suppress_append"] pub static mut rl_completion_suppress_append: c_int; @@ -304,7 +302,6 @@ unsafe extern "C" { /* If non-zero, sort the completion matches. On by default. */ // int rl_sort_completion_matches = 1; - #[cfg(not(feature = "pre_bash_4_4"))] #[link_name = "rl_sort_completion_matches"] pub static mut rl_sort_completion_matches: c_int; @@ -319,7 +316,6 @@ unsafe extern "C" { Option *mut c_char>; // void pcomp_set_readline_variables (int flags, int nval) - #[cfg(not(feature = "pre_bash_4_4"))] pub fn pcomp_set_readline_variables(flags: c_int, nval: c_int); // alias.h @@ -385,21 +381,11 @@ unsafe extern "C" { // common.h // int evalstring (char *string, const char *from_file, int flags) - #[cfg(not(feature = "pre_bash_4_4"))] pub fn evalstring(string: *mut c_char, from_file: *const c_char, flags: c_int) -> c_int; - // common.h (pre-4.4 fallback: evalstring did not exist as a separate symbol) - // int parse_and_execute (char *string, const char *from_file, int flags) - #[cfg(feature = "pre_bash_4_4")] - pub fn parse_and_execute(string: *mut c_char, from_file: *const c_char, flags: c_int) -> c_int; - // y.tab.c - // In bash >= 4.4: char * decode_prompt_string (char *string, int is_prompt) - // In bash < 4.4: char * decode_prompt_string (char *string) - #[cfg(not(feature = "pre_bash_4_4"))] + // char * decode_prompt_string (char *string, int is_prompt) pub fn decode_prompt_string(string: *const c_char, is_prompt: c_int) -> *mut c_char; - #[cfg(feature = "pre_bash_4_4")] - pub fn decode_prompt_string(string: *const c_char) -> *mut c_char; // char *expand_string_to_string (string, quoted) pub fn expand_string_to_string(string: *const c_char, quoted: c_int) -> *mut c_char; @@ -419,17 +405,12 @@ unsafe extern "C" { pub fn termsig_handler(sig: c_int); // int first_pending_trap (void) - #[cfg(not(feature = "pre_bash_4_4"))] pub fn first_pending_trap() -> c_int; - #[cfg(feature = "pre_bash_4_4")] - pub static mut pending_traps: [c_int; 64]; - // void run_pending_traps (void) pub fn run_pending_traps(); // rl_hook_func_t *rl_signal_event_hook = (rl_hook_func_t *)NULL; - #[cfg(not(feature = "pre_bash_4_4"))] pub static mut rl_signal_event_hook: Option; /* If this is non-zero, do job control. */ @@ -574,7 +555,6 @@ pub struct CompSpec { pub suffix: *mut c_char, pub funcname: *mut c_char, pub command: *mut c_char, - #[cfg(not(feature = "pre_bash_4_4"))] pub lcommand: *mut c_char, pub filterpat: *mut c_char, } diff --git a/src/subshell_ipc.rs b/src/subshell_ipc.rs index 4a1ecc6..903ff02 100644 --- a/src/subshell_ipc.rs +++ b/src/subshell_ipc.rs @@ -92,7 +92,7 @@ const MAX_PAYLOAD_SIZE: usize = 1024 * 1024 * 1024; // 1 GB limit fn read_exact_fd(fd: RawFd, mut buf: &mut [u8]) -> std::io::Result<()> { while !buf.is_empty() { - match nix::unistd::read(fd, buf) { + match nix::unistd::read(unsafe { BorrowedFd::borrow_raw(fd) }, buf) { Ok(0) => { return Err(std::io::Error::new( std::io::ErrorKind::UnexpectedEof, diff --git a/tests/docker_integration_tests.rs b/tests/docker_integration_tests.rs index 26fd336..5082d39 100644 --- a/tests/docker_integration_tests.rs +++ b/tests/docker_integration_tests.rs @@ -26,12 +26,6 @@ macro_rules! bash_integration_test { }; } -// This one fails because of the lack of builtin_help in Bash 4.3 -// #[test] -// bash_integration_test!(test_bash_4_3_30, "4.3.30"); - -bash_integration_test!(test_bash_3_2_57, "3.2.57"); -bash_integration_test!(test_bash_4_4_rc1, "4.4-rc1"); -bash_integration_test!(test_bash_4_4_18, "4.4.18"); -bash_integration_test!(test_bash_5_0, "5.0"); +bash_integration_test!(test_bash_5_1, "5.1"); +bash_integration_test!(test_bash_5_2, "5.2"); bash_integration_test!(test_bash_5_3, "5.3"); diff --git a/vendor/README.md b/vendor/README.md new file mode 100644 index 0000000..d0974af --- /dev/null +++ b/vendor/README.md @@ -0,0 +1,49 @@ +# Vendored forks + +flyline needs changes to these crates that upstream does not have. They used to +be git dependencies on HalFrgrd's forks; they live here so this repository can +update them itself. + +| Directory | Upstream | Base commit | flyline's changes | +|---|---|---|---| +| `ratatui/` | [ratatui/ratatui](https://github.com/ratatui/ratatui) `main` | `e665c36cb1` (241 commits behind; see below) | Inline viewport: resizable, no cursor-position query, absolute positions for mouse events, synchronized output, autowrap off, erase-instead-of-space for reflow, wide-character cursor tracking, no redraw sequences when nothing changed (HalFrgrd/ratatui `inline_viewport_improvments`, 30 commits) | +| `termina/` | [helix-editor/termina](https://github.com/helix-editor/termina) `master` | `7be7389f` (v0.4.0) | SGR mouse reports, text pixel size and OSC 52 responses, a long-lived event reader that keeps unread stdin, Ghostty DA2 deadlock fix, raw device attributes, kitty base-layout key (HalFrgrd/termina, 13 commits; two are upstream PRs #31 and #32) | +| `skim/` | [skim-rs/skim](https://github.com/skim-rs/skim) `master` | `2160abbd` (5.9.0) | A `tui` feature, so `default-features = false, features = ["algos_only"]` builds only the matchers, without the TUI and runtime stack (HalFrgrd/skim, 1 commit) | + +Each directory is a `git subtree --squash`. It holds upstream's tree at the +base commit plus one commit with flyline's changes. Because the squash records +upstream's commit and not the fork's, a later `git subtree pull` from upstream +merges upstream's changes into flyline's instead of reverting them. + +The root `Cargo.toml` uses these as path dependencies and `[patch.crates-io]`s +`ratatui-core` and `termina`, so crates.io dependents link the same copies. The +workspace `exclude`s `vendor/`. The crates keep their own workspaces, lints and +`rustfmt.toml`, so use `cargo fmt` (not `cargo fmt --all`) and +`cargo clippy --workspace` for flyline's own code. + +## Update from upstream + +```bash +git subtree pull --prefix vendor/termina https://github.com/helix-editor/termina.git master --squash +git subtree pull --prefix vendor/skim https://github.com/skim-rs/skim.git master --squash +git subtree pull --prefix vendor/ratatui https://github.com/ratatui/ratatui.git main --squash +``` + +1. Resolve conflicts in favour of keeping flyline's behaviour. +2. Run `cargo update -w`, then the checks in AGENTS.md and the Docker bash integration tests. +3. Update the base commit in the table above. + +## ratatui is behind upstream + +Upstream has since rewritten the same inline-viewport code: `set_viewport_height` +(#1964), horizontal-shrink fixes (#2670, #2731), cursor fixes (#2694, #2752, +#2807), and scrolling regions split into their own trait (#2121, breaking). A +`git subtree pull` conflicts in 19 files (43 hunks), mostly in +`ratatui-core/src/terminal/`. Merge it on its own branch, adopting upstream's +inline resizing where it covers flyline's needs. Then test resizing, wide +characters, mouse positions and the bash integration suite before it ships. + +## Change a fork + +Edit the files here and commit with a `vendor():` prefix. Changes worth +upstreaming should also be sent as PRs to the upstream repository. diff --git a/vendor/ratatui/.cargo/config.toml b/vendor/ratatui/.cargo/config.toml new file mode 100644 index 0000000..35049cb --- /dev/null +++ b/vendor/ratatui/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +xtask = "run --package xtask --" diff --git a/vendor/ratatui/.cliffignore b/vendor/ratatui/.cliffignore new file mode 100644 index 0000000..fce09ff --- /dev/null +++ b/vendor/ratatui/.cliffignore @@ -0,0 +1,115 @@ +# skip entries from +50af9a5d80ed5446f3e6cc554911f606580edde9 +272e9709c6eed45cd7e0c183624b7898f4e0ae69 +adc8fdc35aa57d6dad2ae8dd30ec2e9256576c09 +31711dbf82a4c7bb3b78692da34d9f469725dd6e +b6356aa7a529a491d63dd6628b8985adae337f16 +885558b6f89df642317d39c5b44c94c742d1e0c8 +6440eb9d76379340953420629ab0a3d9039d6c48 +3870583ea868452191857f9bda97a3d5c35d0a4f +487edc8399683fb8a9a66359729c015780d248f2 +250c222cc4aaab09184a28efc68f75ca03133794 +590a392ab11c1a215767614931036781f4cf6a29 +6443f7408af4a8834bc68cd35d2ba9be47e45f38 +8339cce10a51c9c951b3c9750d527d80168626eb +ac342231c344e893f2f630ee38167aab28c736a6 +0fb103680028a6e26a1923f87b60bde51acaec4f +4335a90a00aeeedb69a92442c7f2711727944017 +71480242a926f98e9081ed6e2dc8c381757b3a42 +e1a31db55913bd690bcaef380e9dbc3b6a5dc175 +38490ff8da6f11e309ba1bcb3e88a562f7c953c5 +a4bb143e4767137d6a9e9927d3da66562611f86f +bc73f2dcbe5ea48fc4d1555a8e931f40d7b0e03f +77dea441e5637b1c428c2aa71ea67fb3aac20c12 +06af14107e70e49a4cba3babb8ab0a0c57b4bdf8 +9acdab32df69517b93dd2b861b85586d47c71540 +2e684c6500be61fbe69744d183c8086564ac0051 +b7f8ec0ff9659473d936eae53a57cd9de38cec1f +31a2c4548c304270a8c852f19baa7a4eaac5e75c +57b681b053c019b66e0ed92959638997fea731b1 +131b9ec41751163d43d94564363247b60f031486 +8b32f82b4dd526580d00fa13f053bf507e8ea933 +76d1e5b1733d47a7f05acf563db26cb1a66b540d +57a0a34f924e0d488c9e9f917900e677c3488dc4 +12aa58601ddd0704256c56019bd2c7139d41f7a2 +2dc81833c60951d16f9bd60f3da003edfc9a11f5 +20e41f1d1da6db8abbc2504814531d4d97bdf94b +68b55a12a29e70ebfcc063c2d5d5845de3b5a27e +693003314a25e792ffc5d53146b28bfb6a4582e3 +63441e259bc38b56e0369197bed14788b2cb3d54 +fa88152c808eeb6c9d9b3662361aab1e57e1b1bf +30d9daa59b1843786cde00e25c3e69cfe818b80b +92540b2f6ab25f3a5400aebb28af3c498ac793a4 +29edc3a7a38c512611a80cf5d8d42027558419b2 +819499d6ffc0e8453ed3220067645933a4882a74 +4756526829a4e849d9e256b6cf821eb66afe3ade +8f35437d5ad78d31cd45c4af888f20f0b5ab4196 +39bd72b1f702dadb1ebbaf4e77ad2fada166ac49 +c6d2cee3e967c9234176c5229858512b0c79d6a9 +bd90e3d928e0f9f0b915933ebbc32c2256fe8cfa +b820c0c7e4c576c1e39b5e482a8aac08076a039c +74194759756bb111b4da3e9a5cdb968275a2fab0 +38b2f27efe0e1829bc503df7fd64b94b7bb80d97 +21aa3232d762d6e3f81f15fc5b66ba462385ac05 +903bb0ae32d22393783edfda96db900739864f0a +5cee13ab6d9c49751cf9283d9099e37f0cc3632c +0a0997702dd4cf2217160f5652f5c39cbd4a1010 +778f2f5ec511bef431b54157242b91d083ea9840 +7d23bd2ceaf96e81972b5f746fdcba0d17f6391f +2c02a56bce31519386303571e0b66b7d4beb378e +f33d51e7d9ccf9fe52ec3289d04d97c722d9ee17 +91cd81aaa032887bb2327bc3fe3cad6b3c9fbacf +5d5a1ccb0b4e2f293f215ce026fba33f1c069689 +6b9417db5f2adbdc60e9dd8dc5acbbe2a1f77ba9 +dce1e4b138eb1333c9e773bacd579a8cdddd73fb +b4aacb045e2200896b0d0136a2b8688b47828d73 +dcba0bcd5d5d6e33ddc1fa94ebb94819fdda600e +6f52350ecfb62e3a5bac16f0824e74b757cc6cd2 +2c6f324b9aa5034771e00758b143fd8df94d859d +bf0210602948f8d26ae323996fe7b22fb218a446 +07aff91b015b5e7e0504680c12edbce70d7dba1e +f6d49dde14af73ed467d75d8f6ec0f502db2908f +9a7467b30576d5cb7491ea6e09efcae97eadf9bb +a0c35f1d7bcce10e092582b95f5b0a3f20ad7bf3 +d24747d46982192b575a40b8cc18d1c948fac3d7 +8060f7bc578b29dde6ca0c4c64569f9c73218f46 +0dc5b2d2e0aa6438ffc1b3965b1ab31c721adbcc +8ecdd892f53d7db95bbb53a61700d36e3fcefdd4 +570c35868147a2400a13331e85d562d1ef96a011 +3855c3a84a77037aeee40dbe9e52454fb1f9afee +93372f35c1669da0138ca776890f3ff3d38a6539 +6cf08d4a2f0398856fd593f50bf077fd59b08230 +f78d3bfec32d07c1124eee8d0249477ce3fb0884 +204307fa50aaaa373946342084f7fd3af39f3cd3 +c50b01d098e5ab405a50c3e14e858da27d606e8f +f71d1ac73e8290f37d55a67d6a6507a3653ec174 +ae2868c0e0b1ac8b5126fd43269383fa533d87b5 +be8def963956c605bca28bcd8df673bd7ec3740b +4ac4d9d3ab97176d71e287bcdd6d41e66f2f7ccb +fafabb8dab84e9460a076199ea646262e51c855b +2f97d35bd8618e8c0cc006cb1d4a9b151c1b9b4a +39d5a745acbbd3510de707d4e7c471c17e02ae59 +a1acdcdc4c002390a76f01699cfa006a36cf3f56 +ad54cf29ad1a4335ba208fb94a8fc5dfbba260e3 +c7649575e7b199794be4252f79da80aaecdcee28 +8913e2ce1f40d451ddb4527f08ec75f198d5063c +1b9e310300f22bfc72364f027a9caeddadf61a99 +89d7dd46031511f0556b2d29ab34035f42e3a24c +ca4fa0b9bf5ba707aa0447ba7c38fbacdadb7eec +8cecfdf2f6dd5b0de507f79b469517cc0fb42add +7eeb6afb3dbc56e52f9387a74f826b186cd19137 +d0f75eb371a96f8d5f174e23de074efd840e9e44 +f8a70ea9da8e6df2bf7a5f74cce45615fc292afe +f28b9730061bffadb9d87ad63edf7d10b245d2c1 +afc5cf2140f22fea6bd6933dd0f9c302229a1980 +b75df78cdca58d5dca0c51fb8e106067aa6cb752 +28f5a6dbd4091aa3efa86eed6767eeb44a655f0f +345e6a1ebd853858463a33953585ce407a60378c +c45a4de47c601554f6b981d211181468b4798e41 +bbaa9a5432ff6ad5518344123c3b56f349347e99 +f804c90f96221f334371ccd01b0e6df7b1cfc1e8 +16ba867c5877d8c97968987ecb5f8bff966d0a82 +38a1474ca12aa6a796afc1e277882d997a999e14 +92c4078413fc79fcc83f5d3d8708abb58696ff1a +d4415204e1eb3aed2a74a722aeaaa274975dd2d7 +e48bcf5f21f14acb27996fdc02231c140f5b817c diff --git a/vendor/ratatui/.cz.toml b/vendor/ratatui/.cz.toml new file mode 100644 index 0000000..6fa19cd --- /dev/null +++ b/vendor/ratatui/.cz.toml @@ -0,0 +1,78 @@ +# configuration for https://github.com/commitizen/cz-cli + +[tool.commitizen] +name = "cz_customize" +tag_format = "$version" +version_type = "semver" +version_provider = "cargo" +update_changelog_on_bump = true +major_version_zero = true +use_shortcuts = true + +[tool.commitizen.customize] +message_template = """{{change_type}}({{scope}}): {{subject}} + +{% if body %}\ +{{body}}\ +{% endif %} + +{%if is_breaking_change %}\ +BREAKING_CHANGE: \ +{% endif %}\ +{{footer}}\ +""" +example = "feature: this feature enable customize through config file" +schema = "(): \n\n\n\n