Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 16 additions & 55 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
rust-overlay = {
Expand Down Expand Up @@ -52,7 +51,7 @@
(
final: prev: {
# TODO: Bump the Rust version here...
rustToolchain = final.pkgsBuildHost.rust-bin.stable."1.72.1".default.override {
rustToolchain = final.pkgsBuildHost.rust-bin.stable."1.81.0".default.override {
targets =
final.lib.optionals final.stdenv.targetPlatform.isDarwin [
"x86_64-apple-darwin"
Expand All @@ -74,9 +73,6 @@
# GHC versions to include in the environment for integration tests.
# Keep this in sync with `./test-harness/src/ghc_version.rs`.
ghcVersions = [
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
];
Expand Down
2 changes: 1 addition & 1 deletion nix/packages/checks/treefmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mkCheck {
];

checkPhase = ''
treefmt --fail-on-change
HOME="$PWD" treefmt --fail-on-change
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol lmao, i dont even want to know

'';

meta.description = ''
Expand Down
7 changes: 2 additions & 5 deletions nix/packages/ghciwatch.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
lib,
stdenv,
libiconv,
pkgsStatic,
darwin,
buildPackages,
haskell,
Expand Down Expand Up @@ -56,10 +56,7 @@

nativeBuildInputs = lib.optionals stdenv.isDarwin [
# Additional darwin specific inputs can be set here
(libiconv.override {
enableStatic = true;
enableShared = false;
})
pkgsStatic.libiconv
darwin.apple_sdk.frameworks.CoreServices
];

Expand Down
2 changes: 1 addition & 1 deletion src/clap_markdown/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ where
if arg.is_positional() {
let id = arg
.get_value_names()
.and_then(|names| names.get(0))
.and_then(|names| names.first())
.map(|name| name.as_str())
.unwrap_or_else(|| arg.get_id().as_str());

Expand Down
2 changes: 1 addition & 1 deletion src/ghci/loaded_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl PartialEq for LoadedModule {

impl PartialOrd for LoadedModule {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.path.partial_cmp(&other.path)
Some(self.cmp(other))
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/ghci/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,7 @@ impl Ghci {
prompt_patterns: AhoCorasick::from_anchored_patterns([PROMPT]),
};

let stdin = GhciStdin {
stdin,
stderr_sender: stderr_sender.clone(),
};
let stdin = GhciStdin { stdin };

shutdown
.spawn("stderr", |shutdown| {
Expand Down
4 changes: 0 additions & 4 deletions src/ghci/stdin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ use miette::Context;
use miette::IntoDiagnostic;
use tokio::io::AsyncWriteExt;
use tokio::process::ChildStdin;
use tokio::sync::mpsc;
use tracing::instrument;

use crate::incremental_reader::FindAt;

use super::loaded_module::LoadedModule;
use super::parse::ShowPaths;
use super::stderr::StderrEvent;
use super::CompilationLog;
use super::GhciCommand;
use super::ModuleSet;
Expand All @@ -20,8 +18,6 @@ use crate::ghci::GhciStdout;
pub struct GhciStdin {
/// Inner stdin writer.
pub stdin: ChildStdin,
/// Channel sender for communicating with the stderr task.
pub stderr_sender: mpsc::Sender<StderrEvent>,
}

impl GhciStdin {
Expand Down
2 changes: 1 addition & 1 deletion test-harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fs_extra = "1.3.0"
futures-util = "0.3.28"
itertools = "0.11.0"
miette = { version = "5.9.0", features = ["fancy"] }
nix = { version = "0.26.2", default_features = false, features = ["process", "signal"] }
nix = { version = "0.26.2", default-features = false, features = ["process", "signal"] }
regex = "1.9.4"
serde = { version = "1.0.186", features = ["derive"] }
serde_json = "1.0.105"
Expand Down
1 change: 1 addition & 0 deletions test-harness/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl Fs {
}
OpenOptions::new()
.create(true)
.append(true)
.write(true)
.open(path)
.await
Expand Down
2 changes: 1 addition & 1 deletion test-harness/src/ghciwatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl GhciWatch {
/// Returns the first matching event.
pub fn assert_logged_in_checkpoint(
&self,
checkpoints: impl CheckpointIndex + Clone,
checkpoints: impl CheckpointIndex,
matcher: impl IntoMatcher,
) -> miette::Result<&Event> {
let mut matcher = matcher.into_matcher()?;
Expand Down
6 changes: 3 additions & 3 deletions test-harness/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ use tokio::process::Child;
thread_local! {
/// The temporary directory where `ghciwatch` is run. Note that because tests are run with the
/// `tokio` current-thread runtime, this is unique per-test.
pub(crate) static TEMPDIR: RefCell<Option<PathBuf>> = RefCell::new(None);
pub(crate) static TEMPDIR: RefCell<Option<PathBuf>> = const { RefCell::new(None) };

/// The GHC version to use for this test. This should be a string like `ghc962`.
/// This is used to select the correct GHC version to run.
pub(crate) static GHC_VERSION: RefCell<String> = RefCell::new(String::new());
pub(crate) static GHC_VERSION: RefCell<String> = const { RefCell::new(String::new()) };

/// The `ghciwatch` process for this test.
///
/// This is set so that we can make sure to kill it when the test ends.
pub(crate) static GHCIWATCH_PROCESS: RefCell<Option<Child>> = RefCell::new(None);
pub(crate) static GHCIWATCH_PROCESS: RefCell<Option<Child>> = const { RefCell::new(None) };
}

/// Wraps an asynchronous test with startup/cleanup code.
Expand Down
2 changes: 1 addition & 1 deletion test-harness/src/tracing_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct Event {

impl Event {
/// Get an iterator over this event's spans, from the outside in (root to leaf).
pub fn spans(&self) -> impl Iterator<Item = &Span> + DoubleEndedIterator {
pub fn spans(&self) -> impl DoubleEndedIterator<Item = &Span> {
self.spans.iter().chain({
// The `new`, `exit`, and `close` span lifecycle events aren't emitted from inside the
// relevant span, so the span isn't listed in `spans`. Instead, the relevant span is in
Expand Down