fix(ci): use SODIUM_LIB_DIR to bypass pkg-config detection #105

Merged
sarman merged 4 commits from fix/libsodium-direct-path into beta 2026-06-14 20:04:47 +00:00
Owner

Directly specify libsodium library paths via SODIUM_LIB_DIR environment
variable instead of relying on pkg-config detection. This is the highest
priority method in libsodium-sys-stable's build.rs and bypasses all
pkg-config/vcpkg logic.

Platform-specific paths:

  • Linux x86_64: /usr/lib/x86_64-linux-gnu
  • Linux aarch64: /usr/lib/aarch64-linux-gnu
  • Windows MinGW: /usr/x86_64-w64-mingw32/lib

Changes:

  • test.yml: Add SODIUM_LIB_DIR to all cargo commands
  • auto-tag.yml: Add SODIUM_LIB_DIR to all build jobs

This resolves "libsodium not found via pkg-config or vcpkg" by telling
the build script exactly where libsodium is installed.

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Directly specify libsodium library paths via SODIUM_LIB_DIR environment variable instead of relying on pkg-config detection. This is the highest priority method in libsodium-sys-stable's build.rs and bypasses all pkg-config/vcpkg logic. Platform-specific paths: - Linux x86_64: /usr/lib/x86_64-linux-gnu - Linux aarch64: /usr/lib/aarch64-linux-gnu - Windows MinGW: /usr/x86_64-w64-mingw32/lib Changes: - test.yml: Add SODIUM_LIB_DIR to all cargo commands - auto-tag.yml: Add SODIUM_LIB_DIR to all build jobs This resolves "libsodium not found via pkg-config or vcpkg" by telling the build script exactly where libsodium is installed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sarman added 1 commit 2026-06-14 15:36:37 +00:00
fix(ci): use SODIUM_LIB_DIR to bypass pkg-config detection
Some checks failed
Test / frontend-tests (pull_request) Successful in 1m40s
Test / frontend-typecheck (pull_request) Successful in 1m51s
PR Review Automation / review (pull_request) Successful in 3m32s
Test / rust-fmt-check (pull_request) Successful in 11m27s
Test / rust-tests (pull_request) Failing after 11m53s
Test / rust-clippy (pull_request) Failing after 11m55s
863868b2fc
Directly specify libsodium library paths via SODIUM_LIB_DIR environment
variable instead of relying on pkg-config detection. This is the highest
priority method in libsodium-sys-stable's build.rs and bypasses all
pkg-config/vcpkg logic.

Platform-specific paths:
- Linux x86_64: /usr/lib/x86_64-linux-gnu
- Linux aarch64: /usr/lib/aarch64-linux-gnu
- Windows MinGW: /usr/x86_64-w64-mingw32/lib

Changes:
- test.yml: Add SODIUM_LIB_DIR to all cargo commands
- auto-tag.yml: Add SODIUM_LIB_DIR to all build jobs

This resolves "libsodium not found via pkg-config or vcpkg" by telling
the build script exactly where libsodium is installed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sarman reviewed 2026-06-14 15:40:08 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3-coder-next via liteLLM):\n\nSummary

This PR adds SODIUM_LIB_DIR environment variable to CI workflows (test.yml and auto-tag.yml) to help libsodium-sys-stable locate the libsodium library without relying on pkg-config. The change is straightforward and targeted—adding the correct platform-specific library path in each build job.

Findings

  • No findings. The changes are correct and consistent with the described fix. The SODIUM_LIB_DIR environment variable is properly added to all relevant cargo commands in test.yml and all build steps in auto-tag.yml, using the documented platform-specific paths.

Verdict: APPROVE

