Skip to content

Commit e5d2e71

Browse files
committed
chore(core): update rust to 2024 edition
chore(core): run cargo fmt for 2024 edition chore(core): update wasm bindings
1 parent 0a2553a commit e5d2e71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+164
-132
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,13 @@ jobs:
123123
settings:
124124
- host: macos-13
125125
target: x86_64-apple-darwin
126+
setup: |-
127+
rustup target add aarch64-apple-darwin
126128
build: |
127129
pnpm nx run-many --target=build-native -- --target=x86_64-apple-darwin
128130
- host: windows-latest
131+
setup: |-
132+
rustup target add aarch64-pc-windows-msvc
129133
build: pnpm nx run-many --target=build-native -- --target=x86_64-pc-windows-msvc
130134
target: x86_64-pc-windows-msvc
131135
# Windows 32bit (not needed)
@@ -141,6 +145,7 @@ jobs:
141145
npm i -g pnpm@9.8.0 --force &&
142146
pnpm --version &&
143147
pnpm install --frozen-lockfile &&
148+
rustup target add aarch64-unknown-linux-gnu &&
144149
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
145150
- host: ubuntu-latest
146151
target: x86_64-unknown-linux-musl
@@ -150,9 +155,12 @@ jobs:
150155
npm i -g pnpm@9.8.0 --force &&
151156
pnpm --version &&
152157
pnpm install --frozen-lockfile &&
158+
rustup target add x86_64-unknown-linux-musl &&
153159
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
154160
- host: macos-13
155161
target: aarch64-apple-darwin
162+
setup: |-
163+
rustup target add aarch64-apple-darwin
156164
build: |
157165
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
158166
export CC=$(xcrun -f clang);
@@ -168,12 +176,14 @@ jobs:
168176
npm i -g pnpm@9.8.0 --force &&
169177
pnpm --version &&
170178
pnpm install --frozen-lockfile &&
179+
rustup target add aarch64-unknown-linux-gnu &&
171180
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
172181
- host: ubuntu-latest
173182
target: armv7-unknown-linux-gnueabihf
174183
setup: |
175184
sudo apt-get update
176185
sudo apt-get install gcc-arm-linux-gnueabihf -y
186+
rustup target add armv7-unknown-linux-gnueabihf
177187
build: |
178188
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
179189
# Android (not needed)
@@ -197,6 +207,8 @@ jobs:
197207
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
198208
- host: windows-latest
199209
target: aarch64-pc-windows-msvc
210+
setup: |-
211+
rustup target add aarch64-pc-windows-msvc
200212
build: pnpm nx run-many --target=build-native -- --target=aarch64-pc-windows-msvc
201213
name: stable - ${{ matrix.settings.target }} - node@18
202214
runs-on: ${{ matrix.settings.host }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"preinstall": "node ./scripts/preinstall.js",
2424
"test": "nx run-many -t test",
2525
"e2e": "nx run-many -t e2e --projects ./e2e/*",
26-
"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",
26+
"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",
2727
"lint-pnpm-lock": "eslint pnpm-lock.yaml"
2828
},
2929
"devDependencies": {

packages/nx/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = 'nx'
33
version = '0.1.0'
4-
edition = '2021'
4+
edition = '2024'
55

66
[profile.release-wasi]
77
codegen-units = 16
@@ -64,7 +64,7 @@ vt100-ctt = { git = "https://github.com/JamesHenry/vt100-rust", rev = "b15dc3b0f
6464
winapi = { version = "0.3", features = ["fileapi", "psapi", "shellapi"] }
6565

6666
[target.'cfg(all(not(windows), not(target_family = "wasm")))'.dependencies]
67-
mio = "0.8"
67+
mio = "1.0"
6868
nix = { version = "0.30.0", features = ["process", "signal"] }
6969

7070
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

packages/nx/src/native/cache/cache.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ impl NxCache {
179179
) -> anyhow::Result<()> {
180180
trace!(
181181
"applying remote cache results: {:?} ({})",
182-
&hash,
183-
&result.outputs_path
182+
&hash, &result.outputs_path
184183
);
185184
let terminal_output = result.terminal_output.clone().unwrap_or(String::from(""));
186185
let mut size = terminal_output.len() as i64;
@@ -298,8 +297,7 @@ impl NxCache {
298297

299298
trace!(
300299
"Copying Files from Cache {:?} -> {:?}",
301-
&outputs_path,
302-
&self.workspace_root
300+
&outputs_path, &self.workspace_root
303301
);
304302
let sz = _copy(outputs_path, &self.workspace_root);
305303

packages/nx/src/native/cache/expand_outputs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ pub fn get_files_for_outputs(
170170
#[cfg(test)]
171171
mod test {
172172
use super::*;
173-
use assert_fs::prelude::*;
174173
use assert_fs::TempDir;
174+
use assert_fs::prelude::*;
175175
use std::{assert_eq, vec};
176176

177177
fn setup_fs() -> TempDir {

packages/nx/src/native/cache/file_ops.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<u64>
9898
#[cfg(test)]
9999
mod test {
100100
use super::*;
101-
use assert_fs::prelude::*;
102101
use assert_fs::TempDir;
102+
use assert_fs::prelude::*;
103103

104104
#[test]
105105
fn should_copy_directories() {
@@ -115,9 +115,10 @@ mod test {
115115
let dest = temp.join("new-parent/child/grand-child/.config");
116116
copy(src.to_string_lossy().into(), dest.to_string_lossy().into()).unwrap();
117117

118-
assert!(temp
119-
.child("new-parent/child/grand-child/.config/file.txt")
120-
.exists());
118+
assert!(
119+
temp.child("new-parent/child/grand-child/.config/file.txt")
120+
.exists()
121+
);
121122
}
122123

123124
#[test]

packages/nx/src/native/cache/http_remote_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::{
77

88
use super::{
99
cache::CachedResult,
10-
errors::{convert_response_to_error, report_request_error, HttpRemoteCacheErrors},
10+
errors::{HttpRemoteCacheErrors, convert_response_to_error, report_request_error},
1111
};
1212
use flate2::Compression;
13-
use reqwest::{header, Client, ClientBuilder, StatusCode};
13+
use reqwest::{Client, ClientBuilder, StatusCode, header};
1414
use tar::{Archive, Builder};
1515
use tracing::trace;
1616

packages/nx/src/native/db/initialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::native::db::connection::NxDbConnection;
22
use rusqlite::{Connection, OpenFlags};
3-
use std::fs::{remove_file, File};
3+
use std::fs::{File, remove_file};
44
use std::path::{Path, PathBuf};
55
use tracing::{debug, trace};
66

packages/nx/src/native/glob/glob_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::native::glob::glob_group::GlobGroup;
22
use nom::branch::alt;
33
use nom::bytes::complete::{is_not, tag, take_till, take_until, take_while};
44
use nom::combinator::{eof, map, map_parser};
5-
use nom::error::{context, convert_error, VerboseError};
5+
use nom::error::{VerboseError, context, convert_error};
66
use nom::multi::{many_till, separated_list0};
77
use nom::sequence::{preceded, terminated};
88
use nom::{Finish, IResult};

0 commit comments

Comments
 (0)