Commit graph

57 commits

Author SHA1 Message Date
ridiculousfish
20e9c9493c Rewrite float parsing to use Rust native parsing
Eliminates the fast-float dependency.
2024-06-09 15:52:13 -07:00
ridiculousfish
838ff86ae7 Rename printf crate to fish-printf
Preparing to publish to crates.io
2024-06-09 12:29:09 -07:00
Fabian Boehm
d317e3638c Update the other dependencies 2024-06-06 16:47:52 +02:00
Fabian Boehm
ad73dcc308 Update nix to 0.29 2024-06-06 16:47:52 +02:00
ridiculousfish
f16a1361c5 Adopt the new printf crate
This drops our usage of printf-compat.
2024-05-26 16:07:27 -04:00
ridiculousfish
7002571cf8 Add printf crate to workspace
This adds a crate containing a new implementation of printf, ported from musl.

This has some advantages:

- locale support is direct instead of being "applied after".
- No dependencies on libc printf. No unsafe code at all.
- No more WideWrite - just uses std::fmt::Write.
- Rounding is handled directly in all cases, instead of relying on Rust and/or
  libc.
- No essential dependency on WString.
- Supports %n.
- Implementation is more likely to be correct since it's based on a widely used
  printf, instead of a low-traffic Rust crate.
- Significantly faster.
2024-05-26 16:07:27 -04:00
ridiculousfish
08f8983085 Adopt the new hex float parsing
This eliminates hexponent.
2024-05-25 18:39:45 -07:00
ridiculousfish
caef202551 Fix some more clippies and enable more warnings 2024-05-15 20:05:35 -07:00
Mahmoud Al-Qudsi
e7f13ac329 Upgrade to rsconf 0.2.2
This version does not emit a warning for rustc-check-cfg for rustc <
1.80 and supports cfg names that include an underscore.
2024-05-13 16:36:27 -05:00
Mahmoud Al-Qudsi
2faf1159fa Upgrade to rsconf 0.2.0 2024-05-09 14:20:57 -05:00
Mahmoud Al-Qudsi
35a16e3713 Rename FISH_TSAN_WORKAROUNDS and add feature to Cargo.toml
rustc 1.80 now complains about features not declared in Cargo.toml and cfg
keys/values not declared by build.rs to protect against typos or misuse (you
think you're using the right condition but you're not). See
rust-lang/cargo#10554 and rust-lang/rust#82450.

(We're not actually using TSAN under CI at this time, but I do want to re-enable
it at some point — especially if we get multithreaded execution going — using
the rust-native TSAN configuration.)

I'll be updating the `rsconf` crate and patching `build.rs` accordingly to also
handle the warnings about unknown cfg values, but tsan is a feature and not a
cfg and these can be dealt with in `Cargo.toml` directly.
2024-05-09 13:58:42 -05:00
Fabian Boehm
01bbdb02ae Upgrade terminfo to 0.9.0
Should also fix the macos CI failures
2024-05-08 15:46:41 +02:00
Fabian Boehm
022a7c2e24 Cargo: Update libc to last MSRV-compatible version
After that it's rust 1.71
2024-05-07 17:55:29 +02:00
Fabian Boehm
16fcc5de7c Increase MSRV to 1.70
It appears we can't find a system that ships rustc >= 1.67 and < 1.70,
so keeping it at 1.67 gains nothing.

1.70 is used in Debian 13, so that will be able to build fish out of
the box (12 was on 1.63 which was already too low).
2024-04-29 22:00:59 +02:00
Mahmoud Al-Qudsi
85b3dbbec0 Bump cc-rs to 1.0.94 to work around spurious warnings
Under Ubuntu 23.10 (gcc 13), older cc crate versions would complain that the
compiler could not be identified.