Automated PR Review (qwen3-coder-next via liteLLM):\n\n**Summary** This PR adds `SODIUM_LIB_DIR` environment variable to CI workflows (`test.yml` and `auto-tag.yml`) to help `libsodium-sys-stable` locate the libsodium library without relying on `pkg-config`. The change is straightforward and targeted—adding the correct platform-specific library path in each build job. **Findings** - **No findings.** The changes are correct and consistent with the described fix. The `SODIUM_LIB_DIR` environment variable is properly added to all relevant `cargo` commands in `test.yml` and all `build` steps in `auto-tag.yml`, using the documented platform-specific paths. **Verdict**: APPROVE
sarman added 1 commit 2026-06-14 15:53:04 +00:00
fix: remove use-pkg-config feature conflicting with SODIUM_LIB_DIR
Some checks failed
Test / frontend-tests (pull_request) Successful in 1m39s
Test / frontend-typecheck (pull_request) Successful in 1m47s
PR Review Automation / review (pull_request) Successful in 3m43s
Test / rust-fmt-check (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / rust-clippy (pull_request) Has been cancelled
b20deab391
The use-pkg-config feature was added in the previous PR and conflicts
with SODIUM_LIB_DIR. The build script errors with:

  "SODIUM_LIB_DIR is incompatible with SODIUM_USE_PKG_CONFIG.
   Set the only one env variable"

Removed the explicit libsodium-sys-stable dependency since we're using
the SODIUM_LIB_DIR environment variable approach instead.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sarman reviewed 2026-06-14 15:56:45 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3-coder-next via liteLLM):\n\nSummary

This PR adds SODIUM_LIB_DIR environment variable to CI workflows (test.yml and auto-tag.yml) to bypass pkg-config detection for libsodium-sys-stable. The changes are consistent, targeted, and follow the documented priority order in the dependency’s build script. Platform-specific paths are correctly specified.

Findings

  • [WARNING] .gitea/workflows/test.yml - cargo fmt invocation missing SODIUM_LIB_DIR in rust-fmt-check job
    Evidence: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml and cargo fmt --manifest-path src-tauri/Cargo.toml --check both include SODIUM_LIB_DIR, but cargo generate-lockfile appears before SODIUM_LIB_DIR is added to the environment.
    Specifically:

    - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml
      env:
        SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu
    - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
      env:
        SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu
    

    However, cargo generate-lockfile itself may invoke build scripts (e.g., if any dependencies require it), and in theory could fail without the environment variable set — though in practice this command usually doesn’t trigger build scripts.
    Fix: Move SODIUM_LIB_DIR to the job-level env: section (as done in rust-clippy and rust-tests) or ensure all cargo steps explicitly have it.

  • [WARNING] .gitea/workflows/auto-tag.yml - Windows build step retains PKG_CONFIG variables that are now redundant
    Evidence:

    - name: Build
      env:
        CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc
        CXX_x86_64_pc_windows_gnu: x86_64-w64-mingw32-g++
        AR_x86_64_pc_windows_gnu: x86_64-w64-mingw32-ar
        CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
        OPENSSL_NO_VENDOR: "0"
        OPENSSL_STATIC: "1"
        SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib
    

    The original diff shows PKG_CONFIG_x86_64_pc_windows_gnu and PKG_CONFIG_ALLOW_CROSS were removed — which is correct.
    But the build-windows-amd64 job now sets SODIUM_LIB_DIR instead of PKG_CONFIG_*, while other Windows-cross jobs in the same file may still use different patterns. However, the diff confirms this job is correctly updated.
    This is a non-issue — no bug exists. (The presence of removed PKG_CONFIG_* variables is not an issue since they’re gone.)

Verification note: After inspecting the full diff for auto-tag.yml, the Windows and Linux jobs correctly set SODIUM_LIB_DIR with no residual PKG_CONFIG_* variables in those jobs. The SODIUM_LIB_DIR placement is consistent.

The only remaining question is cargo generate-lockfile. While unlikely to trigger libsodium-sys-stable’s build script, the safest and most consistent practice is to apply the environment variable at the job level — like the rust-clippy job does — rather than only on specific steps. This ensures all Rust tooling in that job has access to it.

Verdict: APPROVE WITH COMMENTS

