Skip to content

Commit 3d08d55

Browse files
committed
fix: fixed CI issues, and added docs check to pre push
1 parent 499b18d commit 3d08d55

9 files changed

Lines changed: 50 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353
- target: aarch64-unknown-linux-gnu
5454
os: ubuntu-22.04
5555
artifact: apvm-napi.linux-arm64-gnu.node
56+
# Vendor OpenSSL from source for cross-compilation (no system libssl-dev:arm64)
57+
# https://docs.rs/openssl/latest/openssl/#vendored
58+
features: vendored-openssl
5659
- target: x86_64-pc-windows-msvc
5760
os: windows-latest
5861
artifact: apvm-napi.win32-x64-msvc.node
@@ -72,9 +75,15 @@ jobs:
7275
sudo apt-get install -y gcc-aarch64-linux-gnu
7376
- run: npm install
7477
- name: Build NAPI
75-
run: npx napi build --release --platform --manifest-path crates/napi/Cargo.toml --output-dir . --target ${{ matrix.settings.target }}
78+
run: >
79+
npx napi build --release --platform
80+
--manifest-path crates/napi/Cargo.toml --output-dir .
81+
--target ${{ matrix.settings.target }}
82+
${{ matrix.settings.features && format('--features {0}', matrix.settings.features) || '' }}
7683
env:
7784
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
85+
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
86+
AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar
7887
- name: Upload .node artifact
7988
uses: actions/upload-artifact@v7
8089
with:

.husky/pre-push

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
# Steps:
99
# 1. Rust formatting — cargo fmt --all --check
1010
# 2. Clippy lints — cargo clippy (deny all warnings)
11-
# 3. Rust tests — cargo test --workspace
12-
# 4. Native module build — npm run build (NAPI binary)
13-
# 5. TypeScript typecheck — tsc --noEmit
14-
# 6. Integration tests — vitest (Node.js tests)
11+
# 3. Rust documentation — cargo doc (deny all warnings)
12+
# 4. Rust tests — cargo test --workspace
13+
# 5. Native module build — npm run build (NAPI binary)
14+
# 6. TypeScript typecheck — tsc --noEmit
15+
# 7. Integration tests — vitest (Node.js tests)
1516
#
1617
# Skip with: git push --no-verify
1718
# Docs: https://typicode.github.io/husky/
@@ -23,7 +24,7 @@ CYAN='\033[0;36m'
2324
NC='\033[0m' # No Color
2425

2526
step=0
26-
total=6
27+
total=7
2728

2829
run_step() {
2930
step=$((step + 1))
@@ -42,6 +43,7 @@ printf "${CYAN}═════════════════════
4243

4344
run_step "Rust formatting" "cargo fmt --all --check"
4445
run_step "Clippy lints" "cargo clippy --workspace --all-targets --locked -- -D warnings"
46+
run_step "Rust documentation" "RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --locked"
4547
run_step "Rust tests" "cargo test --workspace --locked"
4648
run_step "Native module build" "npm run build"
4749
run_step "TypeScript typecheck" "npm run typecheck"

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ tempfile = "3"
7575
# https://docs.rs/reqwest/0.13 — pre-1.0, 0.13.x is compatible range
7676
reqwest = { version = "0.13", default-features = false, features = ["native-tls"] }
7777

78+
# OpenSSL vendored build (for Linux cross-compilation)
79+
# When the `vendored-openssl` feature is enabled, openssl-sys builds OpenSSL
80+
# from source using the target's C cross-compiler instead of requiring system
81+
# libraries. Only needed for CI cross-compile (aarch64-unknown-linux-gnu).
82+
# https://docs.rs/openssl/latest/openssl/#vendored
83+
openssl = { version = "0.10", features = ["vendored"] }
84+
7885
# Internal crates
7986
apvm-config = { path = "crates/config" }
8087
apvm-core = { path = "crates/core" }

crates/config/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl Config {
136136
/// # Adding a new key
137137
///
138138
/// 1. Add a variant here.
139-
/// 2. The compiler will guide you to update [`FromStr`], [`Display`],
139+
/// 2. The compiler will guide you to update [`FromStr`], [`fmt::Display`],
140140
/// [`ConfigKey::all`], [`ConfigKey::is_sensitive`], and the
141141
/// [`ConfigFile`] methods that match on this enum.
142142
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

crates/core/src/build/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub fn matches_any_exclusion(filename: &str, patterns: &[ExclusionPattern<'_>])
114114
///
115115
/// # Behavior
116116
///
117-
/// - Uses [`WalkDir::filter_entry`] to prevent **descending** into excluded
117+
/// - Uses [`walkdir::IntoIter::filter_entry`] to prevent **descending** into excluded
118118
/// directories entirely (critical for performance — e.g., `node_modules`
119119
/// can contain 50,000+ files).
120120
/// Source: <https://docs.rs/walkdir/2/walkdir/struct.IntoIter.html#method.filter_entry>

crates/core/src/commands/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl BuildOutput {
7979
/// Convert to storage metadata.
8080
///
8181
/// Creates a [`BuildMetadata`] struct suitable for passing to
82-
/// [`ArtifactStore::store()`].
82+
/// [`apvm_storage::ArtifactStore::store()`].
8383
///
8484
/// # Arguments
8585
///
@@ -107,7 +107,7 @@ impl BuildOutput {
107107
/// Convert artifacts to storage format.
108108
///
109109
/// Transforms [`ProducedArtifact`]s into [`SourceArtifact`]s suitable
110-
/// for passing to [`ArtifactStore::store()`].
110+
/// for passing to [`apvm_storage::ArtifactStore::store()`].
111111
///
112112
/// # Returns
113113
///

crates/core/src/git/workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl BuildWorkspace {
152152
self.temp_dir.path().join(&self.repo_name)
153153
}
154154

155-
/// Create a [`BuildContext`] from this workspace.
155+
/// Create a [`crate::build::BuildContext`] from this workspace.
156156
///
157157
/// Maps the workspace's directory structure to the build context:
158158
/// - `workspace_dir` → the temp directory root ([`path()`](Self::path))

crates/napi/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ license = "MIT"
99
[lib]
1010
crate-type = ["cdylib"]
1111

12+
[features]
13+
# Build OpenSSL from source for cross-compilation (e.g. aarch64-unknown-linux-gnu).
14+
# Activates the `vendored` feature of the `openssl` crate, which causes `openssl-sys`
15+
# to compile OpenSSL using the target's C cross-compiler instead of relying on
16+
# system-installed libraries. Only needed in CI for Linux ARM64 cross-builds.
17+
vendored-openssl = ["dep:openssl"]
18+
1219
[dependencies]
1320
# Internal crates
1421
apvm-core = { workspace = true }
@@ -22,5 +29,8 @@ napi-derive = { workspace = true }
2229
# Async runtime (needs rt-multi-thread for napi async)
2330
tokio = { workspace = true }
2431

32+
# OpenSSL vendored build — only activated by the `vendored-openssl` feature
33+
openssl = { workspace = true, optional = true }
34+
2535
[build-dependencies]
2636
napi-build = { workspace = true }

0 commit comments

Comments
 (0)