See https://github.com/rust-lang/cc-rs/issues/958
2024-04-16 21:33:59 -05:00
Johannes Altmanninger
4149a37f1c Pull rust-terminfo-fix for rio terminal
https://github.com/meh/rust-terminfo/pull/42
2024-04-02 08:01:48 +02:00
David Adam
698d8bd315 add comment regarding lru hashing algorithm 2024-04-01 22:33:22 +08:00
David Adam
792eff42b7 discard serial_test features
The default features are async and log, which are not utilised, and add
a significant number of dependencies to the tree.
2024-03-31 00:47:38 +08:00
Pi-Cla
0cbac81130 Bump serial_test dependency to 1.0.0
The current version of serial_test we use (0.4.0)
depends on parking_lot 0.10.2 which in turn
depends on lock_api 0.3.4.
This version of lock_api is vulnerable to [RUSTSEC-2020-0070](https://rustsec.org/advisories/RUSTSEC-2020-0070)
This was patched in lock_api 0.4.2 but we need to update serial_test
to get the update.
2024-03-23 11:01:35 +01:00
The0x539
cfe9881eaa Suppress unknown_lints lint
This is to prevent stable from complaining about nightly-only lints.

Closes #10354
2024-03-09 13:49:25 +01:00
The0x539
6c0381c335 Suppress assigning_clones and incompatible_msrv
The incompatible_msrv one is a false positive because we have polyfills for
is_some_and() and is_ok_or() which are Rust 1.74. I'm not yet sure how to
communicate that to Clippy.
2024-03-09 13:49:25 +01:00
Fabian Boehm
2a4e776d92 Reimplement git version generation ourselves
This allows us to remove two dependency crates
2024-03-02 10:05:37 +01:00
Fabian Boehm
f87c892ed8 Update cc dependency
Removes annoying "running cc --version" and such debug messages.
2024-02-26 16:17:47 +01:00
Fabian Boehm
fc794bab4c Switch to the terminfo crate
This allows us to get the terminfo information without linking against curses.

That means we can get by without a bunch of awkward C-API trickery.

There is no global "cur_term" kept by a library for us that we need to invalidate.

Note that it still requires a "unhashed terminfo database", and I don't know how well it handles termcap.

I am not actually sure if there are systems that *can't* have terminfo, everything I looked at
has the ncurses terminfo available to install at least.
2024-02-22 20:10:16 +01:00
Johannes Altmanninger
d9381d1ab6 Use default number of codegen units in release build
The default codegen units is 16 but we set it to 1*.  On my system, this
saves 0.1 MB (2%) in the unstripped binary, while adding 10s (20%) to the
build time.  This doesn't seem worth, better stick to the defaults.

[*] along enabling fat LTO which is debatable too
2024-02-03 08:02:59 +01:00
Fabian Boehm
a9a70e0149 Clippy: Allow "manual_range_contains"
This complains that `scale < 0 || scale > 15` should be

`!(0..=15).contains(&scale)`

and I'm sorry, but no. Just no.
2024-02-01 19:52:32 +01:00
PolyMeilex
23301e4895 Return Result from wopen_cloexec 2024-01-27 20:42:13 +01:00
ridiculousfish
42bb4b55d3 Add default-run = fish to Cargo.toml
This makes fish the default binary, so that "cargo run" will launch fish.
2024-01-23 19:49:35 -08:00
Fabian Boehm
db361644c4 Remove unused num-derive dependency 2024-01-22 17:21:40 +01:00
王宇逸
2f373d839c Enable LTO 2024-01-21 13:31:13 +01:00
Mahmoud Al-Qudsi
21b4a2e5d6 Simplify rsconf has_symbol() libc lookups 2024-01-18 18:22:07 -06:00
Mahmoud Al-Qudsi
6e002b6d80 Use cfg directly instead of going through features
Features should be for user-specifiable build configurations but our dynamic,
target-based conditional compilation is something else.
2024-01-13 15:16:47 -06:00
Fabian Boehm
507d634cfa Remove widestring-suffix from Cargo 2024-01-13 08:52:54 +01:00
Johannes Altmanninger
3ae20bdba0 Move fish-rust to project root 2024-01-13 03:58:33 +01:00
Johannes Altmanninger
a707cd09c4 Enable clippy::unnecessary_unwrap lint 2024-01-13 03:58:33 +01:00
Johannes Altmanninger
fd7f76c180 Enable clippy::unnecessary_to_owned lint
Meh
2024-01-13 03:58:33 +01:00
Johannes Altmanninger
65064ac976 Remove dead code, enable dead_code lint 2024-01-13 03:58:33 +01:00
Johannes Altmanninger
5512f44899 Enable doctests
They are probably not terribly useful for us but let's see what happens.

Unfortunately cargo does not properly forward the combination of "RUSTFLAGS"
and "--target" that is currently required to build with ASan [1].  Hence doctests
will fail to link on ASan builds. Let's disable doctests when ASan is active.

[1]: https://github.com/rust-lang/cargo/issues/10666 et al
2024-01-13 03:58:33 +01:00
Johannes Altmanninger
4bae1f3de9 Address clippy lints on stable Rust 2024-01-13 03:07:29 +01:00
Johannes Altmanninger
6896898769 Add [lints] table to suppress lints across all our crates
This was stabilized in 1.74.  Until that's our MSRV, keep the warnings also in
"lib.rs", to prevent warning spew on old builds (CI logs etc.).
2024-01-13 03:07:29 +01:00
David Adam
1683e720a8 Use Rust for executables
Use Rust for executables

Drops the C++ entry points and restructures the Rust package into a
library and three binary crates.

Renames the fish-rust package to fish.

At least on Ubuntu, "fish_indent" is built before "fish".
Make sure export CURSES_LIBRARY_LIST to all binaries to make sure
that "cached-curses-libnames" is populated.

Closes #10198
2024-01-13 03:07:29 +01:00
David Adam
4a2edbf97e Disable doc tests temporarily
None of the existing code blocks compile, so disable them running as tests
for now.
2024-01-13 03:07:29 +01:00
Mahmoud Al-Qudsi
fdbda18418 Use updated crates.io release for dev dependencies
The versions on crates.io now have the patches we need upstreamed.
2024-01-11 16:58:32 -06:00
Johannes Altmanninger
29bd6eebd0 Remove cxx and autocxx
Notably this gets rid of the Cargo target directory inside build directories,
in favor of "target/" at workspace root.
2024-01-07 22:19:56 +01:00
Johannes Altmanninger
17bdf28b7a Remove unused moveit dependancy 2024-01-07 16:09:51 +01:00
Johannes Altmanninger
47c503bbf3 Make rand_pcg a test-only dependency 2024-01-07 16:09:51 +01:00
Fabian Boehm
1e7e6e6379 Remove unixstring dependency
I don't believe this was ever used
2024-01-07 13:21:33 +01:00
Johannes Altmanninger
77550a2f0d Turn FFI tests into native Rust tests
Keep running tests serially to avoid breaking assumptions.

I think many of these tests can run in parallel and/or don't need test_init().
Use the safe variant everywhere, to get it done faster.
2024-01-07 12:12:09 +01:00
Johannes Altmanninger
38d52b7835 Port perf_convert_ascii
The "#[bench]" attribute is not allowed in stable Rust, so keep it behind
a new feature flag. Run on nightly Rust with

    $ cargo bench --features=bechmark
    test tests::encoding::bench::bench_convert_ascii ... bench:     125,988 ns/iter (+/- 1,128) = 1040 MB/s
2023-12-10 14:35:43 +01:00
Thomas Queiroz
a64324421f Port builtin ulimit
Closes #10121
2023-12-03 11:39:15 +01:00