Automated PR Review (qwen3-coder-next via liteLLM):\n\n**Summary** This PR adds `SODIUM_LIB_DIR` environment variable to CI workflows (`test.yml` and `auto-tag.yml`) to bypass `pkg-config` detection for `libsodium-sys-stable`. The changes are consistent, targeted, and follow the documented priority order in the dependency’s build script. Platform-specific paths are correctly specified. **Findings** - [WARNING] .gitea/workflows/test.yml - cargo fmt invocation missing SODIUM_LIB_DIR in rust-fmt-check job Evidence: `cargo generate-lockfile --manifest-path src-tauri/Cargo.toml` and `cargo fmt --manifest-path src-tauri/Cargo.toml --check` both include `SODIUM_LIB_DIR`, but `cargo generate-lockfile` appears *before* `SODIUM_LIB_DIR` is added to the environment. Specifically: ```yaml - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml env: SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check env: SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu ``` However, `cargo generate-lockfile` itself may invoke build scripts (e.g., if any dependencies require it), and in theory could fail without the environment variable set — though in practice this command usually doesn’t trigger build scripts. **Fix**: Move `SODIUM_LIB_DIR` to the job-level `env:` section (as done in `rust-clippy` and `rust-tests`) or ensure *all* `cargo` steps explicitly have it. - [WARNING] .gitea/workflows/auto-tag.yml - Windows build step retains PKG_CONFIG variables that are now redundant Evidence: ```yaml - name: Build env: CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc CXX_x86_64_pc_windows_gnu: x86_64-w64-mingw32-g++ AR_x86_64_pc_windows_gnu: x86_64-w64-mingw32-ar CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc OPENSSL_NO_VENDOR: "0" OPENSSL_STATIC: "1" SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib ``` The original diff shows `PKG_CONFIG_x86_64_pc_windows_gnu` and `PKG_CONFIG_ALLOW_CROSS` were removed — which is correct. But the `build-windows-amd64` job now sets `SODIUM_LIB_DIR` instead of `PKG_CONFIG_*`, while other Windows-cross jobs in the same file may still use different patterns. However, the diff confirms *this* job is correctly updated. This is a non-issue — no bug exists. (The presence of *removed* `PKG_CONFIG_*` variables is not an issue since they’re gone.) **Verification note**: After inspecting the full diff for `auto-tag.yml`, the Windows and Linux jobs correctly set `SODIUM_LIB_DIR` with no residual `PKG_CONFIG_*` variables in those jobs. The `SODIUM_LIB_DIR` placement is consistent. The only remaining question is `cargo generate-lockfile`. While unlikely to trigger `libsodium-sys-stable`’s build script, the safest and most consistent practice is to apply the environment variable at the *job level* — like the `rust-clippy` job does — rather than only on specific steps. This ensures all Rust tooling in that job has access to it. **Verdict**: APPROVE WITH COMMENTS
sarman added 1 commit 2026-06-14 15:59:51 +00:00
refactor(ci): move SODIUM_LIB_DIR to job-level env
Some checks failed
PR Review Automation / review (pull_request) Successful in 3m20s
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
1172f20137
Moved SODIUM_LIB_DIR from per-step env blocks to job-level env for all
three Rust test jobs (rust-fmt-check, rust-clippy, rust-tests).

Benefits:
- Applies to ALL cargo commands in the job, including generate-lockfile
- More maintainable - single declaration per job
- Consistent with best practices for job-wide environment variables

Addresses automated review feedback.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sarman added 1 commit 2026-06-14 16:00:11 +00:00
docs: update fix summary with commit history
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m42s
Test / frontend-typecheck (pull_request) Successful in 1m51s
PR Review Automation / review (pull_request) Successful in 3m59s
Test / rust-fmt-check (pull_request) Successful in 11m21s
Test / rust-clippy (pull_request) Successful in 13m23s
Test / rust-tests (pull_request) Successful in 15m10s
7b2377351a
Author
Owner

What Was Fixed

Problem: libsodium-sys-stable build script failing with "libsodium not found via pkg-config or vcpkg"

Root Cause:

  1. Previous PR added use-pkg-config feature but pkg-config couldn't find libraries
  2. When I added SODIUM_LIB_DIR, the two approaches conflicted

Solution: Use SODIUM_LIB_DIR exclusively (highest priority in build script)

Commits

  1. 863868b2 - Added SODIUM_LIB_DIR to all CI workflows
  2. b20deab3 - Removed conflicting use-pkg-config feature from Cargo.toml
  3. 1172f201 - Refactored test.yml to use job-level env (per automated review)
  4. 7b237735 - Updated documentation

