Commit Graph

106 Commits

Author SHA1 Message Date
Fabian Boehm
8736d9b1e7 CI: Add cargo-deny
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Rust checks / cargo-deny (push) Waiting to run
2024-11-29 18:17:11 +01:00
Fabian Boehm
9f92d1f204 CI: Remove test deps from the clippy check 2024-10-14 21:02:26 +02:00
Johannes Altmanninger
b4f86bf0f5 Fix installation of pexpect on latest GitHub Actions images
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
We already use --break-system-packages for macOS but it's not necessary here.
2024-10-14 11:26:08 +02:00
Peter Ammon
fbf0ad98af
Build macOS x86-64 with Rust 1.73.0 in make_pkg.sh
Some checks failed
make test / macos (push) Waiting to run
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Lock threads / lock (push) Has been cancelled
This retains compatibility with macOS 10.9.
Note that Apple Silicon Macs shipped with 10.15, so compatibility for Apple
Silicon is not a concern.
2024-10-13 14:36:02 -07:00
Peter Ammon
925382dc3e
Make make_pkg.sh create fat binaries again on macOS 2024-07-07 14:53:17 -07:00
Peter Ammon
96c5139254
Build, codesign, and notarize macOS packages in CI
This adds a new workflow and script to build macOS packages in GitHub CI.
It also adds some documentation for the process.
2024-07-05 17:29:28 -07:00
Peter Ammon
e67ffc1a3b
Revert accidentally pushed commits
This reverts commit 81de0ee97b.
This reverts commit b4450f0ee5.
This reverts commit d5a128d342.
This reverts commit 580028816c.
2024-07-04 19:01:11 -07:00
Peter Ammon
81de0ee97b
try 1.79 2024-07-04 18:52:21 -07:00
Peter Ammon
b4450f0ee5
more 2024-07-04 18:08:22 -07:00
Peter Ammon
d5a128d342
more 2024-07-04 17:21:54 -07:00
Mahmoud Al-Qudsi
8f563846e8
Compile in release mode for at least one CI runner (#10591)
When we changed our default from RelWithDebInfo to Debug, we inadvertently ended
up with all CI building and running in Debug mode. Change at least one of them
back to Release to make sure we don't have any optimizations that cause funky
stuff.

I'm changing the Ubuntu CI image because it's hopefully the fastest (since rust
is relatively dog-slow to compile in release mode).
2024-06-27 21:46:18 -05:00
David Adam
2d3bb36b8c GitHub Actions: drop CXXFLAGS as no C++ remains 2024-06-24 18:57:23 +08:00
Mahmoud Al-Qudsi
59daa5abce
Run 32-bit CI tests as i586 (#10578) 2024-06-21 12:45:54 -05:00
Mahmoud Al-Qudsi
d654880bcf
Automatically label and milestone completions (#10517)
This automatically assigns the 'completions' label and the 'fish next-3.x'
milestone to completions-only PRs.

A completions-only PR is defined as being one that touches
share/completions/*.fish but does not touch any files outside of share/
2024-05-23 13:34:20 -05:00
Mahmoud Al-Qudsi
ebbba10608 Try a workaround for macOS CI failures
CARGO_NET_GIT_FETCH_WITH_CLI uses the `git` executable instead of the rust
git2 crate/lib, which speeds things up and is known to resolve some issues
fetching the registry or individual crates.

This is to work around a specific issue with git-resident Cargo.toml
dependencies (e.g. terminfo) that keep randomly failing to download under macOS
CI.
2024-05-07 11:25:02 -05: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
Fabian Boehm
7ea17bf621 CI: Allow pip3 to install packages system-wide again
Longer term we could switch to a venv
2024-04-23 19:42:54 +02:00
Johannes Altmanninger
473191b708 Revert "Run asan and macOS CI in release mode too"
This reverts commit 8ada027f05.

See 8ada027f05 (commitcomment-140718706)
2024-04-08 09:16:22 +02:00
Johannes Altmanninger
8ada027f05 Run asan and macOS CI in release mode too
I don't know why we're inconsistent about this, and at least asan fails
frequently due to timeouts.
2024-04-02 14:35:16 +02:00
Fabian Boehm
46cde6cc55 Github Actions: Remove CXXFLAGS for ASAN
The only C++ we have left is fish_test_helper
2024-03-19 16:54:33 +01:00
Fabian Boehm
f62f1aaf99 Remove remaining mentions of curses 2024-02-23 16:36:10 +01:00
Fabian Boehm
bcebcdc0ad CI: Run macOS tests as debug
These are dog-slow at building, and the tests themselves are barely
sped up running as release.

Given that we have ~10 minute build and ~3 minute test time on Github
Actions on macOS, let's see if this speeds it up

(we can also do it for the others, but the most important is the
slowest test because that's what stops the checkmark appearing)
2024-02-02 16:16:08 +01:00
David Adam
9ac5e79e46 CI: use make VERBOSE=1 everywhere
Having visible build commands helps reproducibility.
2024-01-26 07:33:24 +08:00
David Adam
d418cce493 correct workflow name for static PCRE2 2024-01-13 21:23:37 +08:00
Johannes Altmanninger
67de32fe2d Enable pexpect tests in ASAN CI again 2024-01-13 03:07:29 +01:00
Johannes Altmanninger
6ab74c6b09 Human-readable ASAN stack traces CI
Show file names, line numbers and function names in ASAN stack traces
(instead of object file + raw memory address).
2024-01-13 03:07:29 +01:00
Johannes Altmanninger
537e3cb9e1 CI: remove UBSAN_OPTIONS
Rust does not support  UBSan today.
2024-01-13 03:07:29 +01:00
Fabian Boehm
244d882984 Fix ASAN workflow 2024-01-07 15:39:48 +01:00
Fabian Boehm
e62f32c16b CI: Remove --deny=warnings from clippy test
This was pretty annoying on rust release day, because it introduced
new warnings.

Specifically 1.73 introduced a spurious one about PartialOrd and Ord
disagreeing when both were in fact #derive-d.
2023-10-07 19:48:54 +02:00
Fabian Boehm
5e775d1607 Upgrade actions/checkout to v4
Otherwise it's gonna start throwing node warnings soon.

Isn't software great?
2023-09-06 10:13:04 +02:00
Henrik Hørlück Berg
5734630966 Replace ATiltedTree/setup-rust with rust-toolchain
- https://github.com/ATiltedTree/setup-rust has not been committed to since May
  2022, I am uncertain about how widely used it is.
- It appears to have a bug with restoring its internal cache whenever there
  comes a new stable version (immediate guess would be the cache-key does not
  resolve `stable` to a specific version, which somehow breaks rustup, but I have not investigated)
- https://github.com/dtolnay/rust-toolchain is a more sensible take of https://github.com/actions-rs/toolchain,
  where the original repo appears to be unmaintained.
  It is implemented in one file of yaml/bash
  https://github.com/dtolnay/rust-toolchain/blob/master/action.yml, we could
  easily fork it if it becomes unmainted, unlike the other actions which uses
  unnecessary javascript
2023-08-28 23:15:25 +08:00
Henrik Hørlück Berg
824e76ebe4 Make CI use the workspace, so we format/check all 2023-08-19 15:18:38 +02:00
Fabian Boehm
54fa1ad6ec Revert "Try to move rust CI back to 1.70"
Should *hopefully* be fixed by deleting the cache at https://github.com/fish-shell/fish-shell/actions/caches.

This reverts commit 5c29ff52fb.
2023-07-14 21:36:43 +02:00
Fabian Boehm
5c29ff52fb Try to move rust CI back to 1.70
1.71 seems to have weird issues on Github Actions and that makes the
tests fail for no good reason

(gosh dangit YAML)
2023-07-14 21:11:15 +02:00
Fabian Boehm
055e40467f github actions: Disable pexpect for ASAN for now
This fails basically every commit, just by blowing the time budget.
2023-05-08 19:05:44 +02:00
Mahmoud Al-Qudsi
7b0cc33f2e Add LSAN suppressions file
Suppress TLS variable leaks caused by outstanding background threads by
suppressing the ASAN interposer functions. This is possible because because
we're now using use_tls=1.

-----------------------

Direct leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x5627a1f0cc86 in __interceptor_realloc (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xb9fc86) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #1 0x7f04d8800f79 in pthread_getattr_np (/lib/x86_64-linux-gnu/libc.so.6+0x95f79) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
    #2 0x5627a1f2f664 in __sanitizer::GetThreadStackTopAndBottom(bool, unsigned long*, unsigned long*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbc2664) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #3 0x5627a1f2fb83 in __sanitizer::GetThreadStackAndTls(bool, unsigned long*, unsigned long*, unsigned long*, unsigned long*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbc2b83) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #4 0x5627a1f19a0d in __asan::AsanThread::SetThreadStackAndTls(__asan::AsanThread::InitOptions const*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbaca0d) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #5 0x5627a1f19615 in __asan::AsanThread::Init(__asan::AsanThread::InitOptions const*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbac615) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #6 0x5627a1f19b01 in __asan::AsanThread::ThreadStart(unsigned long long) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbacb01) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #7 0x7f04d87ffb42  (/lib/x86_64-linux-gnu/libc.so.6+0x94b42) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
    #8 0x7f04d88919ff  (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
2023-05-02 11:52:42 -05:00
Mahmoud Al-Qudsi
905430629d Use ASAN_OPTIONS fast_unwind_on_malloc=0
This is much slower but gives proper stack traces for calls emanating from code
that wasn't compiled with -fno-omit-frame-pointer.
2023-05-02 11:52:42 -05:00
Mahmoud Al-Qudsi
c43e040c7c Fix spurious ASAN __cxa_thread_atexit_impl() leaks
Set use_tls back to its default of 1.

This is required to work around an ASAN/LSAN virtualization bug but seems to be
behind the random __cxa_thread_atexit_impl() leaks?
2023-05-02 11:52:41 -05:00
Mahmoud Al-Qudsi
544bd183da Add and use ASAN blacklist
Blacklist an apparently false positive in the underlying runtime.
2023-04-29 11:02:59 -05:00
ridiculousfish
2d6f752f6e Revert "Add link-asan to RUSTFLAGS in CI"
This reverts commit 8bb1bb8ae1.
2023-04-06 14:29:18 -07:00
ridiculousfish
8bb1bb8ae1 Add link-asan to RUSTFLAGS in CI
This fixes our CI for the new crates we're about to add.
2023-03-26 11:07:15 -07:00
Mahmoud Al-Qudsi
1bdb7dffaf Use cargo build -Z build-std for ASAN
This is recommended and increases coverage.
2023-03-08 11:27:15 -06:00
Mahmoud Al-Qudsi
ce5686edc7 Have ASAN CI use debug build
This catches things that might be optimized away by the compiler.
2023-03-07 13:04:28 -06:00
Mahmoud Al-Qudsi
91cf526d23
Enable rust address sanitizer for asan ci job (#9643)
Rust has multiple sanitizers available (with llvm integration).
-Zsanitizer=address catches the most likely culprits but we may want to set up a
separate job w/ -Zsanitizer=memory to catch uninitialized reads.

It might be necessary to execute `cargo build` as `cargo build -Zbuild-std` to
get full coverage.

When we're linking against the hybrid C++ codebase, the sanitizer library is
injected into the binary by also include `-fsanitize=address` in CXXFLAGS - we
do *not* want to manually opt-into `-lasan`. We also need to manually specify
the desired target triple as a CMake variable and then explicitly pass it to all
`cargo` invocations if building with ASAN.

Corrosion has been patched to make sure it follows these rules.

The `cargo-test` target is failing to link under ASAN. For some reason it has
autocxx/ffi dependencies even though only rust-native, ffi-free code should be
tested (and one would think the situation wouldn't change depending on the
presence of the sanitizer flag). It's been disabled under ASAN for now.
2023-03-06 18:15:36 -06:00
Xiretza
dff7db2f16
Run rustfmt and clippy in CI (#9616)
* Add machine-readable MSRV to Cargo.toml
* Fix clippy warnings
* CI: add rustfmt and clippy checks
2023-02-26 13:20:20 -06:00
Fabian Boehm
ad22bf9387 GH Actions: Use our MSRV as the rust-version
Currently we're at 1.67, I don't want to accidentally introduce 1.68
features once that's released
2023-02-20 19:40:47 +01:00
Mahmoud Al-Qudsi
4f6fe0999e Disable TSAN in CI for now
See issues encountered in #9586 due to TSAN not recognizing valid/safe rust
patterns.
2023-02-19 15:42:07 -06:00
ridiculousfish
d843b67d2d Initial Rust commit 2023-02-02 19:34:47 -07:00
LingMan
0af2a7a9b7 Upgrade GitHub action dessant/lock-threads to v4
In v3 several input parameters where renamed and since v4 it requires Node.js 16.

This resolves warnings about Node.js 12 and `set-output` being deprecated and
slated for removal in the `Lock threads` workflow.
2023-02-01 10:40:46 +08:00
Mahmoud Al-Qudsi
31f63b2f87 Upgrade GitHub CI actions/checkout to v3
This addresses the node v12 deprecation warning in the GitHub CI, caused by the
dependency on actions/checkout@v2.

While actions/checkout@v3 introduces some new features and changes some
defaults, the subset of features that we use should not be affected by this
migration.

The "breaking change" from v2 to v3 can be seen at [0]. Since we are tracking
only v2 without a dot release specified, we are already opting into any breakage
across minor versions, so really the only change of note is the node version
upgrade.

[0]: https://github.com/actions/checkout/compare/v2.4.2...v3.0.0
2023-01-31 11:50:57 -06:00