chore(core): update rust to 2024 edition (#31156)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently using 2021 edition of rust

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Updates to 2024 edition to support more features that are coming in
other PRs

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
This commit is contained in:
Jonathan Cammisuli 2025-05-13 18:11:05 -04:00 committed by GitHub
parent 3d73fd30a0
commit 889dee0854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
43 changed files with 165 additions and 133 deletions

View File

@ -123,9 +123,13 @@ jobs:
settings:
- host: macos-13
target: x86_64-apple-darwin
setup: |-
rustup target add aarch64-apple-darwin
build: |
pnpm nx run-many --target=build-native -- --target=x86_64-apple-darwin
- host: windows-latest
setup: |-
rustup target add aarch64-pc-windows-msvc
build: pnpm nx run-many --target=build-native -- --target=x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
# Windows 32bit (not needed)
@ -141,6 +145,7 @@ jobs:
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add aarch64-unknown-linux-gnu &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
@ -150,9 +155,12 @@ jobs:
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add x86_64-unknown-linux-musl &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
- host: macos-13
target: aarch64-apple-darwin
setup: |-
rustup target add aarch64-apple-darwin
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
@ -168,12 +176,14 @@ jobs:
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add aarch64-unknown-linux-gnu &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y
rustup target add armv7-unknown-linux-gnueabihf
build: |
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=/usr/bin/arm-linux-gnueabihf-gcc pnpm nx run-many --target=build-native -- --target=armv7-unknown-linux-gnueabihf
# Android (not needed)
@ -197,6 +207,8 @@ jobs:
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
- host: windows-latest
target: aarch64-pc-windows-msvc
setup: |-
rustup target add aarch64-pc-windows-msvc
build: pnpm nx run-many --target=build-native -- --target=aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}

View File

@ -6,7 +6,7 @@
/tools/**/* @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
package.json @nrwl/nx-core-reviewers
pnpm-lock.yaml @nrwl/nx-core-reviewers
rust-toolchain @nrwl/nx-native-reviewers
rust-toolchain.toml @nrwl/nx-native-reviewers
# Docs Site + Graph
/docs @nrwl/nx-docs-reviewers

2
Cargo.lock generated
View File