Configuration

  • test.yml: Job-level SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu for all Rust jobs
  • auto-tag.yml: Platform-specific paths:
    • Linux x86_64: /usr/lib/x86_64-linux-gnu
    • Linux aarch64: /usr/lib/aarch64-linux-gnu
    • Windows: /usr/x86_64-w64-mingw32/lib

Automated Review Status

APPROVED - All concerns addressed in commit 3

What Was Fixed Problem: libsodium-sys-stable build script failing with "libsodium not found via pkg-config or vcpkg" Root Cause: 1. Previous PR added use-pkg-config feature but pkg-config couldn't find libraries 2. When I added SODIUM_LIB_DIR, the two approaches conflicted Solution: Use SODIUM_LIB_DIR exclusively (highest priority in build script) Commits 1. 863868b2 - Added SODIUM_LIB_DIR to all CI workflows 2. b20deab3 - Removed conflicting use-pkg-config feature from Cargo.toml 3. 1172f201 - Refactored test.yml to use job-level env (per automated review) 4. 7b237735 - Updated documentation Configuration - test.yml: Job-level SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu for all Rust jobs - auto-tag.yml: Platform-specific paths: - Linux x86_64: /usr/lib/x86_64-linux-gnu - Linux aarch64: /usr/lib/aarch64-linux-gnu - Windows: /usr/x86_64-w64-mingw32/lib Automated Review Status ✅ APPROVED - All concerns addressed in commit 3
sarman reviewed 2026-06-14 16:03:10 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3-coder-next via liteLLM):\n\nSummary
The PR adds SODIUM_LIB_DIR environment variable to CI workflows to bypass pkg-config detection for libsodium-sys-stable, correctly specifying platform-specific library paths. However, inspection reveals the cargo generate-lockfile command in the rust-fmt-check job of test.yml runs before SODIUM_LIB_DIR is defined at the step level — though the issue is mitigated by prior review notes indicating the change was intentionally fixed at job level in a later commit.

Findings

  • [WARNING] .gitea/workflows/test.yml:116 - cargo generate-lockfile runs before SODIUM_LIB_DIR is defined in rust-fmt-check job
    Evidence:

    - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml
      # NO env: SODIUM_LIB_DIR defined here
    - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
      env:
        SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu
    

    Fix: Move SODIUM_LIB_DIR to the job-level env: section (as done in rust-clippy and rust-tests jobs) to ensure all Rust commands in the job have access to it.

  • [WARNING] .gitea/workflows/auto-tag.yml:299-300 - Windows build step is missing PKG_CONFIG_ALLOW_CROSS that may be needed for cross-compilation despite removing PKG_CONFIG_*
    Evidence:

    env:
      CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc
      CXX_x86_64_pc_windows_gnu: x86_64-w64-mingw32-g++
      AR_x86_64_pc_windows_gnu: x86_64-w64-mingw32-ar
      CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
      OPENSSL_NO_VENDOR: "0"
      OPENSSL_STATIC: "1"
      SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib
    

    However, PKG_CONFIG_ALLOW_CROSS is not strictly required when using SODIUM_LIB_DIR (as per the libsodium build script logic), and prior review confirms this job correctly removes conflicting PKG_CONFIG_* variables. Since SODIUM_LIB_DIR bypasses pkg-config entirely, no PKG_CONFIG_* variables should be needed — this is a false positive and should be ignored.

Verdict: APPROVE WITH COMMENTS
The issue with cargo generate-lockfile missing SODIUM_LIB_DIR in rust-fmt-check is a valid concern — while unlikely to cause failures in practice (as cargo generate-lockfile typically doesn’t trigger build scripts), consistency with other jobs and safety dictate moving SODIUM_LIB_DIR to job-level. This was already addressed in prior commits per the PR history (1172f201), so the fix is imminent.

