Commit Graph

48 Commits

Author SHA1 Message Date
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
ridiculousfish
a950a8270d Create an inotify based universal notifier for Linux
Recall that universal notifiers are used to report changes to universal
variables to other shell instances. This adds a new strategy based on using
inotify to directly monitor the universal variables
file.

We have tried this in the past and abandoned it because it doesn't properly
work on some CI systems - let's try again.
2023-11-26 17:29:48 -08:00
Johannes Altmanninger
3020c90856 Upgrade bitflags
This allows us to use some newer functionality (I forgot which one I ended
up using).
2023-10-07 19:30:46 +02:00
Henrik Hørlück Berg
e7f8fb04cc Add BUILD_VERSION to lib.rs
In CMake this used a `version` file in the CARGO_MANIFEST_DIR, but
relying on that is problematic due to change-detection, as if we add
`cargo-rerun-if-changed:version`, cargo would rerun every time if the file does
not exist, since cargo would expect the file to be generated by the
build-script. We could generate it, but that relies on the output of `git
describe`, whose dependencies we can only limit to anything in the
`.git`-folder, again causing unnecessary build-script runs.

Instead, this reads the `FISH_BUILD_VERSION`-env-variable at compile time
instead of the `version`-file, and falls back to calling git-describe through
the `git_version`-proc-macro. We thus do not need to deal with extraneous
build-script running.
2023-09-05 11:38:59 +02:00
Henrik Hørlück Berg
5db08e1126 Make CARGO_MANIFEST_DIR for fish-rust equal to src 2023-09-05 11:38:59 +02:00
Henrik Hørlück Berg
bc29b4aee1 Move edition and MSRV to workspace 2023-08-19 15:18:38 +02:00
Henrik Hørlück Berg
cf5b9d1c7e Specify default-members as fish-rust
We generally only want to operate on the fish crate itself (for now), so this
makes the most sense.
2023-08-19 15:18:38 +02:00
Henrik Hørlück Berg
87df7b9adf Use a cargo workspace
- This allows running `cargo fmt/clippy/test/etc` from root
- Ideally the root should be the fish-rust package instead of being virtual, but
  that requires changed to CMake/Corrosion. This change should instead be
  completely compatible with our existing setup.
- This also means we will only have on `Cargo.lock` for all current and future
  crates.
2023-08-19 15:18:38 +02:00