diff --git a/.cargo/config.toml b/.cargo/config.toml index 4ba718d4..0ed03070 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,8 +1,20 @@ # Windows-specific linker configuration to avoid PDB errors [target.x86_64-pc-windows-msvc] -# Use /DEBUG:NONE to completely disable PDB generation in debug builds -# This avoids LNK1318 errors when too many PDBs are generated in parallel -rustflags = ["-C", "link-args=/DEBUG:NONE"] +# Use lld-link instead of link.exe to avoid PDB size limits (LNK1318) +# lld-link is LLVM's linker and doesn't have the same PDB limitations as MSVC's link.exe +linker = "rust-lld" +# Disable incremental compilation and debug info to avoid LNK1318 PDB size limits +# Use /DEBUG:NONE to completely disable PDB generation +# /NODEFAULTLIB:libcmt to suppress LNK4098 warning +rustflags = [ + "-C", "incremental=off", + "-C", "debuginfo=0", + "-C", "codegen-units=256", + "-C", "link-arg=/DEBUG:NONE", + "-C", "link-arg=/NODEFAULTLIB:libcmt", + "-C", "link-arg=/INCREMENTAL:NO", + "-C", "link-arg=/OPT:NOREF", +] [alias] pctx = "run -p pctx --" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 90964564..fca23483 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,6 +81,14 @@ jobs: with: # Clean up old cache entries to save space cache-on-failure: false + + # Install build dependencies for libsqlite3-sys bindgen + - name: Install build dependencies (Linux) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y libclang-dev libc6-dev + # - name: Set Windows build jobs # if: matrix.os == 'windows-latest' # run: echo "CARGO_BUILD_JOBS=1" >> $GITHUB_ENV diff --git a/Cargo.lock b/Cargo.lock index d305c40e..60278558 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -653,7 +653,7 @@ dependencies = [ "bitflags 2.10.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.12.1", "proc-macro2", "quote", "regex", @@ -671,7 +671,7 @@ dependencies = [ "bitflags 2.10.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.12.1", "log", "prettyplease", "proc-macro2", @@ -2357,7 +2357,7 @@ dependencies = [ "tokio", "tracing", "url", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f9c87fad..7ceedace 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ repository = "https://github.com/portofcontext/pctx" tracing = "0.1.41" thiserror = "2.0" - [workspace.lints.rust] unreachable_pub = "warn" @@ -31,15 +30,20 @@ too_many_lines = "allow" [profile.release] opt-level = 3 -lto = "fat" -codegen-units = 1 -strip = true +# Use thin LTO to reduce PDB size on Windows (fat LTO creates massive PDB files) +lto = "thin" +# Increase codegen units to reduce per-unit size and avoid Windows PDB limits +codegen-units = 16 +strip = "debuginfo" +# Completely disable debug info to avoid Windows PDB size limits (LNK1318 error) +debug = 0 # The profile that 'dist' will build with [profile.dist] inherits = "release" lto = "thin" - +# Reduce debug info to avoid Windows PDB size limits (LNK1318 error) +debug = 0 # [profile.dev.package."*"] # opt-level = 3 diff --git a/crates/deno_executor/Cargo.toml b/crates/deno_executor/Cargo.toml index 81c94576..12e2f85d 100644 --- a/crates/deno_executor/Cargo.toml +++ b/crates/deno_executor/Cargo.toml @@ -24,7 +24,9 @@ tracing = { workspace = true } futures = "0.3" [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.61.2", features = [ +# Need version 0.59 to match deno_subprocess_windows transitive dependency +# and ensure the feature is enabled for it as well +windows-sys = { version = "0.59", features = [ "Win32_System_SystemInformation", ] } diff --git a/crates/pctx/Cargo.toml b/crates/pctx/Cargo.toml index c6be05e0..4dd79040 100644 --- a/crates/pctx/Cargo.toml +++ b/crates/pctx/Cargo.toml @@ -108,3 +108,11 @@ workspace = true [package.metadata.dist] dist = true + +# System dependencies for cargo-dist to install +[package.metadata.dist.dependencies.apt] +libclang-dev = "*" +libc6-dev = "*" + +[package.metadata.dist.dependencies.chocolatey] +nasm = "*" diff --git a/dist-workspace.toml b/dist-workspace.toml index bc493c7b..1df46eda 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -26,7 +26,12 @@ pr-run-mode = "plan" # Whether CI should include auto-generated code to build local artifacts build-local-artifacts = true # Target platforms to build apps for (Rust target-triple syntax) -targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-unknown-linux-gnu", + "x86_64-pc-windows-msvc", +] # Where to host releases hosting = "github" # Whether to install an updater program