Automated PR Review (qwen3-coder-next via liteLLM):\n\n**Summary** The PR adds `SODIUM_LIB_DIR` environment variable to CI workflows to bypass `pkg-config` detection for `libsodium-sys-stable`, correctly specifying platform-specific library paths. However, inspection reveals the `cargo generate-lockfile` command in the `rust-fmt-check` job of `test.yml` runs *before* `SODIUM_LIB_DIR` is defined at the step level — though the issue is mitigated by prior review notes indicating the change was intentionally fixed at job level in a later commit. **Findings** - [WARNING] .gitea/workflows/test.yml:116 - `cargo generate-lockfile` runs before `SODIUM_LIB_DIR` is defined in `rust-fmt-check` job Evidence: ```yaml - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml # NO env: SODIUM_LIB_DIR defined here - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check env: SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu ``` Fix: Move `SODIUM_LIB_DIR` to the job-level `env:` section (as done in `rust-clippy` and `rust-tests` jobs) to ensure *all* Rust commands in the job have access to it. - [WARNING] .gitea/workflows/auto-tag.yml:299-300 - Windows build step is missing `PKG_CONFIG_ALLOW_CROSS` that may be needed for cross-compilation despite removing `PKG_CONFIG_*` Evidence: ```yaml env: CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc CXX_x86_64_pc_windows_gnu: x86_64-w64-mingw32-g++ AR_x86_64_pc_windows_gnu: x86_64-w64-mingw32-ar CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc OPENSSL_NO_VENDOR: "0" OPENSSL_STATIC: "1" SODIUM_LIB_DIR: /usr/x86_64-w64-mingw32/lib ``` However, `PKG_CONFIG_ALLOW_CROSS` is not strictly required when using `SODIUM_LIB_DIR` (as per the libsodium build script logic), and prior review confirms this job correctly removes conflicting `PKG_CONFIG_*` variables. Since `SODIUM_LIB_DIR` bypasses pkg-config entirely, no `PKG_CONFIG_*` variables should be needed — **this is a false positive** and should be ignored. **Verdict**: APPROVE WITH COMMENTS The issue with `cargo generate-lockfile` missing `SODIUM_LIB_DIR` in `rust-fmt-check` is a valid concern — while unlikely to cause failures in practice (as `cargo generate-lockfile` typically doesn’t trigger build scripts), consistency with other jobs and safety dictate moving `SODIUM_LIB_DIR` to job-level. This was already addressed in prior commits per the PR history (`1172f201`), so the fix is imminent.
sarman reviewed 2026-06-14 16:07:17 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen3-coder-next via liteLLM):\n\nLooking at this PR and the previous review history, I can see that:

  1. This PR is the third iteration addressing a libsodium build issue
  2. Previous automated reviews flagged that cargo generate-lockfile in the rust-fmt-check job runs before SODIUM_LIB_DIR is defined at step level
  3. The PR history shows commit 1172f201 was meant to "refactor(ci): move SODIUM_LIB_DIR to job-level env" to address this
  4. However, reviewing the current test.yml file content, I can see that in the rust-fmt-check job, the environment variable is still only defined at the step level, not at the job level

Let me check the current state of test.yml more carefully:

In the rust-fmt-check job (lines ~35-55 in the current content):

  • There's a global env: SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu at the job level
  • The steps are:
    1. Checkout (no cargo commands here)
    2. Install Node.js (no cargo commands)
    3. Install system dependencies (no cargo commands)
    4. Install dependencies with retry (no cargo commands)
    5. Update version from Git (no cargo commands)
    6. cargo generate-lockfile (no explicit env, so inherits job-level env)
    7. cargo fmt (no explicit env, so inherits job-level env)

Wait, looking again - the current test.yml shows that ALL three Rust jobs (rust-fmt-check, rust-clippy, rust-tests) have SODIUM_LIB_DIR at the job level env: section.

But the rust-fmt-check job shows the cargo generate-lockfile step running WITHOUT an explicit env: section, and cargo fmt step also WITHOUT an explicit env: section. Since there IS a job-level env:, both commands should inherit it.

Let me verify the actual file content again:

Looking at the rust-fmt-check job in the provided test.yml:

rust-fmt-check:
  runs-on: ubuntu-latest
  container:
    image: rustlang/rust:nightly
  env:
    SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu

So yes, there IS a job-level env: section with SODIUM_LIB_DIR defined.

The previous automated reviews were referring to an earlier state of the file where this wasn't the case, but the current content shows it's been fixed.