@ -2203,7 +2203,7 @@ dependencies = [
"insta",
"itertools 0.10.5",
"machine-uid",
"mio 0.8.11",
"mio 1.0.3",
"napi",
"napi-build",
"napi-derive",

View File

@ -23,7 +23,7 @@
"preinstall": "node ./scripts/preinstall.js",
"test": "nx run-many -t test",
"e2e": "nx run-many -t e2e --projects ./e2e/*",
"build:wasm": "rustup override set nightly-2024-07-19 && rustup target add wasm32-wasip1-threads && WASI_SDK_PATH=\"$(pwd)/wasi-sdk-23.0-x86_64-linux\" CMAKE_BUILD_PARALLEL_LEVEL=2 LIBSQLITE3_FLAGS=\"-DLONGDOUBLE_TYPE=double\" pnpm exec nx run-many -t build-native-wasm && rustup override unset",
"build:wasm": "rustup override set nightly-2025-05-09 && rustup target add wasm32-wasip1-threads && WASI_SDK_PATH=\"$(pwd)/wasi-sdk-23.0-x86_64-linux\" CMAKE_BUILD_PARALLEL_LEVEL=2 LIBSQLITE3_FLAGS=\"-DLONGDOUBLE_TYPE=double\" pnpm exec nx run-many -t build-native-wasm && rustup override unset",
"lint-pnpm-lock": "eslint pnpm-lock.yaml"
},
"devDependencies": {

View File

@ -1,7 +1,7 @@
[package]
name = 'nx'
version = '0.1.0'
edition = '2021'
edition = '2024'
[profile.release-wasi]
codegen-units = 16
@ -64,7 +64,7 @@ vt100-ctt = { git = "https://github.com/JamesHenry/vt100-rust", rev = "b15dc3b0f
winapi = { version = "0.3", features = ["fileapi", "psapi", "shellapi"] }
[target.'cfg(all(not(windows), not(target_family = "wasm")))'.dependencies]
mio = "0.8"
mio = "1.0"
nix = { version = "0.30.0", features = ["process", "signal"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View File

@ -179,8 +179,7 @@ impl NxCache {
) -> anyhow::Result<()> {
trace!(
"applying remote cache results: {:?} ({})",
&hash,
&result.outputs_path
&hash, &result.outputs_path
);
let terminal_output = result.terminal_output.clone().unwrap_or(String::from(""));
let mut size = terminal_output.len() as i64;
@ -298,8 +297,7 @@ impl NxCache {
trace!(
"Copying Files from Cache {:?} -> {:?}",
&outputs_path,
&self.workspace_root
&outputs_path, &self.workspace_root
);
let sz = _copy(outputs_path, &self.workspace_root);

View File

@ -170,8 +170,8 @@ pub fn get_files_for_outputs(
#[cfg(test)]
mod test {
use super::*;
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
use std::{assert_eq, vec};
fn setup_fs() -> TempDir {

View File

@ -98,8 +98,8 @@ fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<u64>
#[cfg(test)]
mod test {
use super::*;
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
#[test]
fn should_copy_directories() {
@ -115,9 +115,10 @@ mod test {
let dest = temp.join("new-parent/child/grand-child/.config");
copy(src.to_string_lossy().into(), dest.to_string_lossy().into()).unwrap();
assert!(temp
.child("new-parent/child/grand-child/.config/file.txt")
.exists());
assert!(
temp.child("new-parent/child/grand-child/.config/file.txt")
.exists()
);
}
#[test]

View File

@ -7,10 +7,10 @@ use std::{
use super::{
cache::CachedResult,
errors::{convert_response_to_error, report_request_error, HttpRemoteCacheErrors},
errors::{HttpRemoteCacheErrors, convert_response_to_error, report_request_error},
};
use flate2::Compression;
use reqwest::{header, Client, ClientBuilder, StatusCode};
use reqwest::{Client, ClientBuilder, StatusCode, header};
use tar::{Archive, Builder};
use tracing::trace;

View File

@ -1,6 +1,6 @@
use crate::native::db::connection::NxDbConnection;
use rusqlite::{Connection, OpenFlags};
use std::fs::{remove_file, File};
use std::fs::{File, remove_file};
use std::path::{Path, PathBuf};
use tracing::{debug, trace};

View File

@ -2,7 +2,7 @@ use crate::native::glob::glob_group::GlobGroup;
use nom::branch::alt;
use nom::bytes::complete::{is_not, tag, take_till, take_until, take_while};
use nom::combinator::{eof, map, map_parser};
use nom::error::{context, convert_error, VerboseError};
use nom::error::{VerboseError, context, convert_error};
use nom::multi::{many_till, separated_list0};
use nom::sequence::{preceded, terminated};
use nom::{Finish, IResult};

View File

@ -46,8 +46,8 @@ pub fn hash_file_path<P: AsRef<Path>>(path: P) -> Option<String> {
#[cfg(test)]
mod tests {
use crate::native::hasher::{hash_array, hash_file};
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
///
/// Setup a temporary directory to do testing in

View File

@ -6,7 +6,7 @@ use std::fs::create_dir_all;
use std::io::IsTerminal;
use tracing::{Event, Level, Subscriber};
use tracing_appender::rolling::{RollingFileAppender, Rotation};
use tracing_subscriber::fmt::{format, FmtContext, FormatEvent, FormatFields, FormattedFields};
use tracing_subscriber::fmt::{FmtContext, FormatEvent, FormatFields, FormattedFields, format};
use tracing_subscriber::prelude::*;
use tracing_subscriber::registry::LookupSpan;
use tracing_subscriber::{EnvFilter, Layer};

View File

@ -59,43 +59,45 @@ function __napi_rs_initialize_modules(__napiInstance) {
__napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
__napiInstance.exports['__napi_register__hash_array_6']?.()
__napiInstance.exports['__napi_register__hash_file_7']?.()
__napiInstance.exports['__napi_register__IS_WASM_8']?.()
__napiInstance.exports['__napi_register__get_binary_target_9']?.()
__napiInstance.exports['__napi_register__ImportResult_struct_10']?.()
__napiInstance.exports['__napi_register__find_imports_11']?.()
__napiInstance.exports['__napi_register__transfer_project_graph_12']?.()
__napiInstance.exports['__napi_register__ExternalNode_struct_13']?.()
__napiInstance.exports['__napi_register__Target_struct_14']?.()
__napiInstance.exports['__napi_register__Project_struct_15']?.()
__napiInstance.exports['__napi_register__ProjectGraph_struct_16']?.()
__napiInstance.exports['__napi_register__HashPlanner_struct_17']?.()
__napiInstance.exports['__napi_register__HashPlanner_impl_21']?.()
__napiInstance.exports['__napi_register__HashDetails_struct_22']?.()
__napiInstance.exports['__napi_register__HasherOptions_struct_23']?.()
__napiInstance.exports['__napi_register__TaskHasher_struct_24']?.()
__napiInstance.exports['__napi_register__TaskHasher_impl_27']?.()
__napiInstance.exports['__napi_register__Task_struct_28']?.()
__napiInstance.exports['__napi_register__TaskTarget_struct_29']?.()
__napiInstance.exports['__napi_register__TaskResult_struct_30']?.()
__napiInstance.exports['__napi_register__TaskGraph_struct_31']?.()
__napiInstance.exports['__napi_register__FileData_struct_32']?.()
__napiInstance.exports['__napi_register__InputsInput_struct_33']?.()
__napiInstance.exports['__napi_register__FileSetInput_struct_34']?.()
__napiInstance.exports['__napi_register__RuntimeInput_struct_35']?.()
__napiInstance.exports['__napi_register__EnvironmentInput_struct_36']?.()
__napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_37']?.()
__napiInstance.exports['__napi_register__DepsOutputsInput_struct_38']?.()
__napiInstance.exports['__napi_register__NxJson_struct_39']?.()
__napiInstance.exports['__napi_register__FileLock_struct_40']?.()
__napiInstance.exports['__napi_register__FileLock_impl_42']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_struct_43']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_impl_54']?.()
__napiInstance.exports['__napi_register__WorkspaceErrors_55']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_56']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_57']?.()
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_58']?.()
__napiInstance.exports['__napi_register__FileMap_struct_59']?.()
__napiInstance.exports['__napi_register____test_only_transfer_file_map_60']?.()
__napiInstance.exports['__napi_register__log_info_8']?.()
__napiInstance.exports['__napi_register__log_error_9']?.()
__napiInstance.exports['__napi_register__IS_WASM_10']?.()
__napiInstance.exports['__napi_register__get_binary_target_11']?.()
__napiInstance.exports['__napi_register__ImportResult_struct_12']?.()
__napiInstance.exports['__napi_register__find_imports_13']?.()
__napiInstance.exports['__napi_register__transfer_project_graph_14']?.()
__napiInstance.exports['__napi_register__ExternalNode_struct_15']?.()
__napiInstance.exports['__napi_register__Target_struct_16']?.()
__napiInstance.exports['__napi_register__Project_struct_17']?.()
__napiInstance.exports['__napi_register__ProjectGraph_struct_18']?.()
__napiInstance.exports['__napi_register__HashPlanner_struct_19']?.()
__napiInstance.exports['__napi_register__HashPlanner_impl_23']?.()
__napiInstance.exports['__napi_register__HashDetails_struct_24']?.()
__napiInstance.exports['__napi_register__HasherOptions_struct_25']?.()
__napiInstance.exports['__napi_register__TaskHasher_struct_26']?.()
__napiInstance.exports['__napi_register__TaskHasher_impl_29']?.()
__napiInstance.exports['__napi_register__Task_struct_30']?.()
__napiInstance.exports['__napi_register__TaskTarget_struct_31']?.()
__napiInstance.exports['__napi_register__TaskResult_struct_32']?.()
__napiInstance.exports['__napi_register__TaskGraph_struct_33']?.()
__napiInstance.exports['__napi_register__FileData_struct_34']?.()
__napiInstance.exports['__napi_register__InputsInput_struct_35']?.()
__napiInstance.exports['__napi_register__FileSetInput_struct_36']?.()
__napiInstance.exports['__napi_register__RuntimeInput_struct_37']?.()
__napiInstance.exports['__napi_register__EnvironmentInput_struct_38']?.()
__napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_39']?.()
__napiInstance.exports['__napi_register__DepsOutputsInput_struct_40']?.()
__napiInstance.exports['__napi_register__NxJson_struct_41']?.()
__napiInstance.exports['__napi_register__FileLock_struct_42']?.()
__napiInstance.exports['__napi_register__FileLock_impl_44']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_struct_45']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_impl_56']?.()
__napiInstance.exports['__napi_register__WorkspaceErrors_57']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_58']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_59']?.()
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_60']?.()
__napiInstance.exports['__napi_register__FileMap_struct_61']?.()
__napiInstance.exports['__napi_register____test_only_transfer_file_map_62']?.()
}
export const FileLock = __napiModule.exports.FileLock
export const HashPlanner = __napiModule.exports.HashPlanner
@ -111,6 +113,8 @@ export const getTransformableOutputs = __napiModule.exports.getTransformableOutp
export const hashArray = __napiModule.exports.hashArray
export const hashFile = __napiModule.exports.hashFile
export const IS_WASM = __napiModule.exports.IS_WASM
export const logError = __napiModule.exports.logError
export const logInfo = __napiModule.exports.logInfo
export const remove = __napiModule.exports.remove
export const testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
export const transferProjectGraph = __napiModule.exports.transferProjectGraph

View File

@ -90,43 +90,45 @@ function __napi_rs_initialize_modules(__napiInstance) {
__napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
__napiInstance.exports['__napi_register__hash_array_6']?.()
__napiInstance.exports['__napi_register__hash_file_7']?.()
__napiInstance.exports['__napi_register__IS_WASM_8']?.()
__napiInstance.exports['__napi_register__get_binary_target_9']?.()
__napiInstance.exports['__napi_register__ImportResult_struct_10']?.()
__napiInstance.exports['__napi_register__find_imports_11']?.()
__napiInstance.exports['__napi_register__transfer_project_graph_12']?.()
__napiInstance.exports['__napi_register__ExternalNode_struct_13']?.()
__napiInstance.exports['__napi_register__Target_struct_14']?.()
__napiInstance.exports['__napi_register__Project_struct_15']?.()
__napiInstance.exports['__napi_register__ProjectGraph_struct_16']?.()
__napiInstance.exports['__napi_register__HashPlanner_struct_17']?.()
__napiInstance.exports['__napi_register__HashPlanner_impl_21']?.()
__napiInstance.exports['__napi_register__HashDetails_struct_22']?.()
__napiInstance.exports['__napi_register__HasherOptions_struct_23']?.()
__napiInstance.exports['__napi_register__TaskHasher_struct_24']?.()
__napiInstance.exports['__napi_register__TaskHasher_impl_27']?.()
__napiInstance.exports['__napi_register__Task_struct_28']?.()
__napiInstance.exports['__napi_register__TaskTarget_struct_29']?.()
__napiInstance.exports['__napi_register__TaskResult_struct_30']?.()
__napiInstance.exports['__napi_register__TaskGraph_struct_31']?.()
__napiInstance.exports['__napi_register__FileData_struct_32']?.()
__napiInstance.exports['__napi_register__InputsInput_struct_33']?.()
__napiInstance.exports['__napi_register__FileSetInput_struct_34']?.()
__napiInstance.exports['__napi_register__RuntimeInput_struct_35']?.()
__napiInstance.exports['__napi_register__EnvironmentInput_struct_36']?.()
__napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_37']?.()
__napiInstance.exports['__napi_register__DepsOutputsInput_struct_38']?.()
__napiInstance.exports['__napi_register__NxJson_struct_39']?.()
__napiInstance.exports['__napi_register__FileLock_struct_40']?.()
__napiInstance.exports['__napi_register__FileLock_impl_42']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_struct_43']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_impl_54']?.()
__napiInstance.exports['__napi_register__WorkspaceErrors_55']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_56']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_57']?.()
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_58']?.()
__napiInstance.exports['__napi_register__FileMap_struct_59']?.()
__napiInstance.exports['__napi_register____test_only_transfer_file_map_60']?.()
__napiInstance.exports['__napi_register__log_info_8']?.()
__napiInstance.exports['__napi_register__log_error_9']?.()
__napiInstance.exports['__napi_register__IS_WASM_10']?.()
__napiInstance.exports['__napi_register__get_binary_target_11']?.()
__napiInstance.exports['__napi_register__ImportResult_struct_12']?.()
__napiInstance.exports['__napi_register__find_imports_13']?.()
__napiInstance.exports['__napi_register__transfer_project_graph_14']?.()
__napiInstance.exports['__napi_register__ExternalNode_struct_15']?.()
__napiInstance.exports['__napi_register__Target_struct_16']?.()
__napiInstance.exports['__napi_register__Project_struct_17']?.()
__napiInstance.exports['__napi_register__ProjectGraph_struct_18']?.()
__napiInstance.exports['__napi_register__HashPlanner_struct_19']?.()
__napiInstance.exports['__napi_register__HashPlanner_impl_23']?.()
__napiInstance.exports['__napi_register__HashDetails_struct_24']?.()
__napiInstance.exports['__napi_register__HasherOptions_struct_25']?.()
__napiInstance.exports['__napi_register__TaskHasher_struct_26']?.()
__napiInstance.exports['__napi_register__TaskHasher_impl_29']?.()
__napiInstance.exports['__napi_register__Task_struct_30']?.()
__napiInstance.exports['__napi_register__TaskTarget_struct_31']?.()
__napiInstance.exports['__napi_register__TaskResult_struct_32']?.()
__napiInstance.exports['__napi_register__TaskGraph_struct_33']?.()
__napiInstance.exports['__napi_register__FileData_struct_34']?.()
__napiInstance.exports['__napi_register__InputsInput_struct_35']?.()
__napiInstance.exports['__napi_register__FileSetInput_struct_36']?.()
__napiInstance.exports['__napi_register__RuntimeInput_struct_37']?.()
__napiInstance.exports['__napi_register__EnvironmentInput_struct_38']?.()
__napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_39']?.()
__napiInstance.exports['__napi_register__DepsOutputsInput_struct_40']?.()
__napiInstance.exports['__napi_register__NxJson_struct_41']?.()
__napiInstance.exports['__napi_register__FileLock_struct_42']?.()
__napiInstance.exports['__napi_register__FileLock_impl_44']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_struct_45']?.()
__napiInstance.exports['__napi_register__WorkspaceContext_impl_56']?.()
__napiInstance.exports['__napi_register__WorkspaceErrors_57']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_58']?.()
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_59']?.()
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_60']?.()
__napiInstance.exports['__napi_register__FileMap_struct_61']?.()
__napiInstance.exports['__napi_register____test_only_transfer_file_map_62']?.()
}
module.exports.FileLock = __napiModule.exports.FileLock
module.exports.HashPlanner = __napiModule.exports.HashPlanner
@ -142,6 +144,8 @@ module.exports.getTransformableOutputs = __napiModule.exports.getTransformableOu
module.exports.hashArray = __napiModule.exports.hashArray
module.exports.hashFile = __napiModule.exports.hashFile
module.exports.IS_WASM = __napiModule.exports.IS_WASM
module.exports.logError = __napiModule.exports.logError
module.exports.logInfo = __napiModule.exports.logInfo
module.exports.remove = __napiModule.exports.remove
module.exports.testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
module.exports.transferProjectGraph = __napiModule.exports.transferProjectGraph

View File

@ -715,8 +715,8 @@ mod find_imports {
use super::*;
use crate::native::glob::build_glob_set;
use crate::native::walker::nx_walker;
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
use std::env;
use std::path::PathBuf;
use swc_common::comments::NoopComments;

View File

@ -1,4 +1,4 @@
use crate::native::project_graph::utils::{normalize_project_root, ProjectRootMappings};
use crate::native::project_graph::utils::{ProjectRootMappings, normalize_project_root};
use std::path::Path;
pub fn find_project_for_path<P: AsRef<Path>>(

View File

@ -1,13 +1,13 @@
use super::process_killer::ProcessKiller;
use crate::native::pseudo_terminal::pseudo_terminal::{ParserArc, WriterArc};
use crossbeam_channel::Sender;
use crossbeam_channel::{bounded, select, Receiver};
use crossbeam_channel::{Receiver, bounded, select};
use napi::bindgen_prelude::External;
use napi::{
Env, JsFunction,
threadsafe_function::{
ErrorStrategy::Fatal, ThreadsafeFunction, ThreadsafeFunctionCallMode::NonBlocking,
},
Env, JsFunction,
};
use std::io::Write;
use std::sync::{Arc, Mutex, RwLock};

View File

@ -1,4 +1,4 @@
use mio::{unix::SourceFd, Events};
use mio::{Events, unix::SourceFd};
use std::{
io::{Read, Stdin, Write},
os::fd::AsRawFd,

View File

@ -1,5 +1,5 @@
use nix::{
sys::signal::{kill, Signal as NixSignal},
sys::signal::{Signal as NixSignal, kill},
unistd::Pid,
};

View File

@ -1,5 +1,5 @@
use anyhow::anyhow;
use crossbeam_channel::{bounded, unbounded, Receiver, Sender};
use crossbeam_channel::{Receiver, Sender, bounded, unbounded};
use crossterm::{
terminal,
terminal::{disable_raw_mode, enable_raw_mode},
@ -13,8 +13,8 @@ use std::{
collections::HashMap,
io::{Read, Write},
sync::{
atomic::{AtomicBool, Ordering},
Arc,
atomic::{AtomicBool, Ordering},
},
time::Instant,
};

View File

@ -172,12 +172,18 @@ impl HashPlanner {
if self.project_graph.nodes.contains_key(dep) {
let deps = self.project_graph.dependencies.get(project_name);
if deps.is_some_and(|deps| deps.contains(dep)) {
anyhow::bail!("The externalDependency '{dep}' for '{project_name}:{target_name}' is not an external node and is already a dependency. Please remove it from the externalDependency inputs.")
anyhow::bail!(
"The externalDependency '{dep}' for '{project_name}:{target_name}' is not an external node and is already a dependency. Please remove it from the externalDependency inputs."
)
} else {
anyhow::bail!("The externalDependency '{dep}' for '{project_name}:{target_name}' is not an external node. If you believe this is a dependency, add an implicitDependency to '{project_name}'")
anyhow::bail!(
"The externalDependency '{dep}' for '{project_name}:{target_name}' is not an external node. If you believe this is a dependency, add an implicitDependency to '{project_name}'"
)
}
} else {
anyhow::bail!("The externalDependency '{dep}' for '{project_name}:{target_name}' could not be found")
anyhow::bail!(
"The externalDependency '{dep}' for '{project_name}:{target_name}' could not be found"
)
}
};
trace!(

View File

@ -2,7 +2,7 @@ use std::fmt::Formatter;
use std::{collections::HashMap, fmt, ptr};
use napi::{
bindgen_prelude::{check_status, ToNapiValue},
bindgen_prelude::{ToNapiValue, check_status},
sys,
};

View File

@ -24,6 +24,7 @@ use crate::native::{
};
use super::action::Action;
use super::components::Component;
use super::components::countdown_popup::CountdownPopup;
use super::components::help_popup::HelpPopup;
use super::components::layout_manager::{
@ -32,7 +33,6 @@ use super::components::layout_manager::{
use super::components::task_selection_manager::{SelectionMode, TaskSelectionManager};
use super::components::tasks_list::{TaskStatus, TasksList};
use super::components::terminal_pane::{TerminalPane, TerminalPaneData, TerminalPaneState};
use super::components::Component;
use super::config::TuiConfig;
use super::lifecycle::RunMode;
use super::pty::PtyInstance;

View File

@ -1,5 +1,6 @@
use color_eyre::eyre::Result;
use ratatui::{
Frame,
layout::{Alignment, Rect},
style::{Modifier, Style},
text::{Line, Span},
@ -7,7 +8,6 @@ use ratatui::{
Block, BorderType, Borders, Clear, Padding, Paragraph, Scrollbar, ScrollbarOrientation,
ScrollbarState,
},
Frame,
};
use std::any::Any;
use std::time::{Duration, Instant};

View File

@ -1,9 +1,9 @@
use ratatui::{
Frame,
layout::{Alignment, Rect},
style::{Modifier, Style},
text::{Line, Span},
widgets::Paragraph,
Frame,
};
use crate::native::tui::theme::THEME;

View File

@ -718,7 +718,7 @@ mod tests {
mod visual_tests {
use super::*;
use ratatui::widgets::{Block, Borders};
use ratatui::{backend::TestBackend, Terminal};
use ratatui::{Terminal, backend::TestBackend};
/// Render a layout configuration to a TestBackend for visualization
fn render_layout(

View File

@ -1,10 +1,10 @@
use crate::native::tui::theme::THEME;
use ratatui::{
Frame,
layout::Rect,
style::{Modifier, Style},
text::{Line, Span},
widgets::Paragraph,
Frame,
};
pub struct Pagination {

View File

@ -1,11 +1,11 @@
use color_eyre::eyre::Result;
use hashbrown::HashSet;
use ratatui::{
Frame,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Modifier, Style, Stylize},
text::{Line, Span},
widgets::{Block, Cell, Paragraph, Row, Table},
Frame,
};
use std::{
any::Any,
@ -1845,8 +1845,8 @@ impl Component for TasksList {
mod tests {
use super::*;
use crate::native::tasks::types::TaskTarget;
use ratatui::backend::TestBackend;
use ratatui::Terminal;
use ratatui::backend::TestBackend;
// Helper function to create a TasksList with test task data
fn create_test_tasks_list() -> (TasksList, Vec<Task>) {

View File

@ -1,6 +1,6 @@
use napi::JsObject;
use napi::bindgen_prelude::*;
use napi::threadsafe_function::{ErrorStrategy, ThreadsafeFunction};
use napi::JsObject;
use parking_lot::Mutex;
use std::sync::Arc;
use tracing::debug;

View File

@ -4,7 +4,7 @@
// This is the only file we should use the `ratatui::style::Color` type in
use ratatui::style::Color;
use std::sync::LazyLock;
use terminal_colorsaurus::{color_scheme, ColorScheme, QueryOptions};
use terminal_colorsaurus::{ColorScheme, QueryOptions, color_scheme};
use tracing::debug;
pub static THEME: LazyLock<Theme> = LazyLock::new(Theme::init);

View File

@ -419,14 +419,19 @@ mod tests {
match (a.end_time, b.end_time) {
(Some(time_a), Some(time_b)) => {
if time_a > time_b {
panic!("Sort order violation: task with end_time {} should come before task with end_time {}", time_b, time_a);
panic!(
"Sort order violation: task with end_time {} should come before task with end_time {}",
time_b, time_a
);
} else if time_a < time_b {
continue;
}
// If end times are equal, fall through to name check
}
(Some(_), None) => continue, // Correct order
(None, Some(_)) => panic!("Sort order violation: task with end_time should come before task without end_time"),
(None, Some(_)) => panic!(
"Sort order violation: task with end_time should come before task without end_time"
),
(None, None) => {} // Fall through to name check
}
}

View File

@ -1,5 +1,5 @@
use napi::bindgen_prelude::Either7;
use napi::Either;
use napi::bindgen_prelude::Either7;
#[napi(object)]
pub struct InputsInput {

View File

@ -1,6 +1,6 @@
use dashmap::DashMap;
use napi::bindgen_prelude::{Object, ToNapiValue};
use napi::{sys, Env};
use napi::{Env, sys};
use std::collections::hash_map::RandomState;
use std::ops::{Deref, DerefMut};

View File

@ -122,8 +122,8 @@ impl FileLock {
mod test {
use super::*;
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
#[test]
fn test_new_lock() {

View File

@ -1,4 +1,4 @@
use crate::native::glob::{build_glob_set, NxGlobSet};
use crate::native::glob::{NxGlobSet, build_glob_set};
use crate::native::project_graph::types::{Project, ProjectGraph};
use hashbrown::HashSet;
use std::collections::HashMap;

View File

@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
use crate::native::glob::build_glob_set;
use crate::native::logger::enable_logger;
use crate::native::utils::{get_mod_time, Normalize};
use crate::native::utils::{Normalize, get_mod_time};
use walkdir::WalkDir;
#[derive(PartialEq, Debug, Ord, PartialOrd, Eq, Clone)]
@ -192,8 +192,8 @@ where
mod test {
use std::{assert_eq, vec};
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
use super::*;

View File

@ -124,8 +124,8 @@ pub fn transform_event_to_watch_events(
#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]
{
use crate::native::walker::nx_walker_sync;
use ignore::gitignore::GitignoreBuilder;
use ignore::Match;
use ignore::gitignore::GitignoreBuilder;
if matches!(event_kind, FileEventKind::Create(CreateKind::Folder)) {
let mut result = vec![];

View File

@ -1,10 +1,10 @@
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::path::MAIN_SEPARATOR;
use std::sync::Arc;
use crate::native::watch::types::{
transform_event_to_watch_events, EventType, WatchEvent, WatchEventInternal,
EventType, WatchEvent, WatchEventInternal, transform_event_to_watch_events,
};
use crate::native::watch::watch_filterer;
use napi::bindgen_prelude::*;

View File

@ -6,9 +6,9 @@ use std::sync::Arc;
use crate::native::hasher::hash;
use crate::native::logger::enable_logger;
use crate::native::project_graph::utils::{find_project_for_path, ProjectRootMappings};
use crate::native::project_graph::utils::{ProjectRootMappings, find_project_for_path};
use crate::native::types::FileData;
use crate::native::utils::{path::get_child_files, Normalize, NxCondvar, NxMutex};
use crate::native::utils::{Normalize, NxCondvar, NxMutex, path::get_child_files};
use crate::native::workspace::files_archive::{read_files_archive, write_files_archive};
use crate::native::workspace::files_hashing::{full_files_hash, selective_files_hash};
use crate::native::workspace::types::{

View File

@ -6,7 +6,7 @@ use rayon::prelude::*;
use tracing::trace;
use crate::native::hasher::hash_file_path;
use crate::native::walker::{nx_walker, NxFile};
use crate::native::walker::{NxFile, nx_walker};
use crate::native::workspace::files_archive::{NxFileHashed, NxFileHashes};
pub fn full_files_hash(workspace_root: &Path) -> NxFileHashes {
@ -63,8 +63,7 @@ fn hash_files(files: Vec<NxFile>) -> Vec<(String, NxFileHashed)> {
} else {
trace!(
"hashing workspace files in {} chunks of {}",
num_parallelism,
chunks
num_parallelism, chunks
);
files
.par_chunks(chunks)
@ -87,8 +86,8 @@ fn hash_files(files: Vec<NxFile>) -> Vec<(String, NxFileHashed)> {
#[cfg(test)]
mod tests {
use assert_fs::prelude::*;
use assert_fs::TempDir;
use assert_fs::prelude::*;
use crate::native::utils::get_mod_time;
use crate::native::workspace::files_archive::{NxFileHashed, NxFileHashes};

View File

@ -1 +0,0 @@
stable

4
rust-toolchain.toml Normal file
View File

@ -0,0 +1,4 @@
[toolchain]
channel = "1.86.0"
targets = ["wasm32-wasip1-threads"]
profile = "default"