Looking at all changed files for actual issues:

  1. .gitea/workflows/test.yml - All three Rust jobs have job-level SODIUM_LIB_DIR set correctly. ✓

  2. .gitea/workflows/auto-tag.yml - All build jobs have platform-specific SODIUM_LIB_DIR set. ✓

  3. src-tauri/Cargo.toml - The file shown doesn't include the libsodium dependency at all. The PR description mentions removing the use-pkg-config feature, but the current file doesn't show any libsodium-sys-stable dependency. This is suspicious - if libsodium isn't in Cargo.toml, the build wouldn't be failing.

  4. FIX_SUMMARY.md - Documentation file explaining the fix.

Wait, the PR title says "FIX_SUMMARY.md" is changed, and looking at the content, I see that the final state section says:

Files modified:
- `.gitea/workflows/test.yml` - SODIUM_LIB_DIR at job level for 3 Rust jobs
- `.gitea/workflows/auto-tag.yml` - SODIUM_LIB_DIR in Build steps for all platforms
- `src-tauri/Cargo.toml` - Removed conflicting use-pkg-config dependency
- `src-tauri/Cargo.lock` - Updated after dependency removal

But when I look at the src-tauri/Cargo.toml content, there's no libsodium-sys-stable dependency present. This suggests either:

  1. The dependency was never actually in the file (and the fix is addressing a non-existent problem)
  2. The file content shown is incomplete

Since this is a code review based on the provided files, I need to work with what's shown. If libsodium-sys-stable isn't in Cargo.toml, then there's no issue to fix.

But wait - let me re-read the PR description carefully:

"This resolves "libsodium not found via pkg-config or vcpkg" by telling the build script exactly where libsodium is installed."

And the FIX_SUMMARY.md states:

The only remaining question is `cargo generate-lockfile`. While unlikely to cause failures in practice (as `cargo generate-lockfile` typically doesn’t trigger build scripts), consistency with other jobs and safety dictate moving `SODIUM_LIB_DIR` to job-level.

But looking at the actual current file content, the job-level SODIUM_LIB_DIR is already there in all three jobs.

Given all this, I need to focus on what's actually broken or incorrect in the current PR state.

The main issue I can see is that the src-tauri/Cargo.toml shown doesn't contain any libsodium-sys-stable dependency. If this dependency isn't present, then:

  1. The fix being applied is unnecessary (there's no libsodium dependency to configure)
  2. Or the dependency is missing from Cargo.toml entirely (which would be a separate issue)

Let me also check if there might be a transitive dependency on libsodium through another crate. Looking at the dependencies list in Cargo.toml, I don't see anything obvious that would depend on libsodium.

Given the constraints, the most likely scenario is that the libsodium-sys-stable dependency IS present (just not shown in the truncated file content), and the fix is appropriate.

But wait - let me check the file length. The Cargo.toml shown is 74 lines, and the content ends with:

[dev-dependencies]
tokio-test = "0.4"
mockito = "1.2"
rustls = { version = "0.23", features = ["aws_lc_rs"] }

[profile.release]
opt-level = "s"
strip = true

There's no libsodium dependency in this file. This is a critical issue - if libsodium-sys-stable is not in Cargo.toml, then the entire fix is addressing a dependency that doesn't exist, and the PR should fail to resolve the stated issue.

Actually, I need to reconsider - the PR title says this is a fix for libsodium, but maybe libsodium is brought in transitively. Let me think about what could cause this:

The error message in FIX_SUMMARY.md says:

thread 'main' panicked at build.rs:539:13:
libsodium not found via pkg-config or vcpkg

This is from libsodium-sys-stable/build.rs, so there must be some dependency pulling in libsodium-sys-stable. Since it's not in Cargo.toml, it must be a transitive dependency.

Looking at the dependencies in Cargo.toml, none of them immediately suggest libsodium usage. However, this could be a transitive dependency through one of the many crates.

Given all this analysis, the most critical finding is:

Summary

The PR attempts to fix libsodium build failures by adding SODIUM_LIB_DIR environment variable, but the current Cargo.toml does not show any libsodium-sys-stable dependency. This suggests either the dependency is missing (which would indicate a different root cause) or the file content is incomplete. The CI changes appear correct for the stated goal, but without confirming libsodium-sys-stable is actually a dependency, the fix may not address the real issue.

Findings

  • [WARNING] src-tauri/Cargo.toml - libsodium-sys-stable dependency not visible in provided file content
    Evidence: The provided Cargo.toml (74 lines) contains no mention of libsodium-sys-stable, libsodium, or sodium dependencies, yet the PR claims to fix a libsodium build issue. This inconsistency suggests the dependency file is incomplete or the fix is mis-targeted.
    Fix: Verify that libsodium-sys-stable is present in Cargo.toml (direct or transitive) and that the fix addresses the correct dependency.

Verdict: REQUEST CHANGES

The reviewer should confirm that libsodium-sys-stable is actually a dependency before merging this fix, as the current Cargo.toml doesn't show it. Without this, the CI changes may not resolve the intended issue.

Automated PR Review (qwen3-coder-next via liteLLM):\n\nLooking at this PR and the previous review history, I can see that: 1. This PR is the third iteration addressing a libsodium build issue 2. Previous automated reviews flagged that `cargo generate-lockfile` in the `rust-fmt-check` job runs before `SODIUM_LIB_DIR` is defined at step level 3. The PR history shows commit `1172f201` was meant to "refactor(ci): move SODIUM_LIB_DIR to job-level env" to address this 4. However, reviewing the current `test.yml` file content, I can see that in the `rust-fmt-check` job, the environment variable is still only defined at the step level, not at the job level Let me check the current state of `test.yml` more carefully: In the `rust-fmt-check` job (lines ~35-55 in the current content): - There's a global `env: SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu` at the job level - The steps are: 1. Checkout (no cargo commands here) 2. Install Node.js (no cargo commands) 3. Install system dependencies (no cargo commands) 4. Install dependencies with retry (no cargo commands) 5. Update version from Git (no cargo commands) 6. `cargo generate-lockfile` (no explicit env, so inherits job-level env) 7. `cargo fmt` (no explicit env, so inherits job-level env) Wait, looking again - the current `test.yml` shows that ALL three Rust jobs (`rust-fmt-check`, `rust-clippy`, `rust-tests`) have `SODIUM_LIB_DIR` at the job level `env:` section. But the `rust-fmt-check` job shows the `cargo generate-lockfile` step running WITHOUT an explicit `env:` section, and `cargo fmt` step also WITHOUT an explicit `env:` section. Since there IS a job-level `env:`, both commands should inherit it. Let me verify the actual file content again: Looking at the `rust-fmt-check` job in the provided `test.yml`: ```yaml rust-fmt-check: runs-on: ubuntu-latest container: image: rustlang/rust:nightly env: SODIUM_LIB_DIR: /usr/lib/x86_64-linux-gnu ``` So yes, there IS a job-level `env:` section with `SODIUM_LIB_DIR` defined. The previous automated reviews were referring to an earlier state of the file where this wasn't the case, but the current content shows it's been fixed. Looking at all changed files for actual issues: 1. **`.gitea/workflows/test.yml`** - All three Rust jobs have job-level `SODIUM_LIB_DIR` set correctly. ✓ 2. **`.gitea/workflows/auto-tag.yml`** - All build jobs have platform-specific `SODIUM_LIB_DIR` set. ✓ 3. **`src-tauri/Cargo.toml`** - The file shown doesn't include the libsodium dependency at all. The PR description mentions removing the `use-pkg-config` feature, but the current file doesn't show any libsodium-sys-stable dependency. This is suspicious - if libsodium isn't in Cargo.toml, the build wouldn't be failing. 4. **`FIX_SUMMARY.md`** - Documentation file explaining the fix. Wait, the PR title says "FIX_SUMMARY.md" is changed, and looking at the content, I see that the final state section says: ``` Files modified: - `.gitea/workflows/test.yml` - SODIUM_LIB_DIR at job level for 3 Rust jobs - `.gitea/workflows/auto-tag.yml` - SODIUM_LIB_DIR in Build steps for all platforms - `src-tauri/Cargo.toml` - Removed conflicting use-pkg-config dependency - `src-tauri/Cargo.lock` - Updated after dependency removal ``` But when I look at the `src-tauri/Cargo.toml` content, there's no `libsodium-sys-stable` dependency present. This suggests either: 1. The dependency was never actually in the file (and the fix is addressing a non-existent problem) 2. The file content shown is incomplete Since this is a code review based on the provided files, I need to work with what's shown. If `libsodium-sys-stable` isn't in Cargo.toml, then there's no issue to fix. But wait - let me re-read the PR description carefully: "This resolves "libsodium not found via pkg-config or vcpkg" by telling the build script exactly where libsodium is installed." And the `FIX_SUMMARY.md` states: ``` The only remaining question is `cargo generate-lockfile`. While unlikely to cause failures in practice (as `cargo generate-lockfile` typically doesn’t trigger build scripts), consistency with other jobs and safety dictate moving `SODIUM_LIB_DIR` to job-level. ``` But looking at the actual current file content, the job-level `SODIUM_LIB_DIR` is already there in all three jobs. Given all this, I need to focus on what's actually broken or incorrect in the current PR state. The main issue I can see is that the `src-tauri/Cargo.toml` shown doesn't contain any `libsodium-sys-stable` dependency. If this dependency isn't present, then: 1. The fix being applied is unnecessary (there's no libsodium dependency to configure) 2. Or the dependency is missing from Cargo.toml entirely (which would be a separate issue) Let me also check if there might be a transitive dependency on libsodium through another crate. Looking at the dependencies list in Cargo.toml, I don't see anything obvious that would depend on libsodium. Given the constraints, the most likely scenario is that the `libsodium-sys-stable` dependency IS present (just not shown in the truncated file content), and the fix is appropriate. But wait - let me check the file length. The Cargo.toml shown is 74 lines, and the content ends with: ``` [dev-dependencies] tokio-test = "0.4" mockito = "1.2" rustls = { version = "0.23", features = ["aws_lc_rs"] } [profile.release] opt-level = "s" strip = true ``` There's no libsodium dependency in this file. This is a critical issue - if libsodium-sys-stable is not in Cargo.toml, then the entire fix is addressing a dependency that doesn't exist, and the PR should fail to resolve the stated issue. Actually, I need to reconsider - the PR title says this is a fix for libsodium, but maybe libsodium is brought in transitively. Let me think about what could cause this: The error message in FIX_SUMMARY.md says: ``` thread 'main' panicked at build.rs:539:13: libsodium not found via pkg-config or vcpkg ``` This is from `libsodium-sys-stable/build.rs`, so there must be some dependency pulling in libsodium-sys-stable. Since it's not in Cargo.toml, it must be a transitive dependency. Looking at the dependencies in Cargo.toml, none of them immediately suggest libsodium usage. However, this could be a transitive dependency through one of the many crates. Given all this analysis, the most critical finding is: **Summary** The PR attempts to fix libsodium build failures by adding `SODIUM_LIB_DIR` environment variable, but the current `Cargo.toml` does not show any `libsodium-sys-stable` dependency. This suggests either the dependency is missing (which would indicate a different root cause) or the file content is incomplete. The CI changes appear correct for the stated goal, but without confirming libsodium-sys-stable is actually a dependency, the fix may not address the real issue. **Findings** - [WARNING] src-tauri/Cargo.toml - libsodium-sys-stable dependency not visible in provided file content Evidence: The provided Cargo.toml (74 lines) contains no mention of libsodium-sys-stable, libsodium, or sodium dependencies, yet the PR claims to fix a libsodium build issue. This inconsistency suggests the dependency file is incomplete or the fix is mis-targeted. Fix: Verify that libsodium-sys-stable is present in Cargo.toml (direct or transitive) and that the fix addresses the correct dependency. **Verdict**: REQUEST CHANGES The reviewer should confirm that libsodium-sys-stable is actually a dependency before merging this fix, as the current Cargo.toml doesn't show it. Without this, the CI changes may not resolve the intended issue.
sarman merged commit 3d7342656f into beta 2026-06-14 20:04:47 +00:00
sarman deleted branch fix/libsodium-direct-path 2026-06-14 20:04:47 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sarman/tftsr-devops_investigation#105
No